Index: base/path_service.cc |
diff --git a/base/path_service.cc b/base/path_service.cc |
index 1fd2f6f900402dedc98d07533cf891f0e574fd40..53b4ed9f65243a8924ef986a0254c4694238810f 100644 |
--- a/base/path_service.cc |
+++ b/base/path_service.cc |
@@ -217,9 +217,9 @@ bool PathService::Get(int key, FilePath* result) { |
if (path.ReferencesParent()) { |
// Make sure path service never returns a path with ".." in it. |
- if (!file_util::AbsolutePath(&path)) { |
+ path = path.AsAbsolute(); |
+ if (path.empty()) |
return false; |
- } |
} |
*result = path; |
@@ -250,17 +250,16 @@ bool PathService::OverrideAndCreateIfNeeded(int key, |
// fore we protect this call with a flag. |
if (create) { |
// Make sure the directory exists. We need to do this before we translate |
- // this to the absolute path because on POSIX, AbsolutePath fails if called |
+ // this to the absolute path because on POSIX, AsAbsolute fails if called |
// on a non-existent 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, and will gladly crash the browser in CHECK()s if they get a |
- // relative path. |
- if (!file_util::AbsolutePath(&file_path)) |
+ // We need to have an absolute path. |
+ file_path = file_path.AsAbsolute(); |
+ if (file_path.empty()) |
return false; |
base::AutoLock scoped_lock(path_data->lock); |