diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-11-02 19:06:59 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-11-06 23:26:04 +0100 |
commit | 7e2a182d03c40faa567daebee5ce064675190bff (patch) | |
tree | 6f592972d6e0d188de01b04a9bb2b726cf7dae72 /src/node_worker.cc | |
parent | 5bf43729a403b992cc90b5cdbbaaf505769d1107 (diff) | |
download | android-node-v8-7e2a182d03c40faa567daebee5ce064675190bff.tar.gz android-node-v8-7e2a182d03c40faa567daebee5ce064675190bff.tar.bz2 android-node-v8-7e2a182d03c40faa567daebee5ce064675190bff.zip |
src: make WaitForInspectorDisconnect an exit hook
Run inspector cleanup code on Environment teardown.
This is part of a series of changes to make embedding easier, by
requiring fewer internal methods to build a fully functioning
Node.js instance.
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_worker.cc')
-rw-r--r-- | src/node_worker.cc | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/node_worker.cc b/src/node_worker.cc index e09bb4e7aa..8730e8b02b 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -42,17 +42,6 @@ using v8::Value; namespace node { namespace worker { -namespace { - -#if HAVE_INSPECTOR -void WaitForWorkerInspectorToStop(Environment* child) { - child->inspector_agent()->WaitForDisconnect(); - child->inspector_agent()->Stop(); -} -#endif - -} // anonymous namespace - Worker::Worker(Environment* env, Local<Object> wrap, const std::string& url, @@ -251,9 +240,6 @@ void Worker::Run() { Locker locker(isolate_); Isolate::Scope isolate_scope(isolate_); SealHandleScope outer_seal(isolate_); -#if HAVE_INSPECTOR - bool inspector_started = false; -#endif DeleteFnPtr<Environment, FreeEnvironment> env_; OnScopeLeave cleanup_env([&]() { @@ -283,10 +269,6 @@ void Worker::Run() { env_->stop_sub_worker_contexts(); env_->RunCleanup(); RunAtExit(env_.get()); -#if HAVE_INSPECTOR - if (inspector_started) - WaitForWorkerInspectorToStop(env_.get()); -#endif // This call needs to be made while the `Environment` is still alive // because we assume that it is available for async tracking in the @@ -344,7 +326,6 @@ void Worker::Run() { env_->InitializeDiagnostics(); #if HAVE_INSPECTOR env_->InitializeInspector(inspector_parent_handle_.release()); - inspector_started = true; #endif HandleScope handle_scope(isolate_); InternalCallbackScope callback_scope( |