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

Side by Side Diff: chrome/browser/password_manager/password_store_consumer.h

Issue 6646051: Fix DCHECK, memory leak, and refactor PasswordStore to use CancelableRequest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use non-zero tests until http://crbug.com/77650 is addressed. Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_CONSUMER_H_
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_CONSUMER_H_
7 #pragma once
8
9 #include "content/browser/cancelable_request.h"
10
11 namespace webkit_glue {
12 struct PasswordForm;
13 };
14
15 // Reads from the PasswordStore are done asynchrously on a separate
16 // thread. PasswordStoreConsumer provides the virtual callback method, which is
17 // guaranteed to be executed on this (the UI) thread. It also provides the
18 // CancelableRequestConsumer member, which cancels any outstanding requests upon
19 // destruction.
20 class PasswordStoreConsumer {
21 public:
22 // Call this when the request is finished. If there are no results, call it
23 // anyway with an empty vector.
24 virtual void OnPasswordStoreRequestDone(
25 CancelableRequestProvider::Handle handle,
26 const std::vector<webkit_glue::PasswordForm*>& result) = 0;
27
28 // The CancelableRequest framework needs both a callback (the
29 // PasswordStoreConsumer::OnPasswordStoreRequestDone) as well as a
30 // CancelableRequestConsumer. This accessor makes the API simpler for callers
31 // as PasswordStore can get both from the PasswordStoreConsumer.
32 CancelableRequestConsumerBase* cancelable_consumer() {
33 return &cancelable_consumer_;
34 }
35
36 protected:
37 virtual ~PasswordStoreConsumer();
38
39 private:
40 CancelableRequestConsumer cancelable_consumer_;
41 };
42
43 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_CONSUMER_H_
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/password_store.cc ('k') | chrome/browser/password_manager/password_store_consumer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698