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

Unified Diff: extensions/browser/verified_contents.cc

Issue 2000803003: Use std::unique_ptr for base::DictionaryValue and base::ListValue's internal store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix various builds. Created 4 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: extensions/browser/verified_contents.cc
diff --git a/extensions/browser/verified_contents.cc b/extensions/browser/verified_contents.cc
index 6abca5ee7b94273af956782eb2599e82ec24af04..9fdae10b9e59587d5f28cb70b3453f965c3444fa 100644
--- a/extensions/browser/verified_contents.cc
+++ b/extensions/browser/verified_contents.cc
@@ -46,10 +46,10 @@ const char kWebstoreKId[] = "webstore";
DictionaryValue* FindDictionaryWithValue(const ListValue* list,
std::string key,
std::string value) {
- for (ListValue::const_iterator i = list->begin(); i != list->end(); ++i) {
- if (!(*i)->IsType(Value::TYPE_DICTIONARY))
+ for (const auto& i : *list) {
+ DictionaryValue* dictionary;
+ if (!i->GetAsDictionary(&dictionary))
continue;
- DictionaryValue* dictionary = static_cast<DictionaryValue*>(*i);
std::string found_value;
if (dictionary->GetString(key, &found_value) && found_value == value)
return dictionary;

Powered by Google App Engine
This is Rietveld 408576698