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

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: Fix code style Created 7 years, 8 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..9153de66ae7d151c95eb51c4def98cfb6a7b6a87 100644
--- a/chrome/common/content_settings_pattern.cc
+++ b/chrome/common/content_settings_pattern.cc
@@ -156,6 +156,20 @@ ContentSettingsPattern ContentSettingsPattern::Builder::Build() {
} else {
is_valid_ = Validate(parts_);
}
+ if (!is_valid_)
+ return ContentSettingsPattern();
+
+ // 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();
+ }
+
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