From 4b57088c2539f94a0019885e3ca392bc568b83d0 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Fri, 18 Oct 2019 10:56:24 -0700 Subject: [PATCH] src: fewer uses of NODE_USE_V8_PLATFORM PR-URL: https://github.com/nodejs/node/pull/30029 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Gus Caplan Reviewed-By: Minwoo Jung Reviewed-By: Joyee Cheung --- src/env.h | 2 +- src/node.cc | 2 +- src/node_main_instance.cc | 2 +- src/node_worker.cc | 12 ++++++------ src/node_worker.h | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/env.h b/src/env.h index 8e12764ea3a9a3..6ffacd47212571 100644 --- a/src/env.h +++ b/src/env.h @@ -869,7 +869,7 @@ class Environment : public MemoryRetainer { void CreateProperties(); // Should be called before InitializeInspector() void InitializeDiagnostics(); -#if HAVE_INSPECTOR && NODE_USE_V8_PLATFORM +#if HAVE_INSPECTOR // If the environment is created for a worker, pass parent_handle and // the ownership if transferred into the Environment. int InitializeInspector(inspector::ParentInspectorHandle* parent_handle); diff --git a/src/node.cc b/src/node.cc index bff2285ed0b508..ae53d0c31c3568 100644 --- a/src/node.cc +++ b/src/node.cc @@ -220,7 +220,7 @@ MaybeLocal ExecuteBootstrapper(Environment* env, return scope.EscapeMaybe(result); } -#if HAVE_INSPECTOR && NODE_USE_V8_PLATFORM +#if HAVE_INSPECTOR int Environment::InitializeInspector( inspector::ParentInspectorHandle* parent_handle) { std::string inspector_path; diff --git a/src/node_main_instance.cc b/src/node_main_instance.cc index e41e0c1fb6fe1f..be53b585f0a106 100644 --- a/src/node_main_instance.cc +++ b/src/node_main_instance.cc @@ -204,7 +204,7 @@ std::unique_ptr NodeMainInstance::CreateMainEnvironment( // TODO(joyeecheung): when we snapshot the bootstrapped context, // the inspector and diagnostics setup should after after deserialization. -#if HAVE_INSPECTOR && NODE_USE_V8_PLATFORM +#if HAVE_INSPECTOR *exit_code = env->InitializeInspector(nullptr); #endif if (*exit_code != 0) { diff --git a/src/node_worker.cc b/src/node_worker.cc index 3913c51112a021..20b162bd8135ba 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -8,7 +8,7 @@ #include "util-inl.h" #include "async_wrap-inl.h" -#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR +#if HAVE_INSPECTOR #include "inspector/worker_inspector.h" // ParentInspectorHandle #endif @@ -39,7 +39,7 @@ namespace worker { namespace { -#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR +#if HAVE_INSPECTOR void WaitForWorkerInspectorToStop(Environment* child) { child->inspector_agent()->WaitForDisconnect(); child->inspector_agent()->Stop(); @@ -82,7 +82,7 @@ Worker::Worker(Environment* env, Number::New(env->isolate(), static_cast(thread_id_))) .Check(); -#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR +#if HAVE_INSPECTOR inspector_parent_handle_ = env->inspector_agent()->GetParentHandle(thread_id_, url); #endif @@ -193,7 +193,7 @@ void Worker::Run() { Locker locker(isolate_); Isolate::Scope isolate_scope(isolate_); SealHandleScope outer_seal(isolate_); -#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR +#if HAVE_INSPECTOR bool inspector_started = false; #endif @@ -225,7 +225,7 @@ void Worker::Run() { env_->stop_sub_worker_contexts(); env_->RunCleanup(); RunAtExit(env_.get()); -#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR +#if HAVE_INSPECTOR if (inspector_started) WaitForWorkerInspectorToStop(env_.get()); #endif @@ -270,7 +270,7 @@ void Worker::Run() { if (is_stopped()) return; { env_->InitializeDiagnostics(); -#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR +#if HAVE_INSPECTOR env_->InitializeInspector(inspector_parent_handle_.release()); inspector_started = true; #endif diff --git a/src/node_worker.h b/src/node_worker.h index ffc4f19882cc26..77f68801e7c247 100644 --- a/src/node_worker.h +++ b/src/node_worker.h @@ -65,7 +65,7 @@ class Worker : public AsyncWrap { bool start_profiler_idle_notifier_; uv_thread_t tid_; -#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR +#if HAVE_INSPECTOR std::unique_ptr inspector_parent_handle_; #endif