File tree Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -693,6 +693,10 @@ inline bool Environment::no_global_search_paths() const {
693
693
!options_->global_search_paths ;
694
694
}
695
695
696
+ inline bool Environment::should_start_debug_signal_handler () const {
697
+ return (flags_ & EnvironmentFlags::kNoStartDebugSignalHandler ) == 0 ;
698
+ }
699
+
696
700
inline bool Environment::no_browser_globals () const {
697
701
// configure --no-browser-globals
698
702
#ifdef NODE_NO_BROWSER_GLOBALS
Original file line number Diff line number Diff line change @@ -772,6 +772,7 @@ class Environment : public MemoryRetainer {
772
772
inline bool tracks_unmanaged_fds () const ;
773
773
inline bool hide_console_windows () const ;
774
774
inline bool no_global_search_paths () const ;
775
+ inline bool should_start_debug_signal_handler () const ;
775
776
inline bool no_browser_globals () const ;
776
777
inline uint64_t thread_id () const ;
777
778
inline worker::Worker* worker_context () const ;
Original file line number Diff line number Diff line change @@ -696,8 +696,10 @@ bool Agent::Start(const std::string& path,
696
696
StartIoThreadAsyncCallback));
697
697
uv_unref (reinterpret_cast <uv_handle_t *>(&start_io_thread_async));
698
698
start_io_thread_async.data = this ;
699
- // Ignore failure, SIGUSR1 won't work, but that should not block node start.
700
- StartDebugSignalHandler ();
699
+ if (parent_env_->should_start_debug_signal_handler ()) {
700
+ // Ignore failure, SIGUSR1 won't work, but that should not block node start.
701
+ StartDebugSignalHandler ();
702
+ }
701
703
702
704
parent_env_->AddCleanupHook ([](void * data) {
703
705
Environment* env = static_cast <Environment*>(data);
Original file line number Diff line number Diff line change @@ -649,7 +649,11 @@ enum Flags : uint64_t {
649
649
// This control is needed by embedders who may not want to initialize the V8
650
650
// inspector in situations where one has already been created,
651
651
// e.g. Blink's in Chromium.
652
- kNoCreateInspector = 1 << 9
652
+ kNoCreateInspector = 1 << 9 ,
653
+ // Controls where or not the InspectorAgent for this Environment should
654
+ // call StartDebugSignalHandler. This control is needed by embedders who may
655
+ // not want to allow other processes to start the V8 inspector.
656
+ kNoStartDebugSignalHandler = 1 << 10
653
657
};
654
658
} // namespace EnvironmentFlags
655
659
You can’t perform that action at this time.
0 commit comments