Index: base/path_service.cc |
diff --git a/base/path_service.cc b/base/path_service.cc |
index 4a4c100a7b006c63f058c36e894064104a8ca14b..844c81841351dfaaab94ec388017c1bbdfc1b648 100644 |
--- a/base/path_service.cc |
+++ b/base/path_service.cc |
@@ -214,19 +214,19 @@ bool PathService::Override(int key, const FilePath& path) { |
DCHECK(key > base::DIR_CURRENT) << "invalid path key"; |
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. |
- // Also, on POSIX, AbsolutePath fails if called on a non-existant path. |
- if (!file_util::AbsolutePath(&file_path)) |
- return false; |
-#endif |
- // make sure the directory exists: |
+ // Make sure the directory exists. We need to do this before we make |
MAD
2009/10/27 23:22:56
"...before we make translate..."???
Is it just me
|
+ // translate this to the absolute path because on POSIX, AbsolutePath fails |
+ // if called on a non-existant path. |
if (!file_util::PathExists(file_path) && |
!file_util::CreateDirectory(file_path)) |
return false; |
+ // We need to have an absolute path, as extensions and plugins don't like |
+ // relative paths. |
+ if (!file_util::AbsolutePath(&file_path)) |
+ return false; |
+ |
AutoLock scoped_lock(path_data->lock); |
path_data->cache[key] = file_path; |
path_data->overrides.insert(key); |