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 dcfa63595ab1368489acb613bd90e83b3ee5b496..b234260ca7c51becffabec5096f31544e656ea53 100644 |
--- a/components/autofill/browser/webdata/autofill_webdata_backend.h |
+++ b/components/autofill/browser/webdata/autofill_webdata_backend.h |
@@ -2,8 +2,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" |
@@ -12,6 +14,7 @@ |
namespace autofill { |
+class AutofillBackendDelegate; |
class AutofillChange; |
class AutofillProfile; |
class AutofillWebDataServiceObserverOnDBThread; |
@@ -55,6 +58,12 @@ class AutofillWebDataBackend |
void AddObserver(AutofillWebDataServiceObserverOnDBThread* 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, |
+ base::WeakPtr<WebDatabase> db); |
+ |
protected: |
virtual ~AutofillWebDataBackend(); |
@@ -73,6 +82,13 @@ class AutofillWebDataBackend |
ObserverList<AutofillWebDataServiceObserverOnDBThread> db_observer_list_; |
+ // All vended weak pointers are invalidated in dtor(). |
erikwright (departed)
2013/04/25 19:06:10
This comment is unnecessary (this is intrinsic in
|
+ base::WeakPtrFactory<AutofillWebDataBackend> weak_ptr_factory_; |
+ |
+ // Delegate which allows clients to do autofill work directly on th DB thread. |
+ // Owned by us. |
+ scoped_ptr<AutofillBackendDelegate> delegate_; |
erikwright (departed)
2013/04/25 19:06:10
Shouldn't the delegate be owned by whoever is usin
|
+ |
DISALLOW_COPY_AND_ASSIGN(AutofillWebDataBackend); |
}; |