From 67653f904deff0cc1ea692595925558f4cb0623c Mon Sep 17 00:00:00 2001 From: Max Karolinskiy Date: Mon, 28 Jan 2019 18:47:52 -0500 Subject: [PATCH] Fix for crash reporting on Linux. - Patches ChromeCrashReporterClient::GetCollectStatsConsent to check for BRAVE_CHROMIUM_BUILD in addition to GOOGLE_CHROME_BUILD. - Patches breakpad Linux implementation with Brave's crash reporting upload endpoint. Fixes brave/brave-browser#1251 --- ...me-app-chrome_crash_reporter_client.cc.patch | 13 +++++++++++++ ...ts-crash-content-app-breakpad_linux.cc.patch | 17 +++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 patches/chrome-app-chrome_crash_reporter_client.cc.patch create mode 100644 patches/components-crash-content-app-breakpad_linux.cc.patch diff --git a/patches/chrome-app-chrome_crash_reporter_client.cc.patch b/patches/chrome-app-chrome_crash_reporter_client.cc.patch new file mode 100644 index 000000000000..b8aae63a2d8e --- /dev/null +++ b/patches/chrome-app-chrome_crash_reporter_client.cc.patch @@ -0,0 +1,13 @@ +diff --git a/chrome/app/chrome_crash_reporter_client.cc b/chrome/app/chrome_crash_reporter_client.cc +index 941caaa910906af473915f444fbbd2b4a9abe4d1..9606df6b5f8bb76acd4b8cf0cea6c58215ffb779 100644 +--- a/chrome/app/chrome_crash_reporter_client.cc ++++ b/chrome/app/chrome_crash_reporter_client.cc +@@ -110,7 +110,7 @@ bool ChromeCrashReporterClient::IsRunningUnattended() { + } + + bool ChromeCrashReporterClient::GetCollectStatsConsent() { +-#if defined(GOOGLE_CHROME_BUILD) ++#if defined(GOOGLE_CHROME_BUILD) || (defined(BRAVE_CHROMIUM_BUILD) && defined(OFFICIAL_BUILD)) + bool is_official_chrome_build = true; + #else + bool is_official_chrome_build = false; diff --git a/patches/components-crash-content-app-breakpad_linux.cc.patch b/patches/components-crash-content-app-breakpad_linux.cc.patch new file mode 100644 index 000000000000..7abbe5bd7d39 --- /dev/null +++ b/patches/components-crash-content-app-breakpad_linux.cc.patch @@ -0,0 +1,17 @@ +diff --git a/components/crash/content/app/breakpad_linux.cc b/components/crash/content/app/breakpad_linux.cc +index a7378204ffaa5586be9789a552de0f2a951ad208..9044ab8c9bb148edba86cad6b9781c726ad6dfed 100644 +--- a/components/crash/content/app/breakpad_linux.cc ++++ b/components/crash/content/app/breakpad_linux.cc +@@ -88,8 +88,12 @@ namespace breakpad { + namespace { + + #if !defined(OS_CHROMEOS) ++#if defined(BRAVE_CHROMIUM_BUILD) ++const char kUploadURL[] = "https://laptop-updates.brave.com/1/bc-crashes"; ++#else + const char kUploadURL[] = "https://clients2.google.com/cr/report"; + #endif ++#endif + + bool g_is_crash_reporter_enabled = false; + uint64_t g_process_start_time = 0;