Skip to content

Commit

Permalink
fix: crash dump location on Linux (electron#31668)
Browse files Browse the repository at this point in the history
* fix: crash dump location on Linux

* fix: ignore client_id for Zygote process

* chore: update comment

Co-authored-by: deepak1556 <hop2deep@gmail.com>
  • Loading branch information
codebytere and deepak1556 authored Nov 4, 2021
1 parent b6b9cec commit 96a04c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 0 additions & 4 deletions shell/app/electron_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 5 additions & 1 deletion shell/browser/electron_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 96a04c6

Please sign in to comment.