diff options
-rw-r--r-- | base/file_util.h | 2 | ||||
-rw-r--r-- | base/path_service.cc | 5 | ||||
-rw-r--r-- | chrome/app/chrome_dll_main.cc | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/base/file_util.h b/base/file_util.h index fb7a739..489cbcc 100644 --- a/base/file_util.h +++ b/base/file_util.h @@ -95,7 +95,7 @@ std::wstring GetDirectoryFromPath(const std::wstring& path); void AppendToPath(std::wstring* path, const std::wstring& new_ending); // Convert provided relative path into an absolute path. Returns false on -// error. +// error. On POSIX, this function fails if the path does not exist. bool AbsolutePath(FilePath* path); // Deprecated temporary compatibility function. bool AbsolutePath(std::wstring* path); diff --git a/base/path_service.cc b/base/path_service.cc index 0c3c3e2..f625c98 100644 --- a/base/path_service.cc +++ b/base/path_service.cc @@ -212,8 +212,13 @@ bool PathService::Override(int key, const std::wstring& path) { DCHECK(key > base::DIR_CURRENT) << "invalid path key"; std::wstring 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: if (!file_util::CreateDirectory(file_path)) diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index 023eeb1..1cb9e40 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -373,7 +373,7 @@ int ChromeMain(int argc, const char** argv) { const std::wstring user_data_dir = parsed_command_line.GetSwitchValue(switches::kUserDataDir); if (!user_data_dir.empty()) - PathService::Override(chrome::DIR_USER_DATA, user_data_dir); + CHECK(PathService::Override(chrome::DIR_USER_DATA, user_data_dir)); bool single_process = #if defined (GOOGLE_CHROME_BUILD) |