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

Unified Diff: components/password_manager/core/browser/password_syncable_service.cc

Issue 906973007: PasswordStore: Clean up expectations about rewriting vectors of forms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just rebased Created 5 years, 9 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 | « components/password_manager/core/browser/password_store_sync.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/core/browser/password_syncable_service.cc
diff --git a/components/password_manager/core/browser/password_syncable_service.cc b/components/password_manager/core/browser/password_syncable_service.cc
index b036b50605ed882a757f1d4f770b66656d3681b0..870aecbbfd453f65e0477fbaedd9aa2bd34644c4 100644
--- a/components/password_manager/core/browser/password_syncable_service.cc
+++ b/components/password_manager/core/browser/password_syncable_service.cc
@@ -303,8 +303,9 @@ bool PasswordSyncableService::ReadFromPasswordStore(
ScopedVector<autofill::PasswordForm>* password_entries,
PasswordEntryMap* passwords_entry_map) const {
DCHECK(password_entries);
+ ScopedVector<autofill::PasswordForm> blacklist_entries;
if (!password_store_->FillAutofillableLogins(password_entries) ||
- !password_store_->FillBlacklistLogins(password_entries)) {
+ !password_store_->FillBlacklistLogins(&blacklist_entries)) {
// Password store often fails to load passwords. Track failures with UMA.
// (http://crbug.com/249000)
UMA_HISTOGRAM_ENUMERATION("Sync.LocalDataFailedToLoad",
@@ -312,6 +313,12 @@ bool PasswordSyncableService::ReadFromPasswordStore(
syncer::MODEL_TYPE_COUNT);
return false;
}
+ // Move |blacklist_entries| to |password_entries|.
+ password_entries->reserve(password_entries->size() +
+ blacklist_entries.size());
+ password_entries->insert(password_entries->end(), blacklist_entries.begin(),
+ blacklist_entries.end());
+ blacklist_entries.weak_clear();
if (!passwords_entry_map)
return true;
« no previous file with comments | « components/password_manager/core/browser/password_store_sync.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698