--- electron/shell/app/electron_main_delegate.cc.orig 2026-03-17 08:46:52 UTC +++ electron/shell/app/electron_main_delegate.cc @@ -64,7 +64,7 @@ #include "chrome/child/v8_crashpad_support_win.h" #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) #include "base/nix/xdg_util.h" #include "base/posix/global_descriptors.h" #include "content/public/common/content_descriptors.h" @@ -72,7 +72,7 @@ #include "v8/include/v8.h" #endif -#if !IS_MAS_BUILD() +#if !IS_MAS_BUILD() && !BUILDFLAG(IS_BSD) #include "components/crash/core/app/crash_switches.h" // nogncheck #include "components/crash/core/app/crashpad.h" // nogncheck #include "components/crash/core/common/crash_key.h" @@ -212,7 +212,7 @@ std::optional ElectronMainDelegate::BasicStartupC base::win::PinUser32(); #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Check for --no-sandbox parameter when running as root. if (getuid() == 0 && IsSandboxEnabled(command_line)) LOG(FATAL) << "Running as root without --" @@ -242,7 +242,7 @@ void ElectronMainDelegate::PreSandboxStartup() { auto* command_line = base::CommandLine::ForCurrentProcess(); std::string process_type = GetProcessType(); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Register the pseudonymization salt descriptor in GlobalDescriptors. // (see https://crbug.com/40850085) Only affects processes launched // without the zygote (i.e. utility processes) @@ -276,7 +276,7 @@ void ElectronMainDelegate::PreSandboxStartup() { /* is_preinit = */ IsBrowserProcess() || IsZygoteProcess()); #endif -#if !IS_MAS_BUILD() +#if !IS_MAS_BUILD() && !BUILDFLAG(IS_BSD) crash_reporter::InitializeCrashKeys(); #endif @@ -311,7 +311,7 @@ void ElectronMainDelegate::PreSandboxStartup() { } #endif -#if !IS_MAS_BUILD() +#if !IS_MAS_BUILD() && !BUILDFLAG(IS_BSD) crash_keys::SetCrashKeysFromCommandLine(*command_line); crash_keys::SetPlatformCrashKey(); #endif @@ -351,7 +351,7 @@ std::optional ElectronMainDelegate::PreBrowserMai #if BUILDFLAG(IS_MAC) RegisterAtomCrApp(); #endif -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) // Set the global activation token sent as an environment variable. auto env = base::Environment::Create(); base::nix::ExtractXdgActivationTokenFromEnv(*env);