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:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-12-01 20:30:30 +0300
committerJoyee Cheung <joyeec9h3@gmail.com>2018-12-09 01:26:53 +0300
commit61a89630ee5664b1f909b310a016b522a6285521 (patch)
tree621fbd9bfd9c25a43c3ff9ae60251e5bfa2d366c /src/node_options-inl.h
parent22564b99cb9dff471f40c1ad0245d99b9224a207 (diff)
inspector: split the HostPort being used and the one parsed from CLI
Instead of using a shared pointer of the entire debug option set, pass the parsed debug option to inspector classes by value because they are set once the CLI argument parsing is done. Add another shared pointer to HostPort being used by the inspector server, which is copied from the one in the debug options initially. The port of the shared HostPort is 9229 by default and can be specified as 0 initially but will be set to the actual port of the server once it starts listening. This makes the shared state clearer and makes it possible to use `require('internal/options')` in JS land to query the CLI options instead of using `process._breakFirstLine` and other underscored properties of `process` since we are now certain that these values should not be altered once the parsing is done and can be passed around in copies without locks. PR-URL: https://github.com/nodejs/node/pull/24772 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/node_options-inl.h')
-rw-r--r--src/node_options-inl.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/node_options-inl.h b/src/node_options-inl.h
index 468368ac84f..8aaa62524b8 100644
--- a/src/node_options-inl.h
+++ b/src/node_options-inl.h
@@ -14,7 +14,11 @@ PerIsolateOptions* PerProcessOptions::get_per_isolate_options() {
}
DebugOptions* EnvironmentOptions::get_debug_options() {
- return debug_options.get();
+ return &debug_options_;
+}
+
+const DebugOptions& EnvironmentOptions::debug_options() const {
+ return debug_options_;
}
EnvironmentOptions* PerIsolateOptions::get_per_env_options() {