fix: save crash reports locally when uploadToServer: false on linux (#24778)
* fix: generate dumps under crashDumps folder in linux * Update spec-main/api-crash-reporter-spec.ts Co-authored-by: Jeremy Rose <jeremya@chromium.org> Co-authored-by: Jeremy Rose <jeremya@chromium.org>
This commit is contained in:
parent
06cb550c75
commit
01023435c0
3 changed files with 51 additions and 12 deletions
|
@ -11,6 +11,7 @@
|
|||
#include "base/command_line.h"
|
||||
#include "base/environment.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/string_split.h"
|
||||
|
@ -147,7 +148,14 @@ bool ElectronCrashReporterClient::GetCrashDumpLocation(
|
|||
#else
|
||||
bool ElectronCrashReporterClient::GetCrashDumpLocation(
|
||||
base::FilePath* crash_dir) {
|
||||
return base::PathService::Get(electron::DIR_CRASH_DUMPS, crash_dir);
|
||||
bool result = base::PathService::Get(electron::DIR_CRASH_DUMPS, crash_dir);
|
||||
{
|
||||
base::ThreadRestrictions::ScopedAllowIO allow_io;
|
||||
if (result && !base::PathExists(*crash_dir)) {
|
||||
return base::CreateDirectory(*crash_dir);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -159,7 +167,7 @@ bool ElectronCrashReporterClient::GetCrashMetricsLocation(
|
|||
#endif // OS_MACOSX || OS_LINUX
|
||||
|
||||
bool ElectronCrashReporterClient::IsRunningUnattended() {
|
||||
return false;
|
||||
return !collect_stats_consent_;
|
||||
}
|
||||
|
||||
bool ElectronCrashReporterClient::GetCollectStatsConsent() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue