| 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> |
| 11 #include <shobjidl.h> | 11 #include <shobjidl.h> |
| 12 | 12 |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/files/file_util.h" |
| 14 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 15 #include "base/win/scoped_co_mem.h" | 16 #include "base/win/scoped_co_mem.h" |
| 16 #include "chrome/common/chrome_constants.h" | 17 #include "chrome/common/chrome_constants.h" |
| 17 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 18 #include "chrome/installer/util/browser_distribution.h" | 19 #include "chrome/installer/util/browser_distribution.h" |
| 19 #include "components/nacl/common/nacl_switches.h" | 20 #include "components/nacl/common/nacl_switches.h" |
| 20 | 21 |
| 21 namespace chrome { | 22 namespace chrome { |
| 22 | 23 |
| 23 namespace { | 24 namespace { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 118 |
| 118 return false; | 119 return false; |
| 119 } | 120 } |
| 120 | 121 |
| 121 bool GetDefaultCrashDumpLocation(base::FilePath* crash_dir) { | 122 bool GetDefaultCrashDumpLocation(base::FilePath* crash_dir) { |
| 122 // In order to be able to start crash handling very early, we do not rely on | 123 // In order to be able to start crash handling very early, we do not rely on |
| 123 // chrome's PathService entries (for DIR_CRASH_DUMPS) being available on | 124 // chrome's PathService entries (for DIR_CRASH_DUMPS) being available on |
| 124 // Windows. See https://crbug.com/564398. | 125 // Windows. See https://crbug.com/564398. |
| 125 if (!GetDefaultUserDataDirectory(crash_dir)) | 126 if (!GetDefaultUserDataDirectory(crash_dir)) |
| 126 return false; | 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; |
| 127 *crash_dir = crash_dir->Append(FILE_PATH_LITERAL("Crashpad")); | 132 *crash_dir = crash_dir->Append(FILE_PATH_LITERAL("Crashpad")); |
| 128 return true; | 133 return true; |
| 129 } | 134 } |
| 130 | 135 |
| 131 } // namespace chrome | 136 } // namespace chrome |
| OLD | NEW |