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

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

Issue 217183003: Add non-blocking sync code to ProfileSyncService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments Created 6 years, 9 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_host_core.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host_core.cc b/chrome/browser/sync/glue/sync_backend_host_core.cc
index c49171a5404e2cd338542e4baeccd17a86f193af..9d546179eeca4352e1a2bc6a25329e3c48dd0c68 100644
--- a/chrome/browser/sync/glue/sync_backend_host_core.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_core.cc
@@ -474,16 +474,26 @@ void SyncBackendHostCore::DoInitialProcessControlTypes() {
}
void SyncBackendHostCore::DoFinishInitialProcessControlTypes() {
+ DCHECK_EQ(base::MessageLoop::current(), sync_loop_);
+
registrar_->ActivateDataType(syncer::DEVICE_INFO,
syncer::GROUP_PASSIVE,
synced_device_tracker_.get(),
sync_manager_->GetUserShare());
+ base::WeakPtr<syncer::SyncCore> sync_core = sync_manager_->GetSyncCore();
+
+ // De-reference the WeakPtr while we're here to signal to the debugging
+ // mechanisms that it belongs to the sync thread. This helps us DCHECK
+ // earlier if the pointer is misused.
+ sync_core.get();
+
host_.Call(
FROM_HERE,
&SyncBackendHostImpl::HandleInitializationSuccessOnFrontendLoop,
js_backend_,
- debug_info_listener_);
+ debug_info_listener_,
+ syncer::SyncCoreProxy(base::MessageLoopProxy::current(), sync_core));
js_backend_.Reset();
debug_info_listener_.Reset();
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host_core.h ('k') | chrome/browser/sync/glue/sync_backend_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698