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

Unified Diff: chrome/browser/ui/passwords/password_manager_presenter.cc

Issue 866983003: GetLoginsRequest: Use ScopedVector to express ownership of forms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@324291_scopedvector
Patch Set: Fix Mac unittest Created 5 years, 10 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/ui/passwords/password_manager_presenter.cc
diff --git a/chrome/browser/ui/passwords/password_manager_presenter.cc b/chrome/browser/ui/passwords/password_manager_presenter.cc
index 1e7c1d041e4629e35e0c473e2cbe9133e6865f47..f74241d85f54381fc0f494a6fa5e20e09f46f1aa 100644
--- a/chrome/browser/ui/passwords/password_manager_presenter.cc
+++ b/chrome/browser/ui/passwords/password_manager_presenter.cc
@@ -212,10 +212,8 @@ void PasswordManagerPresenter::PasswordListPopulater::Populate() {
}
void PasswordManagerPresenter::PasswordListPopulater::OnGetPasswordStoreResults(
- const std::vector<autofill::PasswordForm*>& results) {
- page_->password_list_.clear();
- page_->password_list_.insert(page_->password_list_.end(),
- results.begin(), results.end());
+ ScopedVector<autofill::PasswordForm> results) {
+ page_->password_list_.swap(results);
page_->SetPasswordList();
}
@@ -235,10 +233,7 @@ void PasswordManagerPresenter::PasswordExceptionListPopulater::Populate() {
}
void PasswordManagerPresenter::PasswordExceptionListPopulater::
- OnGetPasswordStoreResults(
- const std::vector<autofill::PasswordForm*>& results) {
- page_->password_exception_list_.clear();
- page_->password_exception_list_.insert(page_->password_exception_list_.end(),
- results.begin(), results.end());
+ OnGetPasswordStoreResults(ScopedVector<autofill::PasswordForm> results) {
+ page_->password_exception_list_.swap(results);
page_->SetPasswordExceptionList();
}

Powered by Google App Engine
This is Rietveld 408576698