Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrevor Norris <trev.norris@gmail.com>2013-09-25 01:12:11 +0400
committerTrevor Norris <trev.norris@gmail.com>2013-11-01 01:17:51 +0400
commitefa62fd9cc817434206d9fd8592b7bbeaa240e9c (patch)
treed3385ab0c74b20fab8d4e53cfa8408dafec69492 /src/handle_wrap.h
parent21fbbd579080bab569c66100471a4c7b462bb0d6 (diff)
node: add AsyncListener support
AsyncListener is a JS API that works in tandem with the AsyncWrap class to allow the user to be alerted to key events in the life cycle of an asynchronous event. The AsyncWrap class has its own MakeCallback implementation that core will be migrated to use, and uses state sharing techniques to allow quicker communication between JS and C++ whether the async event callbacks need to be called.
Diffstat (limited to 'src/handle_wrap.h')
-rw-r--r--src/handle_wrap.h17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/handle_wrap.h b/src/handle_wrap.h
index 73a43c3a3f2..47cc44f9107 100644
--- a/src/handle_wrap.h
+++ b/src/handle_wrap.h
@@ -22,6 +22,7 @@
#ifndef SRC_HANDLE_WRAP_H_
#define SRC_HANDLE_WRAP_H_
+#include "async-wrap.h"
#include "env.h"
#include "node.h"
#include "queue.h"
@@ -50,7 +51,7 @@ namespace node {
// js/c++ boundary crossing. At the javascript layer that should all be
// taken care of.
-class HandleWrap {
+class HandleWrap : public AsyncWrap {
public:
static void Close(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Ref(const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -64,24 +65,10 @@ class HandleWrap {
uv_handle_t* handle);
virtual ~HandleWrap();
- inline Environment* env() const {
- return env_;
- }
-
- inline v8::Local<v8::Object> object() {
- return PersistentToLocal(env()->isolate(), persistent());
- }
-
- inline v8::Persistent<v8::Object>& persistent() {
- return object_;
- }
-
private:
friend void GetActiveHandles(const v8::FunctionCallbackInfo<v8::Value>&);
static void OnClose(uv_handle_t* handle);
- v8::Persistent<v8::Object> object_;
QUEUE handle_wrap_queue_;
- Environment* const env_;
unsigned int flags_;
// Using double underscore due to handle_ member in tcp_wrap. Probably
// tcp_wrap should rename it's member to 'handle'.