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

Unified Diff: chrome/browser/webdata/web_data_service.h

Issue 8184001: The AutofillProfileSyncableService's lifetime should be managed by the WebDataService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 2 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: 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 98c5d0a567adb688e779b436feac5e21ce7ba797..94b3ecb1eb7cce832ab1e17a09a113142979e287 100644
--- a/chrome/browser/webdata/web_data_service.h
+++ b/chrome/browser/webdata/web_data_service.h
@@ -20,6 +20,7 @@
class AutofillChange;
class AutofillProfile;
+class AutofillProfileSyncableService;
class CreditCard;
class GURL;
#if defined(OS_WIN)
@@ -512,6 +513,12 @@ class WebDataService
const base::Time& delete_begin,
const base::Time& delete_end);
+ // TODO(georgey): Add support for autocomplete as well: http://crbug.com/95759
+ // Returns the syncable service for Autofill addresses and credit cards stored
+ // in this table.
akalin 2011/10/11 21:24:38 Add comment saying that the returned APSS is owned
Ilya Sherman 2011/10/11 22:17:34 Done.
+ virtual AutofillProfileSyncableService*
+ GetAutofillProfileSyncableService() const;
+
// Testing
#ifdef UNIT_TEST
void set_failed_init(bool value) { failed_init_ = value; }
@@ -553,12 +560,18 @@ class WebDataService
// Initialize the database, if it hasn't already been initialized.
void InitializeDatabaseIfNecessary();
+ // Initialize any syncable services.
+ void InitializeSyncableServices();
+
// The notification method.
void NotifyDatabaseLoadedOnUIThread();
// Commit any pending transaction and deletes the database.
void ShutdownDatabase();
+ // Deletes the syncable services.
+ void ShutdownSyncableServices();
+
// Commit the current transaction and creates a new one.
void Commit();
@@ -664,9 +677,17 @@ class WebDataService
// The path with which to initialize the database.
FilePath path_;
- // Our database.
+ // Our database. We own the |db_|, but don't use a |scoped_ptr| because the
+ // |db_| lifetime must be managed on the database thread.
WebDatabase* db_;
+ // 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.
+ // Currently only Autofill profiles (and credit cards) use the new Sync API,
+ // but all the database data should migrate to this API over time.
+ AutofillProfileSyncableService* autofill_profile_syncable_service_;
+
// Whether the database failed to initialize. We use this to avoid
// continually trying to reinit.
bool failed_init_;

Powered by Google App Engine
This is Rietveld 408576698