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

Unified Diff: chrome/browser/ui/webui/options/autofill_options_handler.cc

Issue 2051663003: base::ListValue::Append cleanup: pass unique_ptr instead of the released pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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: chrome/browser/ui/webui/options/autofill_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/autofill_options_handler.cc b/chrome/browser/ui/webui/options/autofill_options_handler.cc
index 1d276e6e28a2ec7abd156380c899297094e43196..ff0b3a506e1bdb0239e1fb87377b181ddd4bfd31 100644
--- a/chrome/browser/ui/webui/options/autofill_options_handler.cc
+++ b/chrome/browser/ui/webui/options/autofill_options_handler.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <utility>
#include <vector>
#include "base/bind.h"
@@ -159,7 +160,7 @@ void GetAddressComponents(const std::string& country_code,
break;
}
- line->Append(component.release());
+ line->Append(std::move(component));
}
}
@@ -181,7 +182,7 @@ void SetCountryData(const PersonalDataManager& manager,
option_details->SetString(
"value",
countries[i] ? countries[i]->country_code() : "separator");
- country_list->Append(option_details.release());
+ country_list->Append(std::move(option_details));
}
localized_strings->Set("autofillCountrySelectList", country_list.release());
@@ -352,7 +353,7 @@ void AutofillOptionsHandler::LoadAutofillData() {
value->SetString("sublabel", labels[i].substr(label_parts[0].size()));
value->SetBoolean("isLocal", profiles[i]->record_type() ==
AutofillProfile::LOCAL_PROFILE);
- addresses.Append(value.release());
+ addresses.Append(std::move(value));
}
web_ui()->CallJavascriptFunctionUnsafe("AutofillOptions.setAddressList",
@@ -361,7 +362,7 @@ void AutofillOptionsHandler::LoadAutofillData() {
base::ListValue credit_cards;
const std::vector<CreditCard*>& cards = personal_data_->GetCreditCards();
for (const CreditCard* card : cards) {
- credit_cards.Append(CreditCardToDictionary(*card).release());
+ credit_cards.Append(CreditCardToDictionary(*card));
}
web_ui()->CallJavascriptFunctionUnsafe("AutofillOptions.setCreditCardList",

Powered by Google App Engine
This is Rietveld 408576698