aboutsummaryrefslogtreecommitdiff
path: root/devel/electron23/files/patch-chrome_app_chrome__main__delegate.cc
diff options
context:
space:
mode:
Diffstat (limited to 'devel/electron23/files/patch-chrome_app_chrome__main__delegate.cc')
-rw-r--r--devel/electron23/files/patch-chrome_app_chrome__main__delegate.cc121
1 files changed, 121 insertions, 0 deletions
diff --git a/devel/electron23/files/patch-chrome_app_chrome__main__delegate.cc b/devel/electron23/files/patch-chrome_app_chrome__main__delegate.cc
new file mode 100644
index 000000000000..2fa2cd03c385
--- /dev/null
+++ b/devel/electron23/files/patch-chrome_app_chrome__main__delegate.cc
@@ -0,0 +1,121 @@
+--- chrome/app/chrome_main_delegate.cc.orig 2023-02-01 18:43:09 UTC
++++ chrome/app/chrome_main_delegate.cc
+@@ -138,7 +138,7 @@
+ #include "components/about_ui/credit_utils.h"
+ #endif
+
+-#if BUILDFLAG(ENABLE_NACL) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++#if BUILDFLAG(ENABLE_NACL) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_BSD)
+ #include "components/nacl/common/nacl_paths.h"
+ #include "components/nacl/zygote/nacl_fork_delegate_linux.h"
+ #endif
+@@ -182,16 +182,16 @@
+ #include "v8/include/v8.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "base/environment.h"
+ #endif
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ #include "base/message_loop/message_pump_libevent.h"
+ #endif
+
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || \
+- BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ #include "chrome/browser/policy/policy_path_parser.h"
+ #include "components/crash/core/app/crashpad.h"
+ #endif
+@@ -351,7 +351,7 @@ void AdjustLinuxOOMScore(const std::string& process_ty
+ // and resources loaded.
+ bool SubprocessNeedsResourceBundle(const std::string& process_type) {
+ return
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // The zygote process opens the resources for the renderers.
+ process_type == switches::kZygoteProcess ||
+ #endif
+@@ -436,7 +436,7 @@ bool HandleVersionSwitches(const base::CommandLine& co
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // Show the man page if --help or -h is on the command line.
+ void HandleHelpSwitches(const base::CommandLine& command_line) {
+ if (command_line.HasSwitch(switches::kHelp) ||
+@@ -550,7 +550,7 @@ void InitializeUserDataDir(base::CommandLine* command_
+ std::string process_type =
+ command_line->GetSwitchValueASCII(switches::kProcessType);
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // On Linux, Chrome does not support running multiple copies under different
+ // DISPLAYs, so the profile directory can be specified in the environment to
+ // support the virtual desktop use-case.
+@@ -639,7 +639,7 @@ void RecordMainStartupMetrics(base::TimeTicks applicat
+ #endif
+
+ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || \
+- BUILDFLAG(IS_CHROMEOS)
++ BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
+ // Record the startup process creation time on supported platforms. On Android
+ // this is recorded in ChromeMainDelegateAndroid.
+ startup_metric_utils::RecordStartupProcessCreationTime(
+@@ -927,6 +927,8 @@ void ChromeMainDelegate::CommonEarlyInitialization() {
+ // not always enabled on ChromeOS.
+ #if BUILDFLAG(IS_CHROMEOS)
+ bool enable_gwp_asan = crash_reporter::IsCrashpadEnabled();
++#elif BUILDFLAG(IS_BSD)
++ bool enable_gwp_asan = false;
+ #else
+ bool enable_gwp_asan = true;
+ #endif
+@@ -987,7 +989,7 @@ void ChromeMainDelegate::CommonEarlyInitialization() {
+ base::internal::TimerBase::InitializeFeatures();
+ base::InitializeCpuReductionExperiment();
+ base::sequence_manager::internal::SequenceManagerImpl::InitializeFeatures();
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
+ base::MessagePumpLibevent::InitializeFeatures();
+ #elif BUILDFLAG(IS_MAC)
+ base::PlatformThread::InitFeaturesPostFieldTrial();
+@@ -1119,7 +1121,7 @@ absl::optional<int> ChromeMainDelegate::BasicStartupCo
+
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag
+ // switch of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_BSD)
+ // This will directly exit if the user asked for help.
+ HandleHelpSwitches(command_line);
+ #endif
+@@ -1149,7 +1151,7 @@ absl::optional<int> ChromeMainDelegate::BasicStartupCo
+ #if BUILDFLAG(IS_CHROMEOS)
+ chromeos::dbus_paths::RegisterPathProvider();
+ #endif
+-#if BUILDFLAG(ENABLE_NACL) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
++#if BUILDFLAG(ENABLE_NACL) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD))
+ nacl::RegisterPathProvider();
+ #endif
+
+@@ -1531,7 +1533,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
+ CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
+ }
+
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
++#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_BSD)
+ // Zygote needs to call InitCrashReporter() in RunZygote().
+ if (process_type != switches::kZygoteProcess) {
+ if (command_line.HasSwitch(switches::kPreCrashpadCrashTest)) {
+@@ -1611,7 +1613,7 @@ absl::variant<int, content::MainFunctionParams> Chrome
+
+ // This entry is not needed on Linux, where the NaCl loader
+ // process is launched via nacl_helper instead.
+-#if BUILDFLAG(ENABLE_NACL) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
++#if BUILDFLAG(ENABLE_NACL) && !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
+ {switches::kNaClLoaderProcess, NaClMain},
+ #else
+ {"<invalid>", nullptr}, // To avoid constant array of size 0