Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: chrome/common/chrome_paths.cc

Issue 219043: Refuse to start if we can't get the user data directory. (Closed)
Patch Set: wrap Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/browser_main.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 return PathService::Get(base::FILE_MODULE, result); 67 return PathService::Get(base::FILE_MODULE, result);
68 } 68 }
69 69
70 // Assume that we will not need to create the directory if it does not exist. 70 // Assume that we will not need to create the directory if it does not exist.
71 // This flag can be set to true for the cases where we want to create it. 71 // This flag can be set to true for the cases where we want to create it.
72 bool create_dir = false; 72 bool create_dir = false;
73 73
74 FilePath cur; 74 FilePath cur;
75 switch (key) { 75 switch (key) {
76 case chrome::DIR_USER_DATA: 76 case chrome::DIR_USER_DATA:
77 if (!GetDefaultUserDataDirectory(&cur)) 77 if (!GetDefaultUserDataDirectory(&cur)) {
78 NOTREACHED();
78 return false; 79 return false;
80 }
79 create_dir = true; 81 create_dir = true;
80 break; 82 break;
81 case chrome::DIR_USER_CACHE: 83 case chrome::DIR_USER_CACHE:
82 #if defined(OS_LINUX) 84 #if defined(OS_LINUX)
83 if (!GetUserCacheDirectory(&cur)) 85 if (!GetUserCacheDirectory(&cur))
84 return false; 86 return false;
85 create_dir = true; 87 create_dir = true;
86 #else 88 #else
87 // No concept of a separate cache directory on non-Linux systems. 89 // No concept of a separate cache directory on non-Linux systems.
88 return false; 90 return false;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 return true; 215 return true;
214 } 216 }
215 217
216 // This cannot be done as a static initializer sadly since Visual Studio will 218 // This cannot be done as a static initializer sadly since Visual Studio will
217 // eliminate this object file if there is no direct entry point into it. 219 // eliminate this object file if there is no direct entry point into it.
218 void RegisterPathProvider() { 220 void RegisterPathProvider() {
219 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 221 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
220 } 222 }
221 223
222 } // namespace chrome 224 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/browser_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698