diff options
Diffstat (limited to 'src/async_wrap.h')
-rw-r--r-- | src/async_wrap.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/async_wrap.h b/src/async_wrap.h index 60078ee093..ee04479de0 100644 --- a/src/async_wrap.h +++ b/src/async_wrap.h @@ -178,6 +178,12 @@ class AsyncWrap : public BaseObject { static void WeakCallback(const v8::WeakCallbackInfo<DestroyParam> &info); + // Returns the object that 'owns' an async wrap. For example, for a + // TCP connection handle, this is the corresponding net.Socket. + v8::Local<v8::Object> GetOwner(); + static v8::Local<v8::Object> GetOwner(Environment* env, + v8::Local<v8::Object> obj); + // This is a simplified version of InternalCallbackScope that only runs // the `before` and `after` hooks. Only use it when not actually calling // back into JS; otherwise, use InternalCallbackScope. |