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

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

Issue 6297003: Fail gracefully if profile Temp dir can not be accessed. (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: Address rev comments. Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/chrome_paths.h ('k') | chrome/common/extensions/extension_file_util.h » ('j') | 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-2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 if (!PathService::Get(base::DIR_EXE, &cur)) 175 if (!PathService::Get(base::DIR_EXE, &cur))
176 return false; 176 return false;
177 #endif 177 #endif
178 cur = cur.Append(FILE_PATH_LITERAL("Dictionaries")); 178 cur = cur.Append(FILE_PATH_LITERAL("Dictionaries"));
179 create_dir = true; 179 create_dir = true;
180 break; 180 break;
181 case chrome::DIR_USER_DATA_TEMP: 181 case chrome::DIR_USER_DATA_TEMP:
182 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) 182 if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
183 return false; 183 return false;
184 cur = cur.Append(FILE_PATH_LITERAL("Temp")); 184 cur = cur.Append(FILE_PATH_LITERAL("Temp"));
185 create_dir = true;
186 break; 185 break;
187 case chrome::DIR_INTERNAL_PLUGINS: 186 case chrome::DIR_INTERNAL_PLUGINS:
188 if (!GetInternalPluginsDirectory(&cur)) 187 if (!GetInternalPluginsDirectory(&cur))
189 return false; 188 return false;
190 break; 189 break;
191 case chrome::FILE_LOCAL_STATE: 190 case chrome::FILE_LOCAL_STATE:
192 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) 191 if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
193 return false; 192 return false;
194 cur = cur.Append(chrome::kLocalStateFilename); 193 cur = cur.Append(chrome::kLocalStateFilename);
195 break; 194 break;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 return true; 332 return true;
334 } 333 }
335 334
336 // This cannot be done as a static initializer sadly since Visual Studio will 335 // This cannot be done as a static initializer sadly since Visual Studio will
337 // eliminate this object file if there is no direct entry point into it. 336 // eliminate this object file if there is no direct entry point into it.
338 void RegisterPathProvider() { 337 void RegisterPathProvider() {
339 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 338 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
340 } 339 }
341 340
342 } // namespace chrome 341 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/chrome_paths.h ('k') | chrome/common/extensions/extension_file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698