1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
--- electron/shell/browser/api/electron_api_crash_reporter.cc.orig 2023-06-07 10:09:25 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"
@@ -66,7 +66,7 @@ bool g_crash_reporter_initialized = false;
namespace electron::api::crash_reporter {
-#if IS_MAS_BUILD()
+#if IS_MAS_BUILD() || BUILDFLAG(IS_BSD)
namespace {
void NoOp() {}
@@ -133,7 +133,7 @@ void Start(const std::string& submit_url,
const std::map<std::string, std::string>& 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;
@@ -179,7 +179,7 @@ void Start(const std::string& submit_url,
namespace {
-#if IS_MAS_BUILD()
+#if IS_MAS_BUILD() || BUILDFLAG(IS_BSD)
void GetUploadedReports(
v8::Isolate* isolate,
base::OnceCallback<void(v8::Local<v8::Value>)> callback) {
@@ -235,13 +235,13 @@ v8::Local<v8::Value> GetUploadedReports(v8::Isolate* i
#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();
@@ -250,7 +250,7 @@ bool GetUploadToServer() {
v8::Local<v8::Value> GetParameters(v8::Isolate* isolate) {
std::map<std::string, std::string> keys;
-#if !IS_MAS_BUILD()
+#if !IS_MAS_BUILD() && !BUILDFLAG(IS_BSD)
electron::crash_keys::GetCrashKeys(&keys);
#endif
return gin::ConvertToV8(isolate, keys);
@@ -262,7 +262,7 @@ void Initialize(v8::Local<v8::Object> exports,
void* priv) {
gin_helper::Dictionary dict(context->GetIsolate(), 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
|