aboutsummaryrefslogtreecommitdiff
path: root/src/env.h
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2017-12-17 13:38:15 -0800
committerTimothy Gu <timothygu99@gmail.com>2017-12-23 14:05:18 +0800
commit2cb21451627a24be2bdeaee276d47ff94b15539e (patch)
tree42dc38919994b73d408e0af6eec72a817c98df4e /src/env.h
parentc339931d8b3dbf3fb2a4fa4164bbf585759831c0 (diff)
downloadandroid-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.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/env.h b/src/env.h
index 04657e5c52..78001359ff 100644
--- a/src/env.h
+++ b/src/env.h
@@ -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();