summaryrefslogtreecommitdiff
path: root/src/node_stat_watcher.h
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-06-10 14:56:09 +0200
committerAnna Henningsen <anna@addaleax.net>2018-06-14 13:19:17 +0200
commit7b46e177ba7f0f8349eb5fd73daf57fe847765ff (patch)
treebc418d46debd29d66cec518bddc5820995605d22 /src/node_stat_watcher.h
parent65b2e4b6fa511c42f913c8814561b5090805ab7c (diff)
downloadandroid-node-v8-7b46e177ba7f0f8349eb5fd73daf57fe847765ff.tar.gz
android-node-v8-7b46e177ba7f0f8349eb5fd73daf57fe847765ff.tar.bz2
android-node-v8-7b46e177ba7f0f8349eb5fd73daf57fe847765ff.zip
lib,src: make `StatWatcher` a `HandleWrap`
Wrapping libuv handles is what `HandleWrap` is there for. This allows a decent reduction of state tracking machinery by moving active-ness tracking to JS, and removing all interaction with garbage collection. Refs: https://github.com/nodejs/node/pull/21093 PR-URL: https://github.com/nodejs/node/pull/21244 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src/node_stat_watcher.h')
-rw-r--r--src/node_stat_watcher.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/node_stat_watcher.h b/src/node_stat_watcher.h
index 0d0d263d5c..45150de785 100644
--- a/src/node_stat_watcher.h
+++ b/src/node_stat_watcher.h
@@ -25,26 +25,24 @@
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include "node.h"
-#include "async_wrap.h"
+#include "handle_wrap.h"
#include "env.h"
#include "uv.h"
#include "v8.h"
namespace node {
-class StatWatcher : public AsyncWrap {
+class StatWatcher : public HandleWrap {
public:
- ~StatWatcher() override;
-
static void Initialize(Environment* env, v8::Local<v8::Object> target);
protected:
- StatWatcher(Environment* env, v8::Local<v8::Object> wrap, bool use_bigint);
+ StatWatcher(Environment* env,
+ v8::Local<v8::Object> wrap,
+ bool use_bigint);
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Start(const v8::FunctionCallbackInfo<v8::Value>& args);
- static void Stop(const v8::FunctionCallbackInfo<v8::Value>& args);
- static void IsActive(const v8::FunctionCallbackInfo<v8::Value>& args);
size_t self_size() const override { return sizeof(*this); }
@@ -53,10 +51,8 @@ class StatWatcher : public AsyncWrap {
int status,
const uv_stat_t* prev,
const uv_stat_t* curr);
- void Stop();
- bool IsActive();
- uv_fs_poll_t* watcher_;
+ uv_fs_poll_t watcher_;
const bool use_bigint_;
};