OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/common/chrome_paths_internal.h" | 5 #include "chrome/common/chrome_paths_internal.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <knownfolders.h> | 8 #include <knownfolders.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 #if !defined(DISABLE_NACL) | 112 #if !defined(DISABLE_NACL) |
113 if (process_type == switches::kNaClBrokerProcess || | 113 if (process_type == switches::kNaClBrokerProcess || |
114 process_type == switches::kNaClLoaderProcess) { | 114 process_type == switches::kNaClLoaderProcess) { |
115 return true; | 115 return true; |
116 } | 116 } |
117 #endif | 117 #endif |
118 | 118 |
119 return false; | 119 return false; |
120 } | 120 } |
121 | 121 |
122 bool GetDefaultCrashDumpLocation(base::FilePath* crash_dir) { | |
123 // In order to be able to start crash handling very early, we do not rely on | |
124 // chrome's PathService entries (for DIR_CRASH_DUMPS) being available on | |
125 // Windows. See https://crbug.com/564398. | |
126 if (!GetDefaultUserDataDirectory(crash_dir)) | |
127 return false; | |
128 // We have to make sure the user data dir exists on first run. See | |
129 // http://crbug.com/591504. | |
130 if (!PathExists(*crash_dir) && !CreateDirectory(*crash_dir)) | |
131 return false; | |
132 *crash_dir = crash_dir->Append(FILE_PATH_LITERAL("Crashpad")); | |
133 return true; | |
134 } | |
135 | |
136 } // namespace chrome | 122 } // namespace chrome |
OLD | NEW |