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

Unified Diff: chrome/browser/sync/glue/sync_backend_registrar.cc

Issue 14046031: Worker changes to prepare for lock-free shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/sync/glue/sync_backend_registrar.cc
diff --git a/chrome/browser/sync/glue/sync_backend_registrar.cc b/chrome/browser/sync/glue/sync_backend_registrar.cc
index 92a517bd03c7deb0bb954c66ad57edcb020b4b60..059c192d06f9e00e79649cc44b81990ec5dca41e 100644
--- a/chrome/browser/sync/glue/sync_backend_registrar.cc
+++ b/chrome/browser/sync/glue/sync_backend_registrar.cc
@@ -59,27 +59,29 @@ SyncBackendRegistrar::SyncBackendRegistrar(
name_(name),
profile_(profile),
sync_loop_(sync_loop),
- ui_worker_(new UIModelWorker()),
+ ui_worker_(new UIModelWorker(ALLOW_THIS_IN_INITIALIZER_LIST(this))),
tim (not reviewing) 2013/05/14 04:14:29 See http://src.chromium.org/viewvc/chrome?revision
haitaol1 2013/05/15 23:39:21 Done.
stopped_on_ui_thread_(false) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
CHECK(profile_);
DCHECK(sync_loop_);
- workers_[syncer::GROUP_DB] = new DatabaseModelWorker();
- workers_[syncer::GROUP_FILE] = new FileModelWorker();
+ workers_[syncer::GROUP_DB] = new DatabaseModelWorker(this);
+ workers_[syncer::GROUP_FILE] = new FileModelWorker(this);
workers_[syncer::GROUP_UI] = ui_worker_;
- workers_[syncer::GROUP_PASSIVE] = new syncer::PassiveModelWorker(sync_loop_);
+ workers_[syncer::GROUP_PASSIVE] = new syncer::PassiveModelWorker(sync_loop_,
+ this);
HistoryService* history_service =
HistoryServiceFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS);
if (history_service) {
workers_[syncer::GROUP_HISTORY] =
- new HistoryModelWorker(history_service->AsWeakPtr());
+ new HistoryModelWorker(history_service->AsWeakPtr(), this);
}
scoped_refptr<PasswordStore> password_store =
PasswordStoreFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS);
if (password_store.get()) {
- workers_[syncer::GROUP_PASSWORD] = new PasswordModelWorker(password_store);
+ workers_[syncer::GROUP_PASSWORD] = new PasswordModelWorker(password_store,
+ this);
}
}
@@ -295,4 +297,8 @@ bool SyncBackendRegistrar::IsCurrentThreadSafeForModel(
GetGroupForModelType(model_type, routing_info_));
}
+void SyncBackendRegistrar::OnWorkerDisabled(syncer::ModelSafeGroup group) {
+ // Do nothing for now.
+}
+
} // namespace browser_sync

Powered by Google App Engine
This is Rietveld 408576698