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

Unified Diff: components/ntp_snippets/ntp_snippet.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
Index: components/ntp_snippets/ntp_snippet.cc
diff --git a/components/ntp_snippets/ntp_snippet.cc b/components/ntp_snippets/ntp_snippet.cc
index d74274b658f54b1a8b4509de3aaaf33d7e3f59df..037fe51b2c11abc029ec88884aa1c92b4d133224 100644
--- a/components/ntp_snippets/ntp_snippet.cc
+++ b/components/ntp_snippets/ntp_snippet.cc
@@ -71,7 +71,7 @@ std::unique_ptr<NTPSnippet> NTPSnippet::CreateFromDictionary(
return nullptr;
}
- for (base::Value* value : *corpus_infos_list) {
+ for (const auto& value : *corpus_infos_list) {
const base::DictionaryValue* dict_value = nullptr;
if (!value->GetAsDictionary(&dict_value)) {
DLOG(WARNING) << "Invalid source info for article " << id;
@@ -149,7 +149,7 @@ std::unique_ptr<NTPSnippet> NTPSnippet::CreateFromDictionary(
// static
bool NTPSnippet::AddFromListValue(const base::ListValue& list,
PtrVector* snippets) {
- for (const base::Value* const value : list) {
+ for (const auto& value : list) {
const base::DictionaryValue* dict = nullptr;
if (!value->GetAsDictionary(&dict))
return false;

Powered by Google App Engine
This is Rietveld 408576698