diff options
author | Eugene Ostroukhov <eostroukhov@gmail.com> | 2019-07-26 20:40:54 +0300 |
---|---|---|
committer | Eugene Ostroukhov <eostroukhov@gmail.com> | 2019-09-16 19:01:55 +0300 |
commit | 3d841fe20d732111094c3f62febd5a6b8b483b91 (patch) | |
tree | 197e5397ecd069b315f9e76b1d2ce942f35cfa9b /src/inspector_agent.h | |
parent | 70abb4ffe40c8526c5415c02c20b7b3a3cdbacd2 (diff) |
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_agent.h')
-rw-r--r-- | src/inspector_agent.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/inspector_agent.h b/src/inspector_agent.h index 4fb544f85bd..d5088a1b546 100644 --- a/src/inspector_agent.h +++ b/src/inspector_agent.h @@ -86,12 +86,19 @@ class Agent { std::unique_ptr<ParentInspectorHandle> GetParentHandle( int thread_id, const std::string& url); - // Called to create inspector sessions that can be used from the main thread. + // Called to create inspector sessions that can be used from the same thread. // The inspector responds by using the delegate to send messages back. std::unique_ptr<InspectorSession> Connect( std::unique_ptr<InspectorSessionDelegate> delegate, bool prevent_shutdown); + // Called from the worker to create inspector sessions that is connected + // to the main thread. + // The inspector responds by using the delegate to send messages back. + std::unique_ptr<InspectorSession> ConnectToMainThread( + std::unique_ptr<InspectorSessionDelegate> delegate, + bool prevent_shutdown); + void PauseOnNextJavascriptStatement(const std::string& reason); std::string GetWsUrl() const; |