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

Unified Diff: components/autofill/browser/webdata/autofill_webdata_backend_impl.cc

Issue 14081043: Hook up Autofill Backend interface to SyncableServices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge Created 7 years, 7 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: components/autofill/browser/webdata/autofill_webdata_backend_impl.cc
diff --git a/components/autofill/browser/webdata/autofill_webdata_backend_impl.cc b/components/autofill/browser/webdata/autofill_webdata_backend_impl.cc
index 68668b87253650a334143dd1343fa9cb90b24094..bac35ad26f7fafd46d53d6d38ddf82526e415185 100644
--- a/components/autofill/browser/webdata/autofill_webdata_backend_impl.cc
+++ b/components/autofill/browser/webdata/autofill_webdata_backend_impl.cc
@@ -50,9 +50,10 @@ WebDatabase* AutofillWebDataBackendImpl::GetDatabase() {
return web_database_backend_->database();
}
-void AutofillWebDataBackendImpl::RemoveExpiredFormElementsWrapper() {
+void AutofillWebDataBackendImpl::RemoveExpiredFormElements() {
web_database_backend_->ExecuteWriteTask(
- Bind(&AutofillWebDataBackendImpl::RemoveExpiredFormElements, this));
+ Bind(&AutofillWebDataBackendImpl::RemoveExpiredFormElementsImpl,
+ this));
}
void AutofillWebDataBackendImpl::NotifyOfMultipleAutofillChanges() {
@@ -125,25 +126,6 @@ WebDatabase::State AutofillWebDataBackendImpl::RemoveFormElementsAddedBetween(
return WebDatabase::COMMIT_NOT_NEEDED;
}
-WebDatabase::State AutofillWebDataBackendImpl::RemoveExpiredFormElements(
- WebDatabase* db) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
- AutofillChangeList changes;
-
- if (AutofillTable::FromWebDatabase(db)->RemoveExpiredFormElements(&changes)) {
- if (!changes.empty()) {
- // Post the notifications including the list of affected keys.
- // This is sent here so that work resulting from this notification
- // will be done on the DB thread, and not the UI thread.
- FOR_EACH_OBSERVER(AutofillWebDataServiceObserverOnDBThread,
- db_observer_list_,
- AutofillEntriesChanged(changes));
- }
- return WebDatabase::COMMIT_NEEDED;
- }
- return WebDatabase::COMMIT_NOT_NEEDED;
-}
-
WebDatabase::State AutofillWebDataBackendImpl::RemoveFormValueForElementName(
const base::string16& name, const base::string16& value, WebDatabase* db) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
@@ -349,6 +331,25 @@ WebDatabase::State AutofillWebDataBackendImpl::RemoveOriginURLsModifiedBetween(
return WebDatabase::COMMIT_NOT_NEEDED;
}
+WebDatabase::State AutofillWebDataBackendImpl::RemoveExpiredFormElementsImpl(
+ WebDatabase* db) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ AutofillChangeList changes;
+
+ if (AutofillTable::FromWebDatabase(db)->RemoveExpiredFormElements(&changes)) {
+ if (!changes.empty()) {
+ // Post the notifications including the list of affected keys.
+ // This is sent here so that work resulting from this notification
+ // will be done on the DB thread, and not the UI thread.
+ FOR_EACH_OBSERVER(AutofillWebDataServiceObserverOnDBThread,
+ db_observer_list_,
+ AutofillEntriesChanged(changes));
+ }
+ return WebDatabase::COMMIT_NEEDED;
+ }
+ return WebDatabase::COMMIT_NOT_NEEDED;
+}
+
void AutofillWebDataBackendImpl::DestroyAutofillProfileResult(
const WDTypedResult* result) {
DCHECK(result->GetType() == AUTOFILL_PROFILES_RESULT);

Powered by Google App Engine
This is Rietveld 408576698