Chromium Code Reviews| Index: components/password_manager/core/browser/password_store_consumer.h |
| diff --git a/components/password_manager/core/browser/password_store_consumer.h b/components/password_manager/core/browser/password_store_consumer.h |
| index c9237778f4f319c2116d7f9d8dde191d9fb571c5..778ebba33030c34df7cde2a48a6935f29b2f1c3e 100644 |
| --- a/components/password_manager/core/browser/password_store_consumer.h |
| +++ b/components/password_manager/core/browser/password_store_consumer.h |
| @@ -7,6 +7,7 @@ |
| #include <vector> |
| +#include "base/memory/scoped_vector.h" |
| #include "base/task/cancelable_task_tracker.h" |
| namespace autofill { |
| @@ -24,11 +25,9 @@ class PasswordStoreConsumer { |
| public: |
| PasswordStoreConsumer(); |
| - // Called when the request is finished. If there are no results, it is called |
| - // with an empty vector. |
| - // Note: The implementation owns all PasswordForms in the vector. |
| - virtual void OnGetPasswordStoreResults( |
| - const std::vector<autofill::PasswordForm*>& results) = 0; |
| + // Called when the request is finished. The associated results are accessible |
| + // through results(). |
| + virtual void OnGetPasswordStoreResults() = 0; |
|
vasilii
2015/02/03 19:22:17
This is my deepest concern in the CL. I didn't see
vabr (Chromium)
2015/02/04 16:13:44
Thanks for pointing that out. I agree, and I'm act
|
| // The base::CancelableTaskTracker can be used for cancelling the |
| // tasks associated with the consumer. |
| @@ -40,10 +39,13 @@ class PasswordStoreConsumer { |
| return weak_ptr_factory_.GetWeakPtr(); |
| } |
| + ScopedVector<autofill::PasswordForm>* results() { return &results_; } |
| + |
| protected: |
| virtual ~PasswordStoreConsumer(); |
| private: |
| + ScopedVector<autofill::PasswordForm> results_; |
| base::CancelableTaskTracker cancelable_task_tracker_; |
| base::WeakPtrFactory<PasswordStoreConsumer> weak_ptr_factory_; |
| }; |