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

Unified Diff: chrome/browser/password_manager/password_store_mac.cc

Issue 283563002: Password Login Database: report correct changes from AddLogin(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed PasswordSyncableServiceTest.PasswordStoreChanges Created 6 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: chrome/browser/password_manager/password_store_mac.cc
diff --git a/chrome/browser/password_manager/password_store_mac.cc b/chrome/browser/password_manager/password_store_mac.cc
index 9cf6bd6107dc1ff48810bc19cd28bbdd4861b1cf..71be693c6ac2473cd80bacf82682ed403950810f 100644
--- a/chrome/browser/password_manager/password_store_mac.cc
+++ b/chrome/browser/password_manager/password_store_mac.cc
@@ -877,9 +877,7 @@ PasswordStoreChangeList PasswordStoreMac::AddLoginImpl(
DCHECK(thread_->message_loop() == base::MessageLoop::current());
PasswordStoreChangeList changes;
if (AddToKeychainIfNecessary(form)) {
- if (login_metadata_db_->AddLogin(form)) {
- changes.push_back(PasswordStoreChange(PasswordStoreChange::ADD, form));
- }
+ changes = login_metadata_db_->AddLogin(form);
}
return changes;
}
@@ -903,15 +901,10 @@ PasswordStoreChangeList PasswordStoreMac::UpdateLoginImpl(
// The keychain add will update if there is a collision and add if there
// isn't, which is the behavior we want, so there's no separate update call.
if (AddToKeychainIfNecessary(form)) {
- if (update_count == 0) {
- if (login_metadata_db_->AddLogin(form)) {
- changes.push_back(PasswordStoreChange(PasswordStoreChange::ADD,
- form));
- }
- } else {
- changes.push_back(PasswordStoreChange(PasswordStoreChange::UPDATE,
- form));
- }
+ if (update_count == 0)
+ changes = login_metadata_db_->AddLogin(form);
+ else
+ changes.push_back(PasswordStoreChange(PasswordStoreChange::UPDATE, form));
}
return changes;
}

Powered by Google App Engine
This is Rietveld 408576698