22 #ifndef SRC_HANDLE_WRAP_H_ 23 #define SRC_HANDLE_WRAP_H_ 25 #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 56 class HandleWrap :
public AsyncWrap {
58 static void Close(
const v8::FunctionCallbackInfo<v8::Value>& args);
59 static void Ref(
const v8::FunctionCallbackInfo<v8::Value>& args);
60 static void Unref(
const v8::FunctionCallbackInfo<v8::Value>& args);
61 static void HasRef(
const v8::FunctionCallbackInfo<v8::Value>& args);
63 static inline bool IsAlive(
const HandleWrap*
wrap) {
64 return wrap !=
nullptr && wrap->state_ != kClosed;
67 static inline bool HasRef(
const HandleWrap*
wrap) {
68 return IsAlive(wrap) && uv_has_ref(wrap->GetHandle());
71 inline uv_handle_t* GetHandle()
const {
return handle_; }
74 HandleWrap(Environment* env,
75 v8::Local<v8::Object>
object,
77 AsyncWrap::ProviderType provider);
78 ~HandleWrap()
override;
81 friend class Environment;
83 static void OnClose(uv_handle_t* handle);
84 ListNode<HandleWrap> handle_wrap_queue_;
85 enum { kInitialized, kClosing, kClosingWithCallback, kClosed } state_;
86 uv_handle_t*
const handle_;
92 #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 94 #endif // SRC_HANDLE_WRAP_H_ void GetActiveHandles(const FunctionCallbackInfo< Value > &args)