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

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

Issue 6646051: Fix DCHECK, memory leak, and refactor PasswordStore to use CancelableRequest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try works all platforms now. Created 9 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
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 2945032fa79a399f3a69349ff6245e82799f59db..3c3e402b95b4144293cd57be9b7e2d56324d4479 100644
--- a/chrome/browser/password_manager/password_store_mac.cc
+++ b/chrome/browser/password_manager/password_store_mac.cc
@@ -886,17 +886,16 @@ void PasswordStoreMac::GetLoginsImpl(GetLoginsRequest* request,
std::vector<PasswordForm*> database_forms;
login_metadata_db_->GetLogins(form, &database_forms);
- std::vector<PasswordForm*> merged_forms;
internal_keychain_helpers::MergePasswordForms(&keychain_forms,
&database_forms,
- &merged_forms);
+ &request->value);
James Hawkins 2011/03/16 22:39:35 You use |request->value| three times in this metho
stuartmorgan 2011/03/16 23:25:20 Since you use this several times, maybe declare an
Sheridan Rawlins 2011/03/20 08:13:11 Done.
// Strip any blacklist entries out of the unused Keychain array, then take
// all the entries that are left (which we can use as imported passwords).
std::vector<PasswordForm*> keychain_blacklist_forms =
internal_keychain_helpers::ExtractBlacklistForms(&keychain_forms);
- merged_forms.insert(merged_forms.end(), keychain_forms.begin(),
- keychain_forms.end());
+ request->value.insert(request->value.end(), keychain_forms.begin(),
+ keychain_forms.end());
keychain_forms.clear();
STLDeleteElements(&keychain_blacklist_forms);
@@ -904,19 +903,17 @@ void PasswordStoreMac::GetLoginsImpl(GetLoginsRequest* request,
RemoveDatabaseForms(database_forms);
STLDeleteElements(&database_forms);
- NotifyConsumer(request, merged_forms);
+ ForwardLoginsResult(request);
}
void PasswordStoreMac::GetBlacklistLoginsImpl(GetLoginsRequest* request) {
- std::vector<PasswordForm*> database_forms;
- FillBlacklistLogins(&database_forms);
- NotifyConsumer(request, database_forms);
+ FillBlacklistLogins(&request->value);
+ ForwardLoginsResult(request);
}
void PasswordStoreMac::GetAutofillableLoginsImpl(GetLoginsRequest* request) {
- std::vector<PasswordForm*> database_forms;
- FillAutofillableLogins(&database_forms);
- NotifyConsumer(request, database_forms);
+ FillAutofillableLogins(&request->value);
+ ForwardLoginsResult(request);
}
bool PasswordStoreMac::FillAutofillableLogins(

Powered by Google App Engine
This is Rietveld 408576698