summaryrefslogtreecommitdiff
path: root/src/handle_wrap.h
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-07-18 04:22:16 -0700
committerRyan Dahl <ry@tinyclouds.org>2011-07-18 04:22:16 -0700
commit0c7bf8132eed630c81fc96178091d1fc7ad8e65e (patch)
tree536b4e9c8a345ede05dec6ea9dfba702f7b0b9f1 /src/handle_wrap.h
parentcc0f608c7c24e52fe8e6a13f72e20ad520dcd5b4 (diff)
downloadandroid-node-v8-0c7bf8132eed630c81fc96178091d1fc7ad8e65e.tar.gz
android-node-v8-0c7bf8132eed630c81fc96178091d1fc7ad8e65e.tar.bz2
android-node-v8-0c7bf8132eed630c81fc96178091d1fc7ad8e65e.zip
Abstract out HandleWrap class
Diffstat (limited to 'src/handle_wrap.h')
-rw-r--r--src/handle_wrap.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/handle_wrap.h b/src/handle_wrap.h
new file mode 100644
index 0000000000..2c51799a58
--- /dev/null
+++ b/src/handle_wrap.h
@@ -0,0 +1,30 @@
+#ifndef HANDLE_WRAP_H_
+#define HANDLE_WRAP_H_
+
+namespace node {
+
+class HandleWrap {
+ public:
+ static void Initialize(v8::Handle<v8::Object> target);
+ static v8::Handle<v8::Value> Close(const v8::Arguments& args);
+
+ protected:
+ HandleWrap(v8::Handle<v8::Object> object, uv_handle_t* handle);
+ virtual ~HandleWrap();
+
+ virtual void StateChange() {}
+
+ v8::Persistent<v8::Object> object_;
+
+ private:
+ static void OnClose(uv_handle_t* handle);
+ // Using double underscore due to handle_ member in tcp_wrap. Probably
+ // tcp_wrap should rename it's member to 'handle'.
+ uv_handle_t* handle__;
+};
+
+
+} // namespace node
+
+
+#endif // HANDLE_WRAP_H_