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

Unified Diff: extensions/browser/content_verifier.cc

Issue 630243002: Fix extension content verification handling of ./ in icon paths (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor cleanup Created 6 years, 2 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/browser/content_verifier.cc
diff --git a/extensions/browser/content_verifier.cc b/extensions/browser/content_verifier.cc
index 52321c9267ac9e6cdc3e366a47584026e7b58d66..b249d0377318a2eee01d9fb83bd98069cdd72984 100644
--- a/extensions/browser/content_verifier.cc
+++ b/extensions/browser/content_verifier.cc
@@ -212,6 +212,20 @@ bool ContentVerifier::ShouldVerifyAnyPaths(
if (ContainsKey(browser_images, relative_path))
continue;
+ // The browser image paths from the extension may not be normalized (eg
+ // they might have leading '/' or './'), so we need to compare basename and
+ // dirname separately.
+ bool browser_image_match = false;
+ for (const auto& image_path : browser_images) {
Ken Rockot(use gerrit already) 2014/10/07 17:25:51 YAY AUTO
+ if (image_path.BaseName() == relative_path.BaseName() &&
+ image_path.DirName() == relative_path.DirName()) {
Ken Rockot(use gerrit already) 2014/10/07 17:25:51 Discussed offline, but probably want to compare in
+ browser_image_match = true;
+ break;
+ }
+ }
+ if (browser_image_match)
+ continue;
+
base::FilePath full_path = extension_root.Append(relative_path);
if (locales_dir.IsParent(full_path)) {
if (!all_locales) {
« no previous file with comments | « chrome/test/data/extensions/content_verifier/dot_slash_paths.crx ('k') | extensions/browser/content_verify_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698