| 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(
|
|
|