From 19e3e02a2db996a3df36e00df6c6b57cec516c9e Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 18 Apr 2019 10:58:58 +0800 Subject: src: move SIGINT watchdog utils to the contextify binding These are used when evaluating scripts so it makes more sense to put them in the contextify binding whose other methods are going to be used together. PR-URL: https://github.com/nodejs/node/pull/27290 Reviewed-By: Daniel Bevenius Reviewed-By: Yongsheng Zhang Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell --- src/node_util.cc | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'src/node_util.cc') diff --git a/src/node_util.cc b/src/node_util.cc index d13624a436..961df0b73c 100644 --- a/src/node_util.cc +++ b/src/node_util.cc @@ -1,5 +1,4 @@ #include "node_errors.h" -#include "node_watchdog.h" #include "util.h" #include "base_object-inl.h" @@ -157,24 +156,6 @@ static void SetHiddenValue(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(maybe_value.FromJust()); } - -void StartSigintWatchdog(const FunctionCallbackInfo& args) { - int ret = SigintWatchdogHelper::GetInstance()->Start(); - args.GetReturnValue().Set(ret == 0); -} - - -void StopSigintWatchdog(const FunctionCallbackInfo& args) { - bool had_pending_signals = SigintWatchdogHelper::GetInstance()->Stop(); - args.GetReturnValue().Set(had_pending_signals); -} - - -void WatchdogHasPendingSigint(const FunctionCallbackInfo& args) { - bool ret = SigintWatchdogHelper::GetInstance()->HasPendingSignal(); - args.GetReturnValue().Set(ret); -} - void ArrayBufferViewHasBuffer(const FunctionCallbackInfo& args) { CHECK(args[0]->IsArrayBufferView()); args.GetReturnValue().Set(args[0].As()->HasBuffer()); @@ -281,11 +262,6 @@ void Initialize(Local target, env->SetMethodNoSideEffect(target, "getOwnNonIndexProperties", GetOwnNonIndexProperties); - env->SetMethod(target, "startSigintWatchdog", StartSigintWatchdog); - env->SetMethod(target, "stopSigintWatchdog", StopSigintWatchdog); - env->SetMethodNoSideEffect(target, "watchdogHasPendingSigint", - WatchdogHasPendingSigint); - env->SetMethod(target, "arrayBufferViewHasBuffer", ArrayBufferViewHasBuffer); Local constants = Object::New(env->isolate()); NODE_DEFINE_CONSTANT(constants, ALL_PROPERTIES); -- cgit v1.2.3