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

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

Issue 2853983002: Ensure settings returned from Content Settings providers are valid (Closed)
Patch Set: Ensure settings returned from Content Settings providers are valid Created 3 years, 7 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/content_settings_pref.cc
diff --git a/components/content_settings/core/browser/content_settings_pref.cc b/components/content_settings/core/browser/content_settings_pref.cc
index d1bf46e76870dada2ee05345f854880287831167..310750215d810514a8fbdb1ea1ef2091c8a979db 100644
--- a/components/content_settings/core/browser/content_settings_pref.cc
+++ b/components/content_settings/core/browser/content_settings_pref.cc
@@ -281,6 +281,7 @@ void ContentSettingsPref::ReadContentSettingsFromPref() {
DCHECK(is_integer);
DCHECK_NE(CONTENT_SETTING_DEFAULT, setting);
std::unique_ptr<base::Value> setting_ptr(new base::Value(setting));
+ DCHECK(IsValueAllowedForType(setting_ptr.get(), content_type_));
// Per resource settings store a single timestamps for all resources.
value_map_.SetValue(pattern_pair.first, pattern_pair.second,
content_type_, resource_identifier, last_modified,

Powered by Google App Engine
This is Rietveld 408576698