From 358ab79778396c533404652d94a3fc4be688b285 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Mon, 16 Nov 2020 09:47:09 -0800 Subject: [PATCH] fix: do not use crashpad APIs in the MAS build (#26491) --- chromium_src/BUILD.gn | 16 +++++++++------- shell/browser/api/electron_api_web_contents.cc | 7 ++++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn index 5d7375fd7d2..cfafc95dc22 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn @@ -286,13 +286,15 @@ static_library("chrome") { } } - sources += [ "//chrome/browser/hang_monitor/hang_crash_dump.h" ] - if (is_mac) { - sources += [ "//chrome/browser/hang_monitor/hang_crash_dump_mac.cc" ] - } else if (is_win) { - sources += [ "//chrome/browser/hang_monitor/hang_crash_dump_win.cc" ] - } else { - sources += [ "//chrome/browser/hang_monitor/hang_crash_dump.cc" ] + if (!is_mas_build) { + sources += [ "//chrome/browser/hang_monitor/hang_crash_dump.h" ] + if (is_mac) { + sources += [ "//chrome/browser/hang_monitor/hang_crash_dump_mac.cc" ] + } else if (is_win) { + sources += [ "//chrome/browser/hang_monitor/hang_crash_dump_win.cc" ] + } else { + sources += [ "//chrome/browser/hang_monitor/hang_crash_dump.cc" ] + } } } diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index c1f5eabe819..54d0d9c455c 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -27,7 +27,6 @@ #include "base/threading/thread_task_runner_handle.h" #include "base/values.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/hang_monitor/hang_crash_dump.h" #include "chrome/browser/ssl/security_state_tab_helper.h" #include "chrome/common/pref_names.h" #include "components/prefs/pref_service.h" @@ -178,6 +177,10 @@ #include "shell/browser/electron_pdf_web_contents_helper_client.h" #endif +#ifndef MAS_BUILD +#include "chrome/browser/hang_monitor/hang_crash_dump.h" // nogncheck +#endif + namespace gin { #if BUILDFLAG(ENABLE_PRINTING) @@ -2106,7 +2109,9 @@ void WebContents::ForcefullyCrashRenderer() { rph->ForceCrash(); #else // Try to generate a crash report for the hung process. +#ifndef MAS_BUILD CrashDumpHungChildProcess(rph->GetProcess().Handle()); +#endif rph->Shutdown(content::RESULT_CODE_HUNG); #endif }