Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: fewer uses of NODE_USE_V8_PLATFORM #30029

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,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);
Expand Down
2 changes: 1 addition & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ MaybeLocal<Value> 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;
Expand Down
2 changes: 1 addition & 1 deletion src/node_main_instance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ std::unique_ptr<Environment> 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) {
Expand Down
12 changes: 6 additions & 6 deletions src/node_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -82,7 +82,7 @@ Worker::Worker(Environment* env,
Number::New(env->isolate(), static_cast<double>(thread_id_)))
.Check();

#if NODE_USE_V8_PLATFORM && HAVE_INSPECTOR
#if HAVE_INSPECTOR
inspector_parent_handle_ =
env->inspector_agent()->GetParentHandle(thread_id_, url);
#endif
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/node_worker.h
Original file line number Diff line number Diff line change
Expand Up @@ -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::ParentInspectorHandle> inspector_parent_handle_;
#endif

Expand Down