diff options
author | Trevor Norris <trev.norris@gmail.com> | 2013-11-04 22:49:55 +0400 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2013-11-13 01:38:31 +0400 |
commit | d120d92bfef0b5012e76c636335fee80e9c1e4a9 (patch) | |
tree | 277864e238d78271c82b3e77c8f3e8c850c35bd9 /src/node_stat_watcher.cc | |
parent | 6cea16f2c9ec0666708e924fa93c664ddb000b5c (diff) |
base-object: add BaseObject
BaseObject is a class that just handles the Persistent handle attached
to the class instance.
This also removed WeakObject. Reordering the inheritance chain helps
prevent unneeded calls on instances that don't call MakeCallback.
Diffstat (limited to 'src/node_stat_watcher.cc')
-rw-r--r-- | src/node_stat_watcher.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/node_stat_watcher.cc b/src/node_stat_watcher.cc index df896fa8738..e71ca430cdb 100644 --- a/src/node_stat_watcher.cc +++ b/src/node_stat_watcher.cc @@ -20,12 +20,12 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. #include "node_stat_watcher.h" +#include "async-wrap.h" +#include "async-wrap-inl.h" #include "env.h" #include "env-inl.h" #include "util.h" #include "util-inl.h" -#include "weak-object.h" -#include "weak-object-inl.h" #include <assert.h> #include <string.h> @@ -66,8 +66,9 @@ static void Delete(uv_handle_t* handle) { StatWatcher::StatWatcher(Environment* env, Local<Object> wrap) - : WeakObject(env, wrap), + : AsyncWrap(env, wrap), watcher_(new uv_fs_poll_t) { + MakeWeak<StatWatcher>(this); uv_fs_poll_init(env->event_loop(), watcher_); watcher_->data = static_cast<void*>(this); } @@ -135,7 +136,7 @@ void StatWatcher::Stop() { if (!uv_is_active(reinterpret_cast<uv_handle_t*>(watcher_))) return; uv_fs_poll_stop(watcher_); - MakeWeak(); + MakeWeak<StatWatcher>(this); } |