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

Unified Diff: base/path_service.cc

Issue 146057: Making browser test work (again) on Linux (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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
« no previous file with comments | « base/path_service.h ('k') | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/path_service.cc
===================================================================
--- base/path_service.cc (revision 19071)
+++ base/path_service.cc (working copy)
@@ -206,12 +206,12 @@
return path_data->overrides.find(key) != path_data->overrides.end();
}
-bool PathService::Override(int key, const std::wstring& path) {
+bool PathService::Override(int key, const FilePath& path) {
PathData* path_data = GetPathData();
DCHECK(path_data);
DCHECK(key > base::DIR_CURRENT) << "invalid path key";
- std::wstring file_path = path;
+ FilePath file_path = path;
#if defined(OS_WIN)
// On Windows we switch the current working directory to load plugins (at
// least). That's not the case on POSIX.
@@ -221,17 +221,20 @@
#endif
// make sure the directory exists:
- if (!file_util::CreateDirectory(file_path))
+ if (!file_util::PathExists(file_path) &&
+ !file_util::CreateDirectory(file_path))
return false;
- file_util::TrimTrailingSeparator(&file_path);
-
AutoLock scoped_lock(path_data->lock);
- path_data->cache[key] = FilePath::FromWStringHack(file_path);
+ path_data->cache[key] = file_path;
path_data->overrides.insert(key);
return true;
}
+bool PathService::Override(int key, const std::wstring& path) {
+ return Override(key, FilePath::FromWStringHack(path));
+}
+
bool PathService::SetCurrentDirectory(const std::wstring& current_directory) {
return file_util::SetCurrentDirectory(current_directory);
}
« no previous file with comments | « base/path_service.h ('k') | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698