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,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" ]
}
}
}

View file

@ -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
}