--- electron/shell/browser/api/electron_api_crash_reporter.cc.orig 2025-09-02 20:56:04 UTC +++ electron/shell/browser/api/electron_api_crash_reporter.cc @@ -31,7 +31,7 @@ #include "shell/common/process_util.h" #include "shell/common/thread_restrictions.h" -#if !IS_MAS_BUILD() +#if !IS_MAS_BUILD() && !BUILDFLAG(IS_BSD) #include "components/crash/core/app/crashpad.h" // nogncheck #include "components/crash/core/browser/crash_upload_list_crashpad.h" // nogncheck #include "components/crash/core/common/crash_key.h" @@ -65,7 +65,7 @@ namespace electron::api::crash_reporter { namespace electron::api::crash_reporter { -#if IS_MAS_BUILD() +#if IS_MAS_BUILD() || BUILDFLAG(IS_BSD) namespace { void NoOp() {} @@ -136,7 +136,7 @@ void Start(const std::string& submit_url, const std::map& extra, bool is_node_process) { TRACE_EVENT0("electron", "crash_reporter::Start"); -#if !IS_MAS_BUILD() +#if !IS_MAS_BUILD() && !BUILDFLAG(IS_BSD) if (g_crash_reporter_initialized) return; g_crash_reporter_initialized = true; @@ -182,7 +182,7 @@ namespace { namespace { -#if IS_MAS_BUILD() +#if IS_MAS_BUILD() || BUILDFLAG(IS_BSD) void GetUploadedReports( v8::Isolate* isolate, base::OnceCallback)> callback) { @@ -237,13 +237,13 @@ void SetUploadToServer(bool upload) { #endif void SetUploadToServer(bool upload) { -#if !IS_MAS_BUILD() +#if !IS_MAS_BUILD() && !BUILDFLAG(IS_BSD) ElectronCrashReporterClient::Get()->SetCollectStatsConsent(upload); #endif } bool GetUploadToServer() { -#if IS_MAS_BUILD() +#if IS_MAS_BUILD() || BUILDFLAG(IS_BSD) return false; #else return ElectronCrashReporterClient::Get()->GetCollectStatsConsent(); @@ -252,7 +252,7 @@ v8::Local GetParameters(v8::Isolate* isolat v8::Local GetParameters(v8::Isolate* isolate) { std::map keys; -#if !IS_MAS_BUILD() +#if !IS_MAS_BUILD() && !BUILDFLAG(IS_BSD) electron::crash_keys::GetCrashKeys(&keys); #endif return gin::ConvertToV8(isolate, keys); @@ -265,7 +265,7 @@ void Initialize(v8::Local exports, v8::Isolate* const isolate = electron::JavascriptEnvironment::GetIsolate(); gin_helper::Dictionary dict(isolate, exports); dict.SetMethod("start", &electron::api::crash_reporter::Start); -#if IS_MAS_BUILD() +#if IS_MAS_BUILD() || BUILDFLAG(IS_BSD) dict.SetMethod("addExtraParameter", &electron::api::crash_reporter::NoOp); dict.SetMethod("removeExtraParameter", &electron::api::crash_reporter::NoOp); #else