diff options
author | Eugene Ostroukhov <eostroukhov@gmail.com> | 2019-07-26 10:40:54 -0700 |
---|---|---|
committer | Eugene Ostroukhov <eostroukhov@gmail.com> | 2019-09-16 09:01:55 -0700 |
commit | 3d841fe20d732111094c3f62febd5a6b8b483b91 (patch) | |
tree | 197e5397ecd069b315f9e76b1d2ce942f35cfa9b /src/inspector/worker_inspector.cc | |
parent | 70abb4ffe40c8526c5415c02c20b7b3a3cdbacd2 (diff) | |
download | android-node-v8-3d841fe20d732111094c3f62febd5a6b8b483b91.tar.gz android-node-v8-3d841fe20d732111094c3f62febd5a6b8b483b91.tar.bz2 android-node-v8-3d841fe20d732111094c3f62febd5a6b8b483b91.zip |
inspector: new API - Session.connectToMainThread
This API is designed to enable worker threads use Inspector protocol
on main thread (and other workers through NodeWorker domain).
Note that worker can cause dead lock by suspending itself. I will
work on a new API that will allow workers to be hidden from the
inspector.
Fixes: https://github.com/nodejs/node/issues/28828
PR-URL: https://github.com/nodejs/node/pull/28870
Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'src/inspector/worker_inspector.cc')
-rw-r--r-- | src/inspector/worker_inspector.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/inspector/worker_inspector.cc b/src/inspector/worker_inspector.cc index 48679d2f69..deeddcc083 100644 --- a/src/inspector/worker_inspector.cc +++ b/src/inspector/worker_inspector.cc @@ -72,6 +72,12 @@ void ParentInspectorHandle::WorkerStarted( parent_thread_->Post(std::move(request)); } +std::unique_ptr<inspector::InspectorSession> ParentInspectorHandle::Connect( + std::unique_ptr<inspector::InspectorSessionDelegate> delegate, + bool prevent_shutdown) { + return parent_thread_->Connect(std::move(delegate), prevent_shutdown); +} + void WorkerManager::WorkerFinished(int session_id) { children_.erase(session_id); } |