diff options
author | Aleksei Koziatinskii <ak239spb@gmail.com> | 2019-05-06 19:30:44 -0700 |
---|---|---|
committer | Aleksei Koziatinskii <alekseik@netflix.com> | 2019-05-14 16:13:57 -0700 |
commit | 10d7e01ee9618a42cb658a07d692557a03456fe5 (patch) | |
tree | b000e346fe579656d9d32cf2479faceedbb7e04b /src/inspector/node_protocol.pdl | |
parent | 23ef3e4cfb8da65b205e6895947375e5284bebdc (diff) | |
download | android-node-v8-10d7e01ee9618a42cb658a07d692557a03456fe5.tar.gz android-node-v8-10d7e01ee9618a42cb658a07d692557a03456fe5.tar.bz2 android-node-v8-10d7e01ee9618a42cb658a07d692557a03456fe5.zip |
inspector: added NodeRuntime domain
Historically Node process sends Runtime.executionContextDestroyed
with main context as argument when it is finished.
This approach has some disadvantages. V8 prevents running some
protocol command on destroyed contexts, e.g. Runtime.evaluate
will return an error or Debugger.enable won't return a list of
scripts.
Both command might be useful for different tools, e.g. tool runs
Profiler.startPreciseCoverage and at the end of node process it
would like to get list of all scripts to match data to source code.
Or some tooling frontend would like to provide capabilities to run
commands in console when node process is finished to allow user to
inspect state of the program at exit.
This PR adds new domain: NodeRuntime. After
NodeRuntime.notifyWhenWaitingForDisconnect is enabled by at least one
client, node will send NodeRuntime.waitingForDebuggerToDisconnect
event instead of Runtime.executionContextDestroyed. Based on this
signal any protocol client can capture all required information and
then disconnect its session.
PR-URL: https://github.com/nodejs/node/pull/27600
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/inspector/node_protocol.pdl')
-rw-r--r-- | src/inspector/node_protocol.pdl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/inspector/node_protocol.pdl b/src/inspector/node_protocol.pdl index 9fb9f1c55f..36d528b937 100644 --- a/src/inspector/node_protocol.pdl +++ b/src/inspector/node_protocol.pdl @@ -92,3 +92,16 @@ experimental domain NodeWorker # Identifier of a session which sends a message. SessionID sessionId string message + +# Support for inspecting node process state. +experimental domain NodeRuntime + # Enable the `NodeRuntime.waitingForDisconnect`. + command notifyWhenWaitingForDisconnect + parameters + boolean enabled + + # This event is fired instead of `Runtime.executionContextDestroyed` when + # enabled. + # It is fired when the Node process finished all code execution and is + # waiting for all frontends to disconnect. + event waitingForDisconnect |