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

Unified Diff: components/password_manager/core/browser/password_store.h

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: components/password_manager/core/browser/password_store.h
diff --git a/components/password_manager/core/browser/password_store.h b/components/password_manager/core/browser/password_store.h
index fb7d3bb25819c1b3939f1e46d83efc67543dc1e9..ef53b08e8830497e157a07e702081422b7239b0b 100644
--- a/components/password_manager/core/browser/password_store.h
+++ b/components/password_manager/core/browser/password_store.h
@@ -84,9 +84,7 @@ class PasswordStore : protected PasswordStoreSync,
// Forward the result to the consumer on the original message loop.
void ForwardResult();
- std::vector<autofill::PasswordForm*>* result() const {
- return result_.get();
- }
+ ScopedVector<autofill::PasswordForm>* result() { return &result_; }
private:
// See GetLogins(). Logins older than this will be removed from the reply.
@@ -98,7 +96,7 @@ class PasswordStore : protected PasswordStoreSync,
// thread and consumed on the UI thread.
// TODO(dubroy): Remove this, and instead pass the vector directly to the
vasilii 2015/02/03 19:22:17 Obsolete?
vabr (Chromium) 2015/02/04 16:13:44 I'm not sure, because I don't know what "this" in
// backend methods.
- scoped_ptr<std::vector<autofill::PasswordForm*>> result_;
+ ScopedVector<autofill::PasswordForm> result_;
base::ThreadChecker thread_checker_;
scoped_refptr<base::MessageLoopProxy> origin_loop_;
@@ -235,14 +233,15 @@ class PasswordStore : protected PasswordStoreSync,
const ConsumerCallbackRunner& callback_runner) = 0;
// Finds all non-blacklist PasswordForms, and notifies the consumer.
- virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) = 0;
+ virtual void GetAutofillableLoginsImpl(
+ scoped_ptr<GetLoginsRequest> request) = 0;
// Finds all blacklist PasswordForms, and notifies the consumer.
- virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) = 0;
+ virtual void GetBlacklistLoginsImpl(scoped_ptr<GetLoginsRequest> request) = 0;
// Dispatches the result to the PasswordStoreConsumer on the original caller's
// thread so the callback can be executed there. This should be the UI thread.
- static void ForwardLoginsResult(GetLoginsRequest* request);
+ static void ForwardLoginsResult(scoped_ptr<GetLoginsRequest> request);
// Log UMA stats for number of bulk deletions.
void LogStatsForBulkDeletion(int num_deletions);
@@ -291,7 +290,7 @@ class PasswordStore : protected PasswordStoreSync,
// |GetLoginsImpl| and |PasswordStoreConsumer|.
// TODO(dubroy): Get rid of this.
static void CopyAndForwardLoginsResult(
- PasswordStore::GetLoginsRequest* request,
+ scoped_ptr<PasswordStore::GetLoginsRequest> request,
ScopedVector<autofill::PasswordForm> matched_forms);
#if defined(PASSWORD_MANAGER_ENABLE_SYNC)

Powered by Google App Engine
This is Rietveld 408576698