Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Ijaz Sheikh <ofrobots@google.com>2017-10-19 02:00:03 +0300
committerAli Ijaz Sheikh <ofrobots@google.com>2017-10-29 19:38:37 +0300
commit5886e204f04013879c00aca5ab653c16bef5befc (patch)
tree452bfe3e5f7b090bedd2528c31080e250467e334 /src/inspector_agent.h
parentc08750275882f1472f7ff2a98916f857a0857dc6 (diff)
inspector: track async stacks when necessary
With this change, we do async stack tracking only when explicitly requested by the inspector client. This avoids unnecessary overhead for clients that might not be interested in async stack traces. PR-URL: https://github.com/nodejs/node/pull/16308 Fixes: https://github.com/nodejs/node/issues/16180 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Diffstat (limited to 'src/inspector_agent.h')
-rw-r--r--src/inspector_agent.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/inspector_agent.h b/src/inspector_agent.h
index 9119e7263b2..24fae116f94 100644
--- a/src/inspector_agent.h
+++ b/src/inspector_agent.h
@@ -92,7 +92,12 @@ class Agent {
DebugOptions& options() { return debug_options_; }
void ContextCreated(v8::Local<v8::Context> context);
+ void EnableAsyncHook();
+ void DisableAsyncHook();
+
private:
+ void ToggleAsyncHook(v8::Isolate* isolate, v8::Local<v8::Function> fn);
+
node::Environment* parent_env_;
std::unique_ptr<NodeInspectorClient> client_;
std::unique_ptr<InspectorIo> io_;
@@ -102,6 +107,8 @@ class Agent {
DebugOptions debug_options_;
int next_context_number_;
+ bool pending_enable_async_hook_;
+ bool pending_disable_async_hook_;
v8::Persistent<v8::Function> enable_async_hook_function_;
v8::Persistent<v8::Function> disable_async_hook_function_;
};