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

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

Issue 825773003: PasswordStore: Use ScopedVector to express ownership of forms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use assignment instead of construction Created 5 years, 11 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/test_password_store.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/test_password_store.cc
diff --git a/components/password_manager/core/browser/test_password_store.cc b/components/password_manager/core/browser/test_password_store.cc
index ce361e5a89121bf1f93eab3ee1c1b29b763edb6b..678f7c7520e0faa1a5990e86165ffa3b2afe4c9e 100644
--- a/components/password_manager/core/browser/test_password_store.cc
+++ b/components/password_manager/core/browser/test_password_store.cc
@@ -98,14 +98,13 @@ void TestPasswordStore::GetLoginsImpl(
const autofill::PasswordForm& form,
PasswordStore::AuthorizationPromptPolicy prompt_policy,
const PasswordStore::ConsumerCallbackRunner& runner) {
- std::vector<autofill::PasswordForm*> matched_forms;
+ ScopedVector<autofill::PasswordForm> matched_forms;
std::vector<autofill::PasswordForm> forms =
stored_passwords_[form.signon_realm];
- for (std::vector<autofill::PasswordForm>::iterator it = forms.begin();
- it != forms.end(); ++it) {
- matched_forms.push_back(new autofill::PasswordForm(*it));
+ for (const auto& stored_form : forms) {
+ matched_forms.push_back(new autofill::PasswordForm(stored_form));
}
- runner.Run(matched_forms);
+ runner.Run(matched_forms.Pass());
}
PasswordStoreChangeList TestPasswordStore::RemoveLoginsCreatedBetweenImpl(
@@ -123,12 +122,12 @@ PasswordStoreChangeList TestPasswordStore::RemoveLoginsSyncedBetweenImpl(
}
bool TestPasswordStore::FillAutofillableLogins(
- std::vector<autofill::PasswordForm*>* forms) {
+ ScopedVector<autofill::PasswordForm>* forms) {
return true;
}
bool TestPasswordStore::FillBlacklistLogins(
- std::vector<autofill::PasswordForm*>* forms) {
+ ScopedVector<autofill::PasswordForm>* forms) {
return true;
}
« no previous file with comments | « components/password_manager/core/browser/test_password_store.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698