File tree 4 files changed +15
-3
lines changed
4 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -691,6 +691,10 @@ inline bool Environment::no_global_search_paths() const {
691
691
!options_->global_search_paths ;
692
692
}
693
693
694
+ inline bool Environment::should_start_debug_signal_handler () const {
695
+ return (flags_ & EnvironmentFlags::kNoStartDebugSignalHandler ) == 0 ;
696
+ }
697
+
694
698
inline bool Environment::no_browser_globals () const {
695
699
// configure --no-browser-globals
696
700
#ifdef NODE_NO_BROWSER_GLOBALS
Original file line number Diff line number Diff line change @@ -803,6 +803,7 @@ class Environment : public MemoryRetainer {
803
803
inline bool tracks_unmanaged_fds () const ;
804
804
inline bool hide_console_windows () const ;
805
805
inline bool no_global_search_paths () const ;
806
+ inline bool should_start_debug_signal_handler () const ;
806
807
inline bool no_browser_globals () const ;
807
808
inline uint64_t thread_id () const ;
808
809
inline worker::Worker* worker_context () const ;
Original file line number Diff line number Diff line change @@ -717,8 +717,11 @@ bool Agent::Start(const std::string& path,
717
717
StartIoThreadAsyncCallback));
718
718
uv_unref (reinterpret_cast <uv_handle_t *>(&start_io_thread_async));
719
719
start_io_thread_async.data = this ;
720
- // Ignore failure, SIGUSR1 won't work, but that should not block node start.
721
- StartDebugSignalHandler ();
720
+ if (parent_env_->should_start_debug_signal_handler ()) {
721
+ // Ignore failure, SIGUSR1 won't work, but that should not block node
722
+ // start.
723
+ StartDebugSignalHandler ();
724
+ }
722
725
723
726
parent_env_->AddCleanupHook ([](void * data) {
724
727
Environment* env = static_cast <Environment*>(data);
Original file line number Diff line number Diff line change @@ -657,7 +657,11 @@ enum Flags : uint64_t {
657
657
// This control is needed by embedders who may not want to initialize the V8
658
658
// inspector in situations where one has already been created,
659
659
// e.g. Blink's in Chromium.
660
- kNoCreateInspector = 1 << 9
660
+ kNoCreateInspector = 1 << 9 ,
661
+ // Controls where or not the InspectorAgent for this Environment should
662
+ // call StartDebugSignalHandler. This control is needed by embedders who may
663
+ // not want to allow other processes to start the V8 inspector.
664
+ kNoStartDebugSignalHandler = 1 << 10
661
665
};
662
666
} // namespace EnvironmentFlags
663
667
You can’t perform that action at this time.
0 commit comments