Index: chrome/common/chrome_paths_win.cc |
diff --git a/chrome/common/chrome_paths_win.cc b/chrome/common/chrome_paths_win.cc |
index 597448bdf67a23280e996fdc49a8084ae22f31ee..4713a0a61d679daa5e78f96fe5bb91cc1f278297 100644 |
--- a/chrome/common/chrome_paths_win.cc |
+++ b/chrome/common/chrome_paths_win.cc |
@@ -119,4 +119,18 @@ |
return false; |
} |
+bool GetDefaultCrashDumpLocation(base::FilePath* crash_dir) { |
+ // In order to be able to start crash handling very early, we do not rely on |
+ // chrome's PathService entries (for DIR_CRASH_DUMPS) being available on |
+ // Windows. See https://crbug.com/564398. |
+ if (!GetDefaultUserDataDirectory(crash_dir)) |
+ return false; |
+ // We have to make sure the user data dir exists on first run. See |
+ // http://crbug.com/591504. |
+ if (!PathExists(*crash_dir) && !CreateDirectory(*crash_dir)) |
+ return false; |
+ *crash_dir = crash_dir->Append(FILE_PATH_LITERAL("Crashpad")); |
+ return true; |
+} |
+ |
} // namespace chrome |