Chromium Code Reviews| 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 980ca80777024864aac2a495c4c06dd88a39bff7..38ffcd5c9e7349f73d3c51908e44855112a6b23c 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) { |
|
Cait (Slow)
2013/03/19 19:49:46
It seems like the syncable services should be hung
Cait (Slow)
2013/03/19 20:24:24
Just saw your TODOs on this -- I'll work on conver
|
| + 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)); |