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

Unified Diff: chrome/browser/password_manager/password_store_x.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: Rebased 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
Index: chrome/browser/password_manager/password_store_x.cc
diff --git a/chrome/browser/password_manager/password_store_x.cc b/chrome/browser/password_manager/password_store_x.cc
index fa5c7b03516566ea274e52956d630697ca1e4c06..b1cbc9cb06fd3609f332426088c4eedbb7ffb436 100644
--- a/chrome/browser/password_manager/password_store_x.cc
+++ b/chrome/browser/password_manager/password_store_x.cc
@@ -157,39 +157,41 @@ void PasswordStoreX::GetLoginsImpl(
callback_runner.Run(matched_forms.Pass());
}
-void PasswordStoreX::GetAutofillableLoginsImpl(GetLoginsRequest* request) {
+void PasswordStoreX::GetAutofillableLoginsImpl(
+ scoped_ptr<PasswordStore::GetLoginsRequest> request) {
CheckMigration();
ScopedVector<autofill::PasswordForm> obtained_forms;
if (use_native_backend() &&
backend_->GetAutofillableLogins(&obtained_forms)) {
request->result()->swap(obtained_forms.get());
vasilii 2015/02/03 19:22:16 It's better to do whatever we want with |obtained_
vabr (Chromium) 2015/02/04 16:13:44 I share that sentiment. :) Done.
- SortLoginsByOrigin(request->result());
+ SortLoginsByOrigin(&request->result()->get());
// See GetLoginsImpl() for why we disallow fallback conditionally here.
if (request->result()->size() > 0)
allow_fallback_ = false;
} else if (allow_default_store()) {
- PasswordStoreDefault::GetAutofillableLoginsImpl(request);
+ PasswordStoreDefault::GetAutofillableLoginsImpl(request.Pass());
return;
}
// The consumer will be left hanging unless we reply.
- ForwardLoginsResult(request);
+ ForwardLoginsResult(request.Pass());
}
-void PasswordStoreX::GetBlacklistLoginsImpl(GetLoginsRequest* request) {
+void PasswordStoreX::GetBlacklistLoginsImpl(
+ scoped_ptr<PasswordStore::GetLoginsRequest> request) {
CheckMigration();
ScopedVector<autofill::PasswordForm> obtained_forms;
if (use_native_backend() && backend_->GetBlacklistLogins(&obtained_forms)) {
request->result()->swap(obtained_forms.get());
- SortLoginsByOrigin(request->result());
+ SortLoginsByOrigin(&request->result()->get());
vasilii 2015/02/03 19:22:16 See above.
vabr (Chromium) 2015/02/04 16:13:44 Done.
// See GetLoginsImpl() for why we disallow fallback conditionally here.
if (request->result()->size() > 0)
allow_fallback_ = false;
} else if (allow_default_store()) {
- PasswordStoreDefault::GetBlacklistLoginsImpl(request);
+ PasswordStoreDefault::GetBlacklistLoginsImpl(request.Pass());
return;
}
// The consumer will be left hanging unless we reply.
- ForwardLoginsResult(request);
+ ForwardLoginsResult(request.Pass());
}
bool PasswordStoreX::FillAutofillableLogins(

Powered by Google App Engine
This is Rietveld 408576698