fix: do not use crashpad APIs in the MAS build (#26491)

This commit is contained in:
Samuel Attard 2020-11-16 09:47:09 -08:00 committed by GitHub
parent 900fbb99c9
commit 358ab79778
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 8 deletions

View file

@ -286,6 +286,7 @@ static_library("chrome") {
} }
} }
if (!is_mas_build) {
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump.h" ] sources += [ "//chrome/browser/hang_monitor/hang_crash_dump.h" ]
if (is_mac) { if (is_mac) {
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump_mac.cc" ] sources += [ "//chrome/browser/hang_monitor/hang_crash_dump_mac.cc" ]
@ -294,6 +295,7 @@ static_library("chrome") {
} else { } else {
sources += [ "//chrome/browser/hang_monitor/hang_crash_dump.cc" ] sources += [ "//chrome/browser/hang_monitor/hang_crash_dump.cc" ]
} }
}
} }
source_set("plugins") { source_set("plugins") {

View file

@ -27,7 +27,6 @@
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/browser_process.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/browser/ssl/security_state_tab_helper.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
@ -178,6 +177,10 @@
#include "shell/browser/electron_pdf_web_contents_helper_client.h" #include "shell/browser/electron_pdf_web_contents_helper_client.h"
#endif #endif
#ifndef MAS_BUILD
#include "chrome/browser/hang_monitor/hang_crash_dump.h" // nogncheck
#endif
namespace gin { namespace gin {
#if BUILDFLAG(ENABLE_PRINTING) #if BUILDFLAG(ENABLE_PRINTING)
@ -2106,7 +2109,9 @@ void WebContents::ForcefullyCrashRenderer() {
rph->ForceCrash(); rph->ForceCrash();
#else #else
// Try to generate a crash report for the hung process. // Try to generate a crash report for the hung process.
#ifndef MAS_BUILD
CrashDumpHungChildProcess(rph->GetProcess().Handle()); CrashDumpHungChildProcess(rph->GetProcess().Handle());
#endif
rph->Shutdown(content::RESULT_CODE_HUNG); rph->Shutdown(content::RESULT_CODE_HUNG);
#endif #endif
} }