Index: chrome/browser/webdata/web_data_service.h |
diff --git a/chrome/browser/webdata/web_data_service.h b/chrome/browser/webdata/web_data_service.h |
index f66d9dc14c9019f69ed038d546e49f09c1296e1b..9eabe679c15f6e97358207e1307e9138ff9c2008 100644 |
--- a/chrome/browser/webdata/web_data_service.h |
+++ b/chrome/browser/webdata/web_data_service.h |
@@ -23,14 +23,10 @@ |
#include "chrome/browser/api/webdata/web_data_results.h" |
#include "chrome/browser/api/webdata/web_data_service_base.h" |
#include "chrome/browser/api/webdata/web_data_service_consumer.h" |
-#include "chrome/browser/profiles/refcounted_profile_keyed_service.h" |
#include "chrome/browser/search_engines/template_url.h" |
#include "chrome/browser/search_engines/template_url_id.h" |
#include "chrome/browser/webdata/keyword_table.h" |
-#include "chrome/browser/webdata/web_data_request_manager.h" |
#include "chrome/browser/webdata/web_database.h" |
-#include "content/public/browser/browser_thread.h" |
-#include "sql/init_status.h" |
class AutocompleteSyncableService; |
class AutofillChange; |
@@ -105,18 +101,17 @@ class WebDataServiceConsumer; |
class WebDataService |
: public WebDataServiceBase, |
- public AutofillWebData, |
- public RefcountedProfileKeyedService { |
+ public AutofillWebData { |
public: |
// Retrieve a WebDataService for the given context. |
static scoped_refptr<WebDataService> FromBrowserContext( |
content::BrowserContext* context); |
- WebDataService(); |
+ explicit WebDataService(const ProfileErrorCallback& callback); |
// WebDataServiceBase implementation. |
- virtual void CancelRequest(Handle h) OVERRIDE; |
- virtual content::NotificationSource GetNotificationSource() OVERRIDE; |
+ virtual void ShutdownOnUIThread() OVERRIDE; |
+ virtual void Init(const base::FilePath& path) OVERRIDE; |
// Notifies listeners on the UI thread that multiple changes have been made to |
// to Autofill records of the database. |
@@ -125,29 +120,7 @@ class WebDataService |
// |web_data_service| may be NULL for testing purposes. |
static void NotifyOfMultipleAutofillChanges(WebDataService* web_data_service); |
- // RefcountedProfileKeyedService override: |
- // Shutdown the web data service. The service can no longer be used after this |
- // call. |
- virtual void ShutdownOnUIThread() OVERRIDE; |
- |
- // Initializes the web data service. |
- void Init(const base::FilePath& path); |
- |
- // Unloads the database without actually shutting down the service. This can |
- // be used to temporarily reduce the browser process' memory footprint. |
- void UnloadDatabase(); |
- |
- // Unloads the database permanently and shuts down service. |
- void ShutdownDatabase(); |
- |
- // Returns true if the database load has completetd successfully, and |
- // ShutdownOnUIThread has not yet been called. |
- virtual bool IsDatabaseLoaded(); |
- // Returns a pointer to the DB (used by SyncableServices). May return NULL if |
- // the database is not loaded or otherwise unavailable. Must be called on |
- // DBThread. |
- virtual WebDatabase* GetDatabase(); |
////////////////////////////////////////////////////////////////////////////// |
// |
@@ -327,11 +300,15 @@ class WebDataService |
GetAutocompleteSyncableService() const; |
protected: |
+ // TODO(caitkp): We probably don't need these anymore. |
friend class TemplateURLServiceTest; |
friend class TemplateURLServiceTestingProfile; |
friend class WebDataServiceTest; |
friend class WebDataRequest; |
+ // For unit tests, passes a null callback. |
+ WebDataService(); |
+ |
virtual ~WebDataService(); |
////////////////////////////////////////////////////////////////////////////// |
@@ -340,20 +317,12 @@ class WebDataService |
// |
////////////////////////////////////////////////////////////////////////////// |
private: |
- friend struct content::BrowserThread::DeleteOnThread< |
- content::BrowserThread::UI>; |
- friend class base::DeleteHelper<WebDataService>; |
- |
// Initialize any syncable services. |
void InitializeSyncableServices(); |
// Deletes the syncable services. |
void ShutdownSyncableServices(); |
- void DBInitFailed(sql::InitStatus sql_status); |
- void NotifyDatabaseLoadedOnUIThread(); |
- void DatabaseInitOnDB(sql::InitStatus status); |
- |
////////////////////////////////////////////////////////////////////////////// |
// |
// Keywords. |
@@ -472,12 +441,6 @@ class WebDataService |
void DestroyAutofillProfileResult(const WDTypedResult* result); |
void DestroyAutofillCreditCardResult(const WDTypedResult* result); |
- // Our database service. |
- scoped_ptr<WebDatabaseService> wdbs_; |
- |
- // True if we've received a notification that the WebDatabase has loaded. |
- bool db_loaded_; |
- |
// Syncable services for the database data. We own the services, but don't |
// use |scoped_ptr|s because the lifetimes must be managed on the database |
// thread. |