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

Unified Diff: base/path_service.cc

Issue 200473002: Move all callers of GetHomeDir() to PathService::Get(base::DIR_HOME). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move subprocess homedir override to ChromeContentBrowserClient/ChromeMainDelegate 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..53c029ac7d70dc6566eeedabd30d93c31ece0cba 100644
--- a/base/path_service.cc
+++ b/base/path_service.cc
@@ -258,10 +258,14 @@ bool PathService::OverrideAndCreateIfNeeded(int key,
return false;
}
- // We need to have an absolute path.
- file_path = MakeAbsoluteFilePath(file_path);
- if (file_path.empty())
- return false;
+ // File path may be already provided as absolute value so avoid calling
+ // MakeAbsoluteFilePath() since it will fail in case of sandbox.
+ if (!file_path.IsAbsolute()) {
+ // We need to have an absolute path.
+ file_path = MakeAbsoluteFilePath(file_path);
+ if (file_path.empty())
+ return false;
+ }
base::AutoLock scoped_lock(path_data->lock);

Powered by Google App Engine
This is Rietveld 408576698