diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-11-02 21:04:57 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-11-06 23:26:05 +0100 |
commit | 86cdfc60a9ae21f64058e7292db3566d91d09085 (patch) | |
tree | aa198ec92fea21445924e2b6657ff18e4a57faa0 /src/node.cc | |
parent | 7e2a182d03c40faa567daebee5ce064675190bff (diff) | |
download | node-new-86cdfc60a9ae21f64058e7292db3566d91d09085.tar.gz |
src: use unique_ptr for InitializeInspector()
This makes more sense than releasing and re-wrapping the raw pointer.
PR-URL: https://github.com/nodejs/node/pull/30229
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Diffstat (limited to 'src/node.cc')
-rw-r--r-- | src/node.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/node.cc b/src/node.cc index 94c85cae74..5a8e6ea8c0 100644 --- a/src/node.cc +++ b/src/node.cc @@ -202,13 +202,12 @@ MaybeLocal<Value> ExecuteBootstrapper(Environment* env, #if HAVE_INSPECTOR int Environment::InitializeInspector( - inspector::ParentInspectorHandle* parent_handle) { + std::unique_ptr<inspector::ParentInspectorHandle> parent_handle) { std::string inspector_path; - if (parent_handle != nullptr) { + if (parent_handle) { DCHECK(!is_main_thread()); inspector_path = parent_handle->url(); - inspector_agent_->SetParentHandle( - std::unique_ptr<inspector::ParentInspectorHandle>(parent_handle)); + inspector_agent_->SetParentHandle(std::move(parent_handle)); } else { inspector_path = argv_.size() > 1 ? argv_[1].c_str() : ""; } |