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.h" | 5 #include "chrome/common/chrome_paths.h" |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // ChromeOS uses a separate directory. See http://crosbug.com/25089 | 200 // ChromeOS uses a separate directory. See http://crosbug.com/25089 |
201 cur = base::FilePath("/var/log/chrome"); | 201 cur = base::FilePath("/var/log/chrome"); |
202 #elif defined(OS_ANDROID) | 202 #elif defined(OS_ANDROID) |
203 if (!base::android::GetCacheDirectory(&cur)) | 203 if (!base::android::GetCacheDirectory(&cur)) |
204 return false; | 204 return false; |
205 #else | 205 #else |
206 // The crash reports are always stored relative to the default user data | 206 // The crash reports are always stored relative to the default user data |
207 // directory. This avoids the problem of having to re-initialize the | 207 // directory. This avoids the problem of having to re-initialize the |
208 // exception handler after parsing command line options, which may | 208 // exception handler after parsing command line options, which may |
209 // override the location of the app's profile directory. | 209 // override the location of the app's profile directory. |
| 210 // TODO(scottmg): Consider supporting --user-data-dir. See |
| 211 // https://crbug.com/565446. |
210 if (!GetDefaultUserDataDirectory(&cur)) | 212 if (!GetDefaultUserDataDirectory(&cur)) |
211 return false; | 213 return false; |
212 #endif | 214 #endif |
213 #if defined(OS_MACOSX) || defined(OS_WIN) | 215 #if defined(OS_MACOSX) || defined(OS_WIN) |
214 cur = cur.Append(FILE_PATH_LITERAL("Crashpad")); | 216 cur = cur.Append(FILE_PATH_LITERAL("Crashpad")); |
215 #else | 217 #else |
216 cur = cur.Append(FILE_PATH_LITERAL("Crash Reports")); | 218 cur = cur.Append(FILE_PATH_LITERAL("Crash Reports")); |
217 #endif | 219 #endif |
218 create_dir = true; | 220 create_dir = true; |
219 break; | 221 break; |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 | 605 |
604 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { | 606 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { |
605 g_invalid_specified_user_data_dir.Get() = user_data_dir; | 607 g_invalid_specified_user_data_dir.Get() = user_data_dir; |
606 } | 608 } |
607 | 609 |
608 const base::FilePath& GetInvalidSpecifiedUserDataDir() { | 610 const base::FilePath& GetInvalidSpecifiedUserDataDir() { |
609 return g_invalid_specified_user_data_dir.Get(); | 611 return g_invalid_specified_user_data_dir.Get(); |
610 } | 612 } |
611 | 613 |
612 } // namespace chrome | 614 } // namespace chrome |
OLD | NEW |