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

Unified Diff: components/content_settings/core/browser/host_content_settings_map.cc

Issue 2292443003: Support host-based deletion for SSLHostStateDelegate (Closed)
Patch Set: Revert changes in ContentSettingPattern, convert pattern directly to URL Created 4 years, 4 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: components/content_settings/core/browser/host_content_settings_map.cc
diff --git a/components/content_settings/core/browser/host_content_settings_map.cc b/components/content_settings/core/browser/host_content_settings_map.cc
index bf860d881d9c6de27201e5fd1caa8d10a510e420..6b5962481a647cdb4d7ce058318d8b7e49c617cb 100644
--- a/components/content_settings/core/browser/host_content_settings_map.cc
+++ b/components/content_settings/core/browser/host_content_settings_map.cc
@@ -723,6 +723,28 @@ void HostContentSettingsMap::ClearSettingsForOneType(
FlushLossyWebsiteSettings();
}
+void HostContentSettingsMap::ClearSettingsForOneTypeWithPredicate(
+ ContentSettingsType content_type,
+ const base::Callback<bool(const ContentSettingsPattern& primary_pattern,
+ const ContentSettingsPattern& secondary_pattern)>&
+ pattern_predicate) {
+ if (pattern_predicate.is_null()) {
+ ClearSettingsForOneType(content_type);
+ return;
+ }
+
+ ContentSettingsForOneType settings;
+ GetSettingsForOneType(content_type, std::string(), &settings);
+ for (const ContentSettingPatternSource& setting : settings) {
+ if (pattern_predicate.Run(setting.primary_pattern,
+ setting.secondary_pattern)) {
+ SetWebsiteSettingCustomScope(setting.primary_pattern,
+ setting.secondary_pattern, content_type,
+ std::string(), nullptr);
+ }
+ }
+}
+
// TODO(raymes): Remove this function. Consider making it a property of
// ContentSettingsInfo or removing it altogether (it's unclear whether we should
// be restricting allowed default values at this layer).

Powered by Google App Engine
This is Rietveld 408576698