feat: support crashpad on linux (#29719)

This commit is contained in:
Jeremy Rose 2021-07-19 10:11:10 -07:00 committed by GitHub
parent 612361c4da
commit c9ba0d02d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 547 additions and 455 deletions

View file

@ -153,6 +153,9 @@ bool ElectronCrashReporterClient::GetCrashDumpLocation(
base::FilePath* crash_dir) {
bool result = base::PathService::Get(electron::DIR_CRASH_DUMPS, crash_dir);
{
// If the DIR_CRASH_DUMPS path is overridden with
// app.setPath('crashDumps', ...) then the directory might not have been
// created.
base::ThreadRestrictions::ScopedAllowIO allow_io;
if (result && !base::PathExists(*crash_dir)) {
return base::CreateDirectory(*crash_dir);
@ -162,13 +165,6 @@ bool ElectronCrashReporterClient::GetCrashDumpLocation(
}
#endif
#if defined(OS_MAC) || defined(OS_LINUX)
bool ElectronCrashReporterClient::GetCrashMetricsLocation(
base::FilePath* metrics_dir) {
return base::PathService::Get(chrome::DIR_USER_DATA, metrics_dir);
}
#endif // OS_MAC || OS_LINUX
bool ElectronCrashReporterClient::IsRunningUnattended() {
return !collect_stats_consent_;
}