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

Unified Diff: components/webdata/common/web_database_service.h

Issue 14081043: Hook up Autofill Backend interface to SyncableServices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/webdata/common/web_database_service.h
diff --git a/components/webdata/common/web_database_service.h b/components/webdata/common/web_database_service.h
index 1bdfca8504edc317b12d9360a1082f07262fc8f3..f8e7bf673b02cc396cbd56f4ec35dfa67237d2f2 100644
--- a/components/webdata/common/web_database_service.h
+++ b/components/webdata/common/web_database_service.h
@@ -51,6 +51,7 @@ class WEBDATA_EXPORT WebDatabaseService
public:
typedef base::Callback<scoped_ptr<WDTypedResult>(WebDatabase*)> ReadTask;
typedef base::Callback<WebDatabase::State(WebDatabase*)> WriteTask;
+ typedef base::Callback<void(base::WeakPtr<WebDatabase>)> DBCallback;
// Takes the path to the WebDatabase file.
explicit WebDatabaseService(const base::FilePath& path);
@@ -71,9 +72,10 @@ class WEBDATA_EXPORT WebDatabaseService
// Unloads database and will not reload.
virtual void ShutdownDatabase();
- // Gets a ptr to the WebDatabase (owned by WebDatabaseService).
- // TODO(caitkp): remove this method once SyncServices no longer depend on it.
- virtual WebDatabase* GetDatabaseOnDB() const;
+ // Asynchronously gets an instance of |WebDatabase|, which can be
+ // used to do work on the DB thread. This method is meant to be called from
+ // the UI thread, but the callback will be called on the DB thread.
+ void GetDatabaseOnDB(const DBCallback& callback);
// Schedule an update/write task on the DB thread.
virtual void ScheduleDBTask(

Powered by Google App Engine
This is Rietveld 408576698