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

Unified Diff: base/path_service.cc

Issue 258743005: Enable Enterprise enrollment on desktop builds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added arg to PathService::OverrideAndCreateIfNeeded, added test for FakeCryptohomeClient::InstallAt… Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: base/path_service.cc
diff --git a/base/path_service.cc b/base/path_service.cc
index 61488d6f75ff4acd8becef175e353a8496b6a421..75833db9a111b70ac5dcc64cd684779c5d462d3d 100644
--- a/base/path_service.cc
+++ b/base/path_service.cc
@@ -233,13 +233,15 @@ bool PathService::Get(int key, FilePath* result) {
// static
bool PathService::Override(int key, const FilePath& path) {
- // Just call the full function with true for the value of |create|.
- return OverrideAndCreateIfNeeded(key, path, true);
+ // Just call the full function with true for the value of |create|, and
+ // assume that |path| may not be absolute yet.
+ return OverrideAndCreateIfNeeded(key, path, false, true);
}
// static
bool PathService::OverrideAndCreateIfNeeded(int key,
const FilePath& path,
+ bool is_absolute,
bool create) {
PathData* path_data = GetPathData();
DCHECK(path_data);
@@ -259,9 +261,12 @@ bool PathService::OverrideAndCreateIfNeeded(int key,
}
// We need to have an absolute path.
- file_path = MakeAbsoluteFilePath(file_path);
- if (file_path.empty())
- return false;
+ if (!is_absolute) {
+ file_path = MakeAbsoluteFilePath(file_path);
+ if (file_path.empty())
+ return false;
+ }
+ DCHECK(file_path.IsAbsolute());
base::AutoLock scoped_lock(path_data->lock);

Powered by Google App Engine
This is Rietveld 408576698