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

Unified Diff: extensions/common/extension_resource.cc

Issue 13196006: Move path functions from file_util to FilePath object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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: extensions/common/extension_resource.cc
diff --git a/extensions/common/extension_resource.cc b/extensions/common/extension_resource.cc
index 5a70539cce60483882390e91ec467bfd72870a32..f39be7b3aaece2f73e5c843b7128df733ea4e483 100644
--- a/extensions/common/extension_resource.cc
+++ b/extensions/common/extension_resource.cc
@@ -52,8 +52,8 @@ base::FilePath ExtensionResource::GetFilePath(
SymlinkPolicy symlink_policy) {
// We need to resolve the parent references in the extension_root
// path on its own because IsParent doesn't like parent references.
- base::FilePath clean_extension_root(extension_root);
- if (!file_util::AbsolutePath(&clean_extension_root))
+ base::FilePath clean_extension_root(extension_root.AsAbsolute());
+ if (clean_extension_root.empty())
return base::FilePath();
base::FilePath full_path = clean_extension_root.Append(relative_path);
@@ -80,13 +80,13 @@ base::FilePath ExtensionResource::GetFilePath(
// We must resolve the absolute path of the combined path when
// the relative path contains references to a parent folder (i.e., '..').
- // We also check if the path exists because the posix version of AbsolutePath
+ // We also check if the path exists because the posix version of AsAbsolute
// will fail if the path doesn't exist, and we want the same behavior on
- // Windows... So until the posix and Windows version of AbsolutePath are
+ // Windows... So until the posix and Windows version of AsAbsolute are
// unified, we need an extra call to PathExists, unfortunately.
- // TODO(mad): Fix this once AbsolutePath is unified.
- if (file_util::AbsolutePath(&full_path) &&
- file_util::PathExists(full_path) &&
+ // TODO(mad): Fix this once AsAbsolute is unified.
+ full_path = full_path.AsAbsolute();
+ if (file_util::PathExists(full_path) &&
(symlink_policy == FOLLOW_SYMLINKS_ANYWHERE ||
clean_extension_root.IsParent(full_path))) {
return full_path;

Powered by Google App Engine
This is Rietveld 408576698