Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a73384ed29
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (27 sloc) 0.609 kb
#ifndef REQ_WRAP_H_
#define REQ_WRAP_H_
namespace node {
template <typename T>
class ReqWrap {
public:
ReqWrap() {
v8::HandleScope scope;
object_ = v8::Persistent<v8::Object>::New(v8::Object::New());
}
~ReqWrap() {
// Assert that someone has called Dispatched()
assert(req_.data == this);
assert(!object_.IsEmpty());
object_.Dispose();
object_.Clear();
}
// Call this after the req has been dispatched.
void Dispatched() {
req_.data = this;
}
v8::Persistent<v8::Object> object_;
T req_;
void* data_;
};
} // namespace node
#endif // REQ_WRAP_H_
Jump to Line
Something went wrong with that request. Please try again.