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

Unified Diff: components/error_page/common/localized_error.cc

Issue 2336863003: Change more base::ListValue methods to use std::unique_ptr. (Closed)
Patch Set: . Created 4 years, 3 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/error_page/common/localized_error.cc
diff --git a/components/error_page/common/localized_error.cc b/components/error_page/common/localized_error.cc
index 1f6fffe697036b7980482d36903a7bcf79e7e76a..c8d21ccbe886b74001aaa31b70195e095317fb9d 100644
--- a/components/error_page/common/localized_error.cc
+++ b/components/error_page/common/localized_error.cc
@@ -505,12 +505,11 @@ void AddSingleEntryDictionaryToList(base::ListValue* list,
const char* path,
int message_id,
bool insert_as_first_item) {
- std::unique_ptr<base::DictionaryValue> suggestion_list_item(
- new base::DictionaryValue);
+ auto suggestion_list_item = base::MakeUnique<base::DictionaryValue>();
suggestion_list_item->SetString(path, l10n_util::GetStringUTF16(message_id));
if (insert_as_first_item) {
- list->Insert(0, suggestion_list_item.release());
+ list->Insert(0, std::move(suggestion_list_item));
} else {
list->Append(std::move(suggestion_list_item));
}

Powered by Google App Engine
This is Rietveld 408576698