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

Unified Diff: components/autofill/core/browser/webdata/autofill_wallet_metadata_syncable_service.cc

Issue 2403773002: Remove stl_util's STLDeleteContainerPointers from autofill. (Closed)
Patch Set: rebase Created 4 years, 2 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/autofill/core/browser/webdata/autofill_wallet_metadata_syncable_service.cc
diff --git a/components/autofill/core/browser/webdata/autofill_wallet_metadata_syncable_service.cc b/components/autofill/core/browser/webdata/autofill_wallet_metadata_syncable_service.cc
index 738da1fb94d326c3680543aa5b6783b7d48d5bb0..9c420ce57df1e4c23dc24245117d61330eac4ba9 100644
--- a/components/autofill/core/browser/webdata/autofill_wallet_metadata_syncable_service.cc
+++ b/components/autofill/core/browser/webdata/autofill_wallet_metadata_syncable_service.cc
@@ -403,23 +403,23 @@ bool AutofillWalletMetadataSyncableService::GetLocalData(
profiles,
base::ScopedPtrHashMap<std::string, std::unique_ptr<CreditCard>>* cards)
const {
- ScopedVector<AutofillProfile> profile_list;
+ std::vector<std::unique_ptr<AutofillProfile>> profile_list;
bool success =
AutofillTable::FromWebDatabase(web_data_backend_->GetDatabase())
- ->GetServerProfiles(&profile_list.get());
+ ->GetServerProfiles(&profile_list);
while (!profile_list.empty()) {
profiles->add(GetServerId(*profile_list.front()),
- base::WrapUnique(profile_list.front()));
- profile_list.weak_erase(profile_list.begin());
+ std::move(profile_list.front()));
+ profile_list.erase(profile_list.begin());
}
- ScopedVector<CreditCard> card_list;
+ std::vector<std::unique_ptr<CreditCard>> card_list;
success &= AutofillTable::FromWebDatabase(web_data_backend_->GetDatabase())
- ->GetServerCreditCards(&card_list.get());
+ ->GetServerCreditCards(&card_list);
while (!card_list.empty()) {
- cards->add(GetServerId(*card_list.front()),
- base::WrapUnique(card_list.front()));
- card_list.weak_erase(card_list.begin());
+ auto server_id = GetServerId(*card_list.front());
+ cards->add(server_id, std::move(card_list.front()));
+ card_list.erase(card_list.begin());
}
return success;

Powered by Google App Engine
This is Rietveld 408576698