summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/extension.cc
diff options
context:
space:
mode:
authorrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 21:03:23 +0000
committerrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 21:03:23 +0000
commita9b00acc0c03fff42673e3eb0d953768640a5fb1 (patch)
tree06b8d431e7760a10fcab5ee2a2493b8b22118fca /chrome/common/extensions/extension.cc
parent6501bc016d78c6d419b89bf991314148e6e4494b (diff)
downloadchromium_src-a9b00acc0c03fff42673e3eb0d953768640a5fb1.zip
chromium_src-a9b00acc0c03fff42673e3eb0d953768640a5fb1.tar.gz
chromium_src-a9b00acc0c03fff42673e3eb0d953768640a5fb1.tar.bz2
Refactored ExtensionsPrefs to store paths relative to the extensions install directory. Fix & reenabled two extensions_service unit_tests.
R=erikkay BUG=14714 Review URL: http://codereview.chromium.org/140018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19285 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension.cc')
-rw-r--r--chrome/common/extensions/extension.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index d0c3c73..9b74737 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -489,11 +489,8 @@ FilePath Extension::GetResourcePath(const FilePath& extension_path,
return FilePath();
// Double-check that the path we ended up with is actually inside the
- // extension root. We can do this with a simple prefix match because:
- // a) We control the prefix on both sides, and they should match.
- // b) GURL normalizes things like "../" and "//" before it gets to us.
- if (ret_val.value().find(extension_path.value() +
- FilePath::kSeparators[0]) != 0)
+ // extension root.
+ if (!extension_path.IsParent(ret_val))
return FilePath();
return ret_val;