| Index: chrome/browser/webdata/web_data_service.cc
|
| diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc
|
| index e5f76d8cf8d6ce5fb07ccc382dac24428167b191..29baa90c0b4092783acca85c094d574b50bec66d 100644
|
| --- a/chrome/browser/webdata/web_data_service.cc
|
| +++ b/chrome/browser/webdata/web_data_service.cc
|
| @@ -515,6 +515,16 @@ void WebDataService::RemoveFormElementsAddedBetween(const Time& delete_begin,
|
| this, request));
|
| }
|
|
|
| +void WebDataService::RemoveExpiredFormElements() {
|
| + GenericRequest<Time>* request =
|
| + new GenericRequest<Time>(this, GetNextRequestHandle(), NULL,
|
| + AutofillEntry::ExpirationTime());
|
| + RegisterRequest(request);
|
| + ScheduleTask(FROM_HERE,
|
| + Bind(&WebDataService::RemoveExpiredFormElementsImpl,
|
| + this, request));
|
| +}
|
| +
|
| void WebDataService::RemoveFormValueForElementName(
|
| const string16& name, const string16& value) {
|
| GenericRequest2<string16, string16>* request =
|
| @@ -1258,6 +1268,31 @@ void WebDataService::RemoveFormElementsAddedBetweenImpl(
|
| request->RequestComplete();
|
| }
|
|
|
| +void WebDataService::RemoveExpiredFormElementsImpl(
|
| + GenericRequest<Time>* request) {
|
| + InitializeDatabaseIfNecessary();
|
| + if (db_ && !request->IsCancelled(NULL)) {
|
| + AutofillChangeList changes;
|
| + if (db_->GetAutofillTable()->RemoveExpiredFormElements(
|
| + request->arg(), &changes)) {
|
| + if (!changes.empty()) {
|
| + request->SetResult(
|
| + new WDResult<AutofillChangeList>(AUTOFILL_CHANGES, changes));
|
| +
|
| + // 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.
|
| + content::NotificationService::current()->Notify(
|
| + chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED,
|
| + content::Source<WebDataService>(this),
|
| + content::Details<AutofillChangeList>(&changes));
|
| + }
|
| + ScheduleCommit();
|
| + }
|
| + }
|
| + request->RequestComplete();
|
| +}
|
| +
|
| void WebDataService::RemoveFormValueForElementNameImpl(
|
| GenericRequest2<string16, string16>* request) {
|
| InitializeDatabaseIfNecessary();
|
|
|