From 96a04c67fdc171edb25c3e2bf44b8cb023c500ce Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 4 Nov 2021 18:45:59 +0100 Subject: [PATCH] fix: crash dump location on Linux (#31668) * fix: crash dump location on Linux * fix: ignore client_id for Zygote process * chore: update comment Co-authored-by: deepak1556 --- shell/app/electron_main_delegate.cc | 4 ---- shell/browser/electron_browser_client.cc | 6 +++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/shell/app/electron_main_delegate.cc b/shell/app/electron_main_delegate.cc index 22f75b475800..2c588f6a0f58 100644 --- a/shell/app/electron_main_delegate.cc +++ b/shell/app/electron_main_delegate.cc @@ -127,11 +127,7 @@ bool ElectronPathProvider(int key, base::FilePath* result) { case DIR_CRASH_DUMPS: if (!base::PathService::Get(chrome::DIR_USER_DATA, &cur)) return false; -#if defined(OS_MAC) || defined(OS_WIN) cur = cur.Append(FILE_PATH_LITERAL("Crashpad")); -#else - cur = cur.Append(FILE_PATH_LITERAL("Crash Reports")); -#endif create_dir = true; break; case chrome::DIR_APP_DICTIONARIES: diff --git a/shell/browser/electron_browser_client.cc b/shell/browser/electron_browser_client.cc index f0d262e5f875..213687581f20 100644 --- a/shell/browser/electron_browser_client.cc +++ b/shell/browser/electron_browser_client.cc @@ -559,7 +559,11 @@ void ElectronBrowserClient::AppendExtraCommandLineSwitches( enable_crash_reporter = breakpad::IsCrashReporterEnabled(); } - if (enable_crash_reporter) { + // Zygote Process gets booted before any JS runs, accessing GetClientId + // will end up touching DIR_USER_DATA path provider and this will + // configure default value because app.name from browser_init has + // not run yet. + if (enable_crash_reporter && process_type != ::switches::kZygoteProcess) { std::string switch_value = api::crash_reporter::GetClientId() + ",no_channel"; command_line->AppendSwitchASCII(::switches::kEnableCrashReporter,