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

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

Issue 14679005: Create an AutofillBackend interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up 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_backend.h
diff --git a/components/autofill/browser/webdata/autofill_webdata_backend.h b/components/autofill/browser/webdata/autofill_webdata_backend.h
index b1ab6d63b089552b6c7f2106f0384181589e0374..bd77576198acee77a0e177f76c4b019654149a50 100644
--- a/components/autofill/browser/webdata/autofill_webdata_backend.h
+++ b/components/autofill/browser/webdata/autofill_webdata_backend.h
@@ -6,8 +6,10 @@
#define COMPONENTS_AUTOFILL_BROWSER_WEBDATA_AUTOFILL_WEBDATA_BACKEND_H_
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "components/autofill/browser/webdata/autofill_webdata.h"
+#include "components/autofill/browser/webdata/autofill_webdata_service.h"
#include "components/autofill/common/form_field_data.h"
#include "components/webdata/common/web_data_results.h"
#include "components/webdata/common/web_data_service_base.h"
@@ -20,6 +22,7 @@ class AutofillChange;
class AutofillProfile;
class AutofillWebDataServiceObserverOnDBThread;
class CreditCard;
+class SyncableAutofillDelegate;
// Backend implentation for the AutofillWebDataService. This class runs on the
// DB thread, as it handles reads and writes to the WebDatabase, and functions
@@ -101,6 +104,13 @@ class AutofillWebDataBackend
// Remove an observer.
void RemoveObserver(AutofillWebDataServiceObserverOnDBThread* observer);
+ // Initializes |delegate_| if it has not already been initialized, and returns
+ // a ptr to it asynchonously via |callback|.
+ void GetDelegate(
+ const AutofillWebDataService::DelegateOnDBCallback& callback,
+ const base::Closure& on_changed_callback,
Ilya Sherman 2013/05/07 00:02:43 nit: Docs for this param
+ WebDatabase* db);
+
protected:
virtual ~AutofillWebDataBackend();
@@ -120,6 +130,10 @@ class AutofillWebDataBackend
ObserverList<AutofillWebDataServiceObserverOnDBThread> db_observer_list_;
+ // Delegate which allows clients to do autofill work directly on th DB thread.
+ // Owned by us.
+ scoped_ptr<SyncableAutofillDelegate> delegate_;
+
DISALLOW_COPY_AND_ASSIGN(AutofillWebDataBackend);
};

Powered by Google App Engine
This is Rietveld 408576698