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

Unified Diff: chrome/browser/webdata/autofill_profile_syncable_service.cc

Issue 12695015: Split Autofill webdata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: chrome/browser/webdata/autofill_profile_syncable_service.cc
diff --git a/chrome/browser/webdata/autofill_profile_syncable_service.cc b/chrome/browser/webdata/autofill_profile_syncable_service.cc
index 967a793701ccb5bfb4f6bacfcd356e6b3bd9a070..628a7d053bbc68b3ad850b829dd773fab7a1bf0e 100644
--- a/chrome/browser/webdata/autofill_profile_syncable_service.cc
+++ b/chrome/browser/webdata/autofill_profile_syncable_service.cc
@@ -33,6 +33,11 @@ std::string LimitData(const std::string& data) {
return sanitized_value;
}
+void* UserDataKey() {
+ return reinterpret_cast<void*>(
+ &AutofillProfileSyncableService::CreateForWebDataService);
+}
+
} // namespace
const char kAutofillProfileTag[] = "google_chrome_autofill_profiles";
@@ -52,6 +57,21 @@ AutofillProfileSyncableService::~AutofillProfileSyncableService() {
DCHECK(CalledOnValidThread());
}
+// static
+void AutofillProfileSyncableService::CreateForWebDataService(
+ WebDataService* web_data) {
+ web_data->GetDBUserData()->SetUserData(
+ UserDataKey(), new AutofillProfileSyncableService(web_data));
+}
+
+// static
+AutofillProfileSyncableService*
+AutofillProfileSyncableService::FromWebDataService(
+ WebDataService* service) {
+ return static_cast<AutofillProfileSyncableService*>(
+ service->GetDBUserData()->GetUserData(UserDataKey()));
+}
+
AutofillProfileSyncableService::AutofillProfileSyncableService()
: web_data_service_(NULL) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));

Powered by Google App Engine
This is Rietveld 408576698