diff options
author | Timothy Gu <timothygu99@gmail.com> | 2017-12-17 13:38:15 -0800 |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2017-12-23 14:05:18 +0800 |
commit | 2cb21451627a24be2bdeaee276d47ff94b15539e (patch) | |
tree | 42dc38919994b73d408e0af6eec72a817c98df4e /src/env.h | |
parent | c339931d8b3dbf3fb2a4fa4164bbf585759831c0 (diff) | |
download | android-node-v8-2cb21451627a24be2bdeaee276d47ff94b15539e.tar.gz android-node-v8-2cb21451627a24be2bdeaee276d47ff94b15539e.tar.bz2 android-node-v8-2cb21451627a24be2bdeaee276d47ff94b15539e.zip |
vm: allow modifying context name in inspector
The `auxData` field is not exposed to JavaScript, as DevTools uses it
for its `isDefault` parameter, which is implemented faithfully,
contributing to the nice indentation in the context selection panel.
Without the indentation, when `Target` domain gets implemented (along
with a single Inspector for cluster) in #16627, subprocesses and VM
contexts will be mixed up, causing confusion.
PR-URL: https://github.com/nodejs/node/pull/17720
Refs: https://github.com/nodejs/node/pull/14231#issuecomment-315924067
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/env.h')
-rw-r--r-- | src/env.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -361,6 +361,13 @@ class IsolateData { DISALLOW_COPY_AND_ASSIGN(IsolateData); }; +struct ContextInfo { + explicit ContextInfo(const std::string& name) : name(name) {} + const std::string name; + std::string origin; + bool is_default = false; +}; + class Environment { public: class AsyncHooks { @@ -508,9 +515,11 @@ class Environment { int exec_argc, const char* const* exec_argv, bool start_profiler_idle_notifier); - void AssignToContext(v8::Local<v8::Context> context); void CleanupHandles(); + inline void AssignToContext(v8::Local<v8::Context> context, + const ContextInfo& info); + void StartProfilerIdleNotifier(); void StopProfilerIdleNotifier(); |