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

Unified Diff: components/autofill/browser/webdata/autofill_webdata_service.h

Issue 14679005: Create an AutofillBackend interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments pt 1 Created 7 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: components/autofill/browser/webdata/autofill_webdata_service.h
diff --git a/components/autofill/browser/webdata/autofill_webdata_service.h b/components/autofill/browser/webdata/autofill_webdata_service.h
index 87b967ca94bb2283270198968fe60b21399cfbf4..a31bb8e6747b952ff1fa511000cebfb55dd5ec9f 100644
--- a/components/autofill/browser/webdata/autofill_webdata_service.h
+++ b/components/autofill/browser/webdata/autofill_webdata_service.h
@@ -8,6 +8,7 @@
#include <vector>
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/supports_user_data.h"
#include "components/autofill/browser/webdata/autofill_webdata.h"
@@ -31,6 +32,7 @@ class AutofillWebDataBackend;
class AutofillWebDataServiceObserverOnDBThread;
class AutofillWebDataServiceObserverOnUIThread;
class CreditCard;
+class SyncableServiceBackend;
// API for Autofill web data.
class AutofillWebDataService : public AutofillWebData,
@@ -96,11 +98,21 @@ class AutofillWebDataService : public AutofillWebData,
// |ShutdownOnUIThread()| is called.
base::SupportsUserData* GetDBUserData();
+ // Takes a callback which will be called on the DBThread with a pointer to a
Ilya Sherman 2013/05/08 00:39:06 nit: "DBThread" -> "DB thread"; ditto below.
Cait (Slow) 2013/05/08 19:16:01 Done.
+ // |SyncableServiceBackend|. This backend can be used to access or update the
+ // WebDatabase directly on the DBThread.
+ void GetSyncableBackend(
+ const base::Callback<void(SyncableServiceBackend*)>& callback);
Ilya Sherman 2013/05/08 00:39:06 Should this be returned as a scoped_refptr? What'
Cait (Slow) 2013/05/08 19:16:01 Both the backend and the syncable services are own
+
protected:
virtual ~AutofillWebDataService();
virtual void ShutdownOnDBThread();
+ // This factory is used on the UIThread. All vended weak pointers are
Ilya Sherman 2013/05/08 00:39:06 nit: "UIThread" -> "UI thread"
Cait (Slow) 2013/05/08 19:16:01 Done.
+ // invalidated in ShutdownOnUIThread().
+ base::WeakPtrFactory<AutofillWebDataService> weak_ptr_factory_;
Ilya Sherman 2013/05/08 00:39:06 nit: Member variables should always have private v
Cait (Slow) 2013/05/08 19:16:01 Done.
+
private:
// This makes the destructor public, and thus allows us to aggregate
// SupportsUserData. It is private by default to prevent incorrect

Powered by Google App Engine
This is Rietveld 408576698