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

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: More fixes 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
« no previous file with comments | « extensions/browser/api/system_network/system_network_apitest.cc ('k') | extensions/common/extension_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « extensions/browser/api/system_network/system_network_apitest.cc ('k') | extensions/common/extension_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698