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 5fad2ae20e1fbb20bbd5770af9e9a52b7d41ee8d..3abc45ff7c8b1377d3458ec4ac4fdbec5d755709 100644 |
--- a/chrome/browser/password_manager/password_store_mac.cc |
+++ b/chrome/browser/password_manager/password_store_mac.cc |
@@ -618,19 +618,19 @@ std::vector<PasswordForm*> MacKeychainPasswordFormAdapter::PasswordsFillingForm( |
return ConvertKeychainItemsToForms(&keychain_items); |
} |
-PasswordForm* MacKeychainPasswordFormAdapter::PasswordExactlyMatchingForm( |
- const PasswordForm& query_form) { |
+scoped_ptr<PasswordForm> MacKeychainPasswordFormAdapter:: |
+ PasswordExactlyMatchingForm(const PasswordForm& query_form) { |
SecKeychainItemRef keychain_item = KeychainItemForForm(query_form); |
if (keychain_item) { |
- PasswordForm* form = new PasswordForm(); |
+ scoped_ptr<PasswordForm> form(new PasswordForm); |
internal_keychain_helpers::FillPasswordFormFromKeychainItem(*keychain_, |
keychain_item, |
- form, |
+ form.get(), |
true); |
keychain_->Free(keychain_item); |
- return form; |
+ return form.Pass(); |
} |
- return NULL; |
+ return scoped_ptr<PasswordForm>(); |
} |
bool MacKeychainPasswordFormAdapter::HasPasswordsMergeableWithForm( |
@@ -942,9 +942,7 @@ PasswordStoreChangeList PasswordStoreMac::RemoveLoginImpl( |
// handle deletes on them the way we would for an imported item.) |
MacKeychainPasswordFormAdapter owned_keychain_adapter(keychain_.get()); |
owned_keychain_adapter.SetFindsOnlyOwnedItems(true); |
- PasswordForm* owned_password_form = |
- owned_keychain_adapter.PasswordExactlyMatchingForm(form); |
- if (owned_password_form) { |
+ if (owned_keychain_adapter.PasswordExactlyMatchingForm(form)) { |
Ilya Sherman
2014/08/12 00:31:51
Hmm, could the method be changed to instead just r
vasilii
2014/08/12 09:17:37
The returned value is used in unit tests. With boo
Ilya Sherman
2014/08/12 17:21:25
Hmm, why do the tests need more information that t
vasilii
2014/08/13 09:56:46
Done.
|
// If we don't have other forms using it (i.e., a form differing only by |
// the names of the form elements), delete the keychain entry. |
if (!DatabaseHasFormMatchingKeychainForm(form)) { |