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

Unified Diff: chrome/browser/password_manager/password_store_default.h

Issue 118131: Change PasswordStoreDefault to access the WebDataService from the UI thread o... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 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_default.h
===================================================================
--- chrome/browser/password_manager/password_store_default.h (revision 17405)
+++ chrome/browser/password_manager/password_store_default.h (working copy)
@@ -25,8 +25,17 @@
public WebDataServiceConsumer {
public:
explicit PasswordStoreDefault(WebDataService* web_data_service);
- virtual ~PasswordStoreDefault() {}
+ virtual ~PasswordStoreDefault();
+ // Overridden to bypass the threading logic in PasswordStore, since
+ // WebDataService's API is not threadsafe.
+ virtual void AddLogin(const PasswordForm& form);
+ virtual void UpdateLogin(const PasswordForm& form);
+ virtual void RemoveLogin(const PasswordForm& form);
+ virtual int GetLogins(const PasswordForm& form,
+ PasswordStoreConsumer* consumer);
+ virtual void CancelLoginsQuery(int handle);
+
protected:
// Implements PasswordStore interface.
void AddLoginImpl(const PasswordForm& form);
@@ -35,32 +44,18 @@
void GetLoginsImpl(GetLoginsRequest* request);
// Called when a WebDataService method finishes.
- // Overrides must call RemovePendingWebDataServiceRequest.
virtual void OnWebDataServiceRequestDone(WebDataService::Handle h,
const WDTypedResult* result);
- // Keeps track of a pending WebDataService request, and the original
- // GetLogins request it is associated with.
- // Increases the reference count of |this|, so must be balanced with a
- // call to RemovePendingWebDataServiceRequest.
- void AddPendingWebDataServiceRequest(WebDataService::Handle handle,
- GetLoginsRequest* request);
- // Removes a WebDataService request from the list of pending requests,
- // and reduces the reference count of |this|.
- void RemovePendingWebDataServiceRequest(WebDataService::Handle handle);
- // Returns the GetLoginsRequest associated with |handle|.
- GetLoginsRequest* GetLoginsRequestForWebDataServiceRequest(
- WebDataService::Handle handle);
-
scoped_refptr<WebDataService> web_data_service_;
- private:
// Methods in this class call async WebDataService methods. This mapping
// remembers which WebDataService request corresponds to which PasswordStore
// request.
typedef std::map<WebDataService::Handle, GetLoginsRequest*> PendingRequestMap;
PendingRequestMap pending_requests_;
+ private:
DISALLOW_COPY_AND_ASSIGN(PasswordStoreDefault);
};
Property changes on: chrome\browser\password_manager\password_store_default.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698