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

Side by Side Diff: base/path_service.cc

Issue 5344003: Revert 67191 - chrome_paths: refactor and sanitize cache directory handling... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 1 month 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 | « base/path_service.h ('k') | base/path_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
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 "base/path_service.h" 5 #include "base/path_service.h"
6 6
7 #ifdef OS_WIN 7 #ifdef OS_WIN
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 bool PathService::Get(int key, std::wstring* result) { 208 bool PathService::Get(int key, std::wstring* result) {
209 // Deprecated compatibility function. 209 // Deprecated compatibility function.
210 FilePath path; 210 FilePath path;
211 if (!Get(key, &path)) 211 if (!Get(key, &path))
212 return false; 212 return false;
213 *result = path.ToWStringHack(); 213 *result = path.ToWStringHack();
214 return true; 214 return true;
215 } 215 }
216 #endif 216 #endif
217 217
218 // TODO(evan): remove me -- see comments in header.
219 bool PathService::IsOverridden(int key) {
220 PathData* path_data = GetPathData();
221 DCHECK(path_data);
222 AutoLock scoped_lock(path_data->lock);
223 return path_data->overrides.find(key) != path_data->overrides.end();
224 }
225
218 bool PathService::Override(int key, const FilePath& path) { 226 bool PathService::Override(int key, const FilePath& path) {
219 PathData* path_data = GetPathData(); 227 PathData* path_data = GetPathData();
220 DCHECK(path_data); 228 DCHECK(path_data);
221 DCHECK(key > base::DIR_CURRENT) << "invalid path key"; 229 DCHECK(key > base::DIR_CURRENT) << "invalid path key";
222 230
223 FilePath file_path = path; 231 FilePath file_path = path;
224 232
225 // Make sure the directory exists. We need to do this before we translate 233 // Make sure the directory exists. We need to do this before we translate
226 // this to the absolute path because on POSIX, AbsolutePath fails if called 234 // this to the absolute path because on POSIX, AbsolutePath fails if called
227 // on a non-existant path. 235 // on a non-existant path.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 p = new Provider; 277 p = new Provider;
270 p->is_static = false; 278 p->is_static = false;
271 p->func = func; 279 p->func = func;
272 p->next = path_data->providers; 280 p->next = path_data->providers;
273 #ifndef NDEBUG 281 #ifndef NDEBUG
274 p->key_start = key_start; 282 p->key_start = key_start;
275 p->key_end = key_end; 283 p->key_end = key_end;
276 #endif 284 #endif
277 path_data->providers = p; 285 path_data->providers = p;
278 } 286 }
OLDNEW
« no previous file with comments | « base/path_service.h ('k') | base/path_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698