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

Unified Diff: chrome/common/content_settings_pattern.cc

Issue 13251012: Fix b180514: Some exception entries cannot be deleted from a setting panel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not check the host part of a pattern strictly 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
« no previous file with comments | « no previous file | chrome/common/content_settings_pattern_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/content_settings_pattern.cc
diff --git a/chrome/common/content_settings_pattern.cc b/chrome/common/content_settings_pattern.cc
index 98ac6d637e2e52cae9ba9d582122e3d724e53dd6..2b3ae70e613a45856c51d569f1e44db3914c15df 100644
--- a/chrome/common/content_settings_pattern.cc
+++ b/chrome/common/content_settings_pattern.cc
@@ -156,6 +156,19 @@ ContentSettingsPattern ContentSettingsPattern::Builder::Build() {
} else {
is_valid_ = Validate(parts_);
}
+ if (!is_valid_)
+ return ContentSettingsPattern(parts_, is_valid_);
jochen (gone - plz use gerrit) 2013/04/05 11:23:47 nit. just return ContentSettingsPattern()
yhirano 2013/04/08 00:37:45 Done.
+
+ // A pattern is invalid if canonicalization is not idempotent.
+ // This check is here because it should be checked no matter
+ // use_legacy_validate_ is.
+ PatternParts parts(parts_);
+ if (!Canonicalize(&parts))
+ return ContentSettingsPattern();
+ if (ContentSettingsPattern(parts_, true) !=
+ ContentSettingsPattern(parts, true))
+ return ContentSettingsPattern();
jochen (gone - plz use gerrit) 2013/04/05 11:23:47 nit { } around body since the if condition is mult
yhirano 2013/04/08 00:37:45 Done.
+
return ContentSettingsPattern(parts_, is_valid_);
}
« no previous file with comments | « no previous file | chrome/common/content_settings_pattern_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698