Index: chrome/browser/extensions/api/content_settings/content_settings_store.cc |
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_store.cc b/chrome/browser/extensions/api/content_settings/content_settings_store.cc |
index 765636dbf9ec3793ae39732d508de8bc37c38e5a..bf120bc5b08a0d9a72f8da0e5119dc42a6e045bf 100644 |
--- a/chrome/browser/extensions/api/content_settings/content_settings_store.cc |
+++ b/chrome/browser/extensions/api/content_settings/content_settings_store.cc |
@@ -288,13 +288,12 @@ void ContentSettingsStore::SetExtensionContentSettingFromList( |
const std::string& extension_id, |
const base::ListValue* list, |
ExtensionPrefsScope scope) { |
- for (base::ListValue::const_iterator it = list->begin(); |
- it != list->end(); ++it) { |
- if ((*it)->GetType() != base::Value::TYPE_DICTIONARY) { |
+ for (const auto& value : *list) { |
+ base::DictionaryValue* dict; |
+ if (value->GetAsDictionary(&dict)) { |
danakj
2016/05/24 20:08:34
do you mean if (!GetAsDictionary) ?
dcheng
2016/05/24 20:39:02
Yes. =X
|
NOTREACHED(); |
continue; |
danakj
2016/05/24 20:08:34
ಠ_ಠ Should either DCHECK or continue not both. I s
dcheng
2016/05/24 20:39:02
Yeah, I think I'd rather not change the semantics
|
} |
- base::DictionaryValue* dict = static_cast<base::DictionaryValue*>(*it); |
std::string primary_pattern_str; |
dict->GetString(keys::kPrimaryPatternKey, &primary_pattern_str); |
ContentSettingsPattern primary_pattern = |