| Index: base/path_service.cc
|
| diff --git a/base/path_service.cc b/base/path_service.cc
|
| index 61488d6f75ff4acd8becef175e353a8496b6a421..feaf4f3e7ddb51e181e39730c43ac61944cbad27 100644
|
| --- a/base/path_service.cc
|
| +++ b/base/path_service.cc
|
| @@ -241,10 +241,6 @@ bool PathService::Override(int key, const FilePath& path) {
|
| bool PathService::OverrideAndCreateIfNeeded(int key,
|
| const FilePath& path,
|
| bool create) {
|
| - PathData* path_data = GetPathData();
|
| - DCHECK(path_data);
|
| - DCHECK_GT(key, base::DIR_CURRENT) << "invalid path key";
|
| -
|
| FilePath file_path = path;
|
|
|
| // For some locations this will fail if called from inside the sandbox there-
|
| @@ -263,15 +259,25 @@ bool PathService::OverrideAndCreateIfNeeded(int key,
|
| if (file_path.empty())
|
| return false;
|
|
|
| + OverrideWithAbsolutePath(key, file_path);
|
| + return true;
|
| +}
|
| +
|
| +// static
|
| +void PathService::OverrideWithAbsolutePath(int key, const FilePath& path) {
|
| + DCHECK_GT(key, base::DIR_CURRENT) << "invalid path key";
|
| + DCHECK(path.IsAbsolute());
|
| +
|
| + PathData* path_data = GetPathData();
|
| + DCHECK(path_data);
|
| +
|
| base::AutoLock scoped_lock(path_data->lock);
|
|
|
| // Clear the cache now. Some of its entries could have depended
|
| // on the value we are overriding, and are now out of sync with reality.
|
| path_data->cache.clear();
|
|
|
| - path_data->overrides[key] = file_path;
|
| -
|
| - return true;
|
| + path_data->overrides[key] = path;
|
| }
|
|
|
| // static
|
|
|