diff options
author | Eugene Ostroukhov <eostroukhov@google.com> | 2018-09-08 19:45:10 -0700 |
---|---|---|
committer | Eugene Ostroukhov <eostroukhov@google.com> | 2018-09-18 09:01:33 -0700 |
commit | f28c6f7eef58e7c3133bb2cd457d05b986194ba3 (patch) | |
tree | b8e8583ff735a3b0721831af51c4f92d967849f1 /src/inspector_agent.h | |
parent | ba0b4e43e442926bfb9389a42aa7393f91e6748a (diff) | |
download | node-new-f28c6f7eef58e7c3133bb2cd457d05b986194ba3.tar.gz |
inspector: workers debugging
Introduce a NodeTarget inspector domain modelled after ChromeDevTools
Target domain. It notifies inspector frontend attached to a main V8
isolate when workers are starting and allows passing messages to
inspectors on their isolates. All inspector functionality is enabled on
worker isolates.
PR-URL: https://github.com/nodejs/node/pull/21364
Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/inspector_agent.h')
-rw-r--r-- | src/inspector_agent.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/inspector_agent.h b/src/inspector_agent.h index 79ae8d4cd9..e926ccaa92 100644 --- a/src/inspector_agent.h +++ b/src/inspector_agent.h @@ -26,7 +26,9 @@ struct ContextInfo; namespace inspector { class InspectorIo; +class ParentInspectorHandle; class NodeInspectorClient; +class WorkerManager; class InspectorSession { public: @@ -82,6 +84,8 @@ class Agent { void EnableAsyncHook(); void DisableAsyncHook(); + void AddWorkerInspector(int thread_id, const std::string& url, Agent* agent); + // Called to create inspector sessions that can be used from the main thread. // The inspector responds by using the delegate to send messages back. std::unique_ptr<InspectorSession> Connect( @@ -103,6 +107,9 @@ class Agent { std::shared_ptr<DebugOptions> options() { return debug_options_; } void ContextCreated(v8::Local<v8::Context> context, const ContextInfo& info); + // Interface for interacting with inspectors in worker threads + std::shared_ptr<WorkerManager> GetWorkerManager(); + private: void ToggleAsyncHook(v8::Isolate* isolate, const node::Persistent<v8::Function>& fn); @@ -112,6 +119,7 @@ class Agent { std::shared_ptr<NodeInspectorClient> client_; // Interface for transports, e.g. WebSocket server std::unique_ptr<InspectorIo> io_; + std::unique_ptr<ParentInspectorHandle> parent_handle_; std::string path_; std::shared_ptr<DebugOptions> debug_options_; |