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

Unified Diff: components/autofill/core/browser/webdata/autofill_webdata_service.cc

Issue 2142123002: [Autofill] Run autofill-profile de-dupe after sync starts if sync is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better logging and fix mathp's comments Created 4 years, 5 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/core/browser/webdata/autofill_webdata_service.cc
diff --git a/components/autofill/core/browser/webdata/autofill_webdata_service.cc b/components/autofill/core/browser/webdata/autofill_webdata_service.cc
index 377ce32e2d4b6ea81dd473b414baac27be55c9a6..fa84a59af63df178eee393f0c96b8300569885e2 100644
--- a/components/autofill/core/browser/webdata/autofill_webdata_service.cc
+++ b/components/autofill/core/browser/webdata/autofill_webdata_service.cc
@@ -34,30 +34,34 @@ AutofillWebDataService::AutofillWebDataService(
: WebDataServiceBase(wdbs, callback, ui_thread),
ui_thread_(ui_thread),
db_thread_(db_thread),
- autofill_backend_(NULL),
+ autofill_backend_(nullptr),
weak_ptr_factory_(this) {
base::Closure on_changed_callback = Bind(
&AutofillWebDataService::NotifyAutofillMultipleChangedOnUIThread,
weak_ptr_factory_.GetWeakPtr());
-
+ base::Callback<void(syncer::ModelType)> on_sync_started_callback = Bind(
+ &AutofillWebDataService::NotifySyncStartedOnUIThread,
+ weak_ptr_factory_.GetWeakPtr());
autofill_backend_ = new AutofillWebDataBackendImpl(
- wdbs_->GetBackend(), ui_thread_, db_thread_, on_changed_callback);
+ wdbs_->GetBackend(), ui_thread_, db_thread_, on_changed_callback,
+ on_sync_started_callback);
}
AutofillWebDataService::AutofillWebDataService(
scoped_refptr<base::SingleThreadTaskRunner> ui_thread,
scoped_refptr<base::SingleThreadTaskRunner> db_thread)
- : WebDataServiceBase(NULL,
+ : WebDataServiceBase(nullptr,
WebDataServiceBase::ProfileErrorCallback(),
ui_thread),
ui_thread_(ui_thread),
db_thread_(db_thread),
- autofill_backend_(new AutofillWebDataBackendImpl(NULL,
- ui_thread_,
- db_thread_,
- base::Closure())),
- weak_ptr_factory_(this) {
-}
+ autofill_backend_(new AutofillWebDataBackendImpl(
+ nullptr,
+ ui_thread_,
+ db_thread_,
+ base::Closure(),
+ base::Callback<void(syncer::ModelType)>())),
+ weak_ptr_factory_(this) {}
void AutofillWebDataService::ShutdownOnUIThread() {
weak_ptr_factory_.InvalidateWeakPtrs();
@@ -296,4 +300,12 @@ void AutofillWebDataService::NotifyAutofillMultipleChangedOnUIThread() {
AutofillMultipleChanged());
}
+void AutofillWebDataService::NotifySyncStartedOnUIThread(
+ syncer::ModelType model_type) {
+ DCHECK(ui_thread_->BelongsToCurrentThread());
+ FOR_EACH_OBSERVER(AutofillWebDataServiceObserverOnUIThread,
+ ui_observer_list_,
+ SyncStarted(model_type));
+}
+
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698