posix: Added option to disable signal handlers

See https://github.com/chromiumembedded/java-cef/issues/477
This commit is contained in:
Loïc Frasse-Mathon
2024-08-06 19:06:46 +00:00
committed by Marshall Greenblatt
parent c95c4aa8ea
commit 84246a31a2
5 changed files with 55 additions and 8 deletions

View File

@@ -12,7 +12,7 @@ index 79ba3ac1913f8..46bcb4366d2f8 100644
if (main_argv)
setproctitle_init(main_argv);
diff --git content/app/content_main.cc content/app/content_main.cc
index 96c28a7ce3183..3d60ab170e9a5 100644
index 96c28a7ce3183..8a396ce7adf86 100644
--- content/app/content_main.cc
+++ content/app/content_main.cc
@@ -174,11 +174,8 @@ ContentMainParams::~ContentMainParams() = default;
@@ -39,7 +39,18 @@ index 96c28a7ce3183..3d60ab170e9a5 100644
// A flag to indicate whether Main() has been called before. On Android, we
// may re-run Main() without restarting the browser process. This flag
@@ -274,14 +268,6 @@ RunContentProcess(ContentMainParams params,
@@ -266,7 +260,9 @@ RunContentProcess(ContentMainParams params,
// default, "C", locale.
setlocale(LC_NUMERIC, "C");
- SetupSignalHandlers();
+ if (!params.disable_signal_handlers) {
+ SetupSignalHandlers();
+ }
#endif
#if BUILDFLAG(IS_WIN)
@@ -274,14 +270,6 @@ RunContentProcess(ContentMainParams params,
#endif
#if BUILDFLAG(IS_MAC)
@@ -54,7 +65,7 @@ index 96c28a7ce3183..3d60ab170e9a5 100644
InitializeMac();
#endif
@@ -329,12 +315,46 @@ RunContentProcess(ContentMainParams params,
@@ -329,12 +317,46 @@ RunContentProcess(ContentMainParams params,
if (IsSubprocess())
CommonSubprocessInit();
@@ -149,10 +160,22 @@ index cbbc2f3ec12fa..f097b3cdded2f 100644
int RunBrowser(MainFunctionParams main_function_params,
bool start_minimal_browser);
diff --git content/public/app/content_main.h content/public/app/content_main.h
index 7f9b515297357..89b52e34fa31a 100644
index 7f9b515297357..5606867e43780 100644
--- content/public/app/content_main.h
+++ content/public/app/content_main.h
@@ -94,6 +94,13 @@ struct CONTENT_EXPORT ContentMainParams {
@@ -66,6 +66,11 @@ struct CONTENT_EXPORT ContentMainParams {
// are left uninitialized.
bool minimal_browser_mode = false;
+#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID)
+ // Indicates whether to disable signal handlers
+ bool disable_signal_handlers = false;
+#endif
+
#if BUILDFLAG(IS_MAC)
// The outermost autorelease pool to pass to main entry points.
STACK_ALLOCATED_IGNORE("https://crbug.com/1424190")
@@ -94,6 +99,13 @@ struct CONTENT_EXPORT ContentMainParams {
}
};