| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent db7deb6 commit 66b3619
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -860,7 +860,8 @@ class Environment : public MemoryRetainer { | |||
| 860 | 860 | #if HAVE_INSPECTOR | |
| 861 | 861 | // If the environment is created for a worker, pass parent_handle and | |
| 862 | 862 | // the ownership if transferred into the Environment. | |
| 863 | - int InitializeInspector(inspector::ParentInspectorHandle* parent_handle); | ||
| 863 | + int InitializeInspector( | ||
| 864 | + std::unique_ptr<inspector::ParentInspectorHandle> parent_handle); | ||
| 864 | 865 | #endif | |
| 865 | 866 | ||
| 866 | 867 | v8::MaybeLocal<v8::Value> BootstrapInternalLoaders(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -202,13 +202,12 @@ MaybeLocal<Value> ExecuteBootstrapper(Environment* env, | |||
| 202 | 202 | ||
| 203 | 203 | #if HAVE_INSPECTOR | |
| 204 | 204 | int Environment::InitializeInspector( | |
| 205 | - inspector::ParentInspectorHandle* parent_handle) { | ||
| 205 | + std::unique_ptr<inspector::ParentInspectorHandle> parent_handle) { | ||
| 206 | 206 | std::string inspector_path; | |
| 207 | - if (parent_handle != nullptr) { | ||
| 207 | + if (parent_handle) { | ||
| 208 | 208 | DCHECK(!is_main_thread()); | |
| 209 | 209 | inspector_path = parent_handle->url(); | |
| 210 | - inspector_agent_->SetParentHandle( | ||
| 211 | - std::unique_ptr<inspector::ParentInspectorHandle>(parent_handle)); | ||
| 210 | + inspector_agent_->SetParentHandle(std::move(parent_handle)); | ||
| 212 | 211 | } else { | |
| 213 | 212 | inspector_path = argv_.size() > 1 ? argv_[1].c_str() : ""; | |
| 214 | 213 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,6 +7,10 @@ | |||
| 7 | 7 | #include <sanitizer/lsan_interface.h> | |
| 8 | 8 | #endif | |
| 9 | 9 | ||
| 10 | + #if HAVE_INSPECTOR | ||
| 11 | + #include "inspector/worker_inspector.h" // ParentInspectorHandle | ||
| 12 | + #endif | ||
| 13 | + | ||
| 10 | 14 | namespace node { | |
| 11 | 15 | ||
| 12 | 16 | using v8::Context; | |
@@ -225,7 +229,7 @@ std::unique_ptr<Environment> NodeMainInstance::CreateMainEnvironment( | |||
| 225 | 229 | // TODO(joyeecheung): when we snapshot the bootstrapped context, | |
| 226 | 230 | // the inspector and diagnostics setup should after after deserialization. | |
| 227 | 231 | #if HAVE_INSPECTOR | |
| 228 | - *exit_code = env->InitializeInspector(nullptr); | ||
| 232 | + *exit_code = env->InitializeInspector({}); | ||
| 229 | 233 | #endif | |
| 230 | 234 | if (*exit_code != 0) { | |
| 231 | 235 | return env; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -325,7 +325,7 @@ void Worker::Run() { | |||
| 325 | 325 | { | |
| 326 | 326 | env_->InitializeDiagnostics(); | |
| 327 | 327 | #if HAVE_INSPECTOR | |
| 328 | - env_->InitializeInspector(inspector_parent_handle_.release()); | ||
| 328 | + env_->InitializeInspector(std::move(inspector_parent_handle_)); | ||
| 329 | 329 | #endif | |
| 330 | 330 | HandleScope handle_scope(isolate_); | |
| 331 | 331 | InternalCallbackScope callback_scope( | |
| Back | FazBrowse Home | New Git URL |
0 commit comments