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

Unified Diff: chrome/browser/api/webdata/web_data_service_base.h

Issue 12897009: Autofill Webdata Split TRY ONLY (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Try again Created 7 years, 9 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
« no previous file with comments | « chrome/browser/api/webdata/autofill_web_data_service.h ('k') | chrome/browser/memory_purger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/api/webdata/web_data_service_base.h
diff --git a/chrome/browser/api/webdata/web_data_service_base.h b/chrome/browser/api/webdata/web_data_service_base.h
index 1c92550067234f8b2f2b59a31321e70c12e794da..22b00b8542f7a3b6e4cfdbc26e94709b3524eda7 100644
--- a/chrome/browser/api/webdata/web_data_service_base.h
+++ b/chrome/browser/api/webdata/web_data_service_base.h
@@ -16,6 +16,7 @@
class WebDatabase;
class WebDatabaseService;
+class WebDatabaseTable;
namespace base {
class Thread;
@@ -38,7 +39,14 @@ class WebDataServiceBase
// |callback| will only be invoked on error, and only if
// |callback.is_null()| evaluates to false.
- explicit WebDataServiceBase(const ProfileErrorCallback& callback);
+ //
+ // The ownership of |wdbs| is shared, with the primary owner being the
+ // WebDataServiceWrapper, and secondary owners being subclasses of
+ // WebDataServiceBase, which receive |wdbs| upon construction. The
+ // WebDataServiceWrapper handles the initializing and shutting down and of
+ // the |wdbs| object.
+ WebDataServiceBase(scoped_refptr<WebDatabaseService> wdbs,
+ const ProfileErrorCallback& callback);
// Cancel any pending request. You need to call this method if your
// WebDataServiceConsumer is about to be deleted.
@@ -52,8 +60,17 @@ class WebDataServiceBase
// call.
virtual void ShutdownOnUIThread();
+ // Adds the given table to the database. Passes ownership. Must be
+ // called for all tables before Init.
+ //
+ // TODO(joi): This method is duplicated a couple of layers deep;
+ // once we have a single object creating the WebDatabaseService as
+ // well as all the XyzWebDataService objects, we should be able to
+ // simplify.
+ void AddTable(scoped_ptr<WebDatabaseTable> table);
+
// Initializes the web data service.
- virtual void Init(const base::FilePath& path);
+ virtual void Init();
// Unloads the database without actually shutting down the service. This can
// be used to temporarily reduce the browser process' memory footprint.
@@ -82,7 +99,7 @@ class WebDataServiceBase
virtual void ShutdownOnDBThread();
// Our database service.
- scoped_ptr<WebDatabaseService> wdbs_;
+ scoped_refptr<WebDatabaseService> wdbs_;
// True if we've received a notification that the WebDatabase has loaded.
bool db_loaded_;
« no previous file with comments | « chrome/browser/api/webdata/autofill_web_data_service.h ('k') | chrome/browser/memory_purger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698