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

Unified Diff: chrome/common/extensions/extension.cc

Issue 140018: Make ExtensionPrefs paths relative, re-enable 2 ExtensionsService unit_tests (Closed)
Patch Set: final changes Created 11 years, 6 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: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index d0c3c7340ceb25447e59c8622c80d1fbc7019b82..9b74737759953485f05516c477bf48a786c0314f 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;
« no previous file with comments | « chrome/browser/profile.cc ('k') | chrome/test/data/extensions/bad/Extensions/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/1/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698