| 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 if (!base::android::GetCacheDirectory(&cur)) | 224 if (!base::android::GetCacheDirectory(&cur)) |
| 225 return false; | 225 return false; |
| 226 #else | 226 #else |
| 227 // The crash reports are always stored relative to the default user data | 227 // The crash reports are always stored relative to the default user data |
| 228 // directory. This avoids the problem of having to re-initialize the | 228 // directory. This avoids the problem of having to re-initialize the |
| 229 // exception handler after parsing command line options, which may | 229 // exception handler after parsing command line options, which may |
| 230 // override the location of the app's profile directory. | 230 // override the location of the app's profile directory. |
| 231 if (!GetDefaultUserDataDirectory(&cur)) | 231 if (!GetDefaultUserDataDirectory(&cur)) |
| 232 return false; | 232 return false; |
| 233 #endif | 233 #endif |
| 234 #if defined(OS_MACOSX) |
| 235 cur = cur.Append(FILE_PATH_LITERAL("Crashpad")); |
| 236 #else |
| 234 cur = cur.Append(FILE_PATH_LITERAL("Crash Reports")); | 237 cur = cur.Append(FILE_PATH_LITERAL("Crash Reports")); |
| 238 #endif |
| 235 create_dir = true; | 239 create_dir = true; |
| 236 break; | 240 break; |
| 237 #if defined(OS_WIN) | 241 #if defined(OS_WIN) |
| 238 case chrome::DIR_WATCHER_DATA: | 242 case chrome::DIR_WATCHER_DATA: |
| 239 // The watcher data is always stored relative to the default user data | 243 // The watcher data is always stored relative to the default user data |
| 240 // directory. This allows the watcher to be initialized before | 244 // directory. This allows the watcher to be initialized before |
| 241 // command-line options have been parsed. | 245 // command-line options have been parsed. |
| 242 if (!GetDefaultUserDataDirectory(&cur)) | 246 if (!GetDefaultUserDataDirectory(&cur)) |
| 243 return false; | 247 return false; |
| 244 cur = cur.Append(FILE_PATH_LITERAL("Diagnostics")); | 248 cur = cur.Append(FILE_PATH_LITERAL("Diagnostics")); |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 | 614 |
| 611 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { | 615 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { |
| 612 g_invalid_specified_user_data_dir.Get() = user_data_dir; | 616 g_invalid_specified_user_data_dir.Get() = user_data_dir; |
| 613 } | 617 } |
| 614 | 618 |
| 615 const base::FilePath& GetInvalidSpecifiedUserDataDir() { | 619 const base::FilePath& GetInvalidSpecifiedUserDataDir() { |
| 616 return g_invalid_specified_user_data_dir.Get(); | 620 return g_invalid_specified_user_data_dir.Get(); |
| 617 } | 621 } |
| 618 | 622 |
| 619 } // namespace chrome | 623 } // namespace chrome |
| OLD | NEW |