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

Unified Diff: chrome/browser/sync/glue/sync_backend_host_impl.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_impl.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host_impl.cc b/chrome/browser/sync/glue/sync_backend_host_impl.cc
index 4c202f0d8e9038f1cd51ea47467dea622e9c1296..09cfd1ea0202aecafa48b644485e1fe454dada2f 100644
--- a/chrome/browser/sync/glue/sync_backend_host_impl.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_impl.cc
@@ -234,6 +234,9 @@ void SyncBackendHostImpl::StopSyncingForShutdown() {
// Stop listening for and forwarding locally-triggered sync refresh requests.
notification_registrar_.RemoveAll();
+ // Stop non-blocking sync types from sending any more requests to the syncer.
+ sync_core_proxy_.reset();
+
DCHECK(registrar_->sync_thread()->IsRunning());
registrar_->RequestWorkerStopOnUIThread();
@@ -427,6 +430,10 @@ syncer::UserShare* SyncBackendHostImpl::GetUserShare() const {
return core_->sync_manager()->GetUserShare();
}
+syncer::SyncCoreProxy SyncBackendHostImpl::GetSyncCoreProxy() {
+ return *sync_core_proxy_.get();
+}
+
SyncBackendHostImpl::Status SyncBackendHostImpl::GetDetailedStatus() {
DCHECK(initialized());
return core_->sync_manager()->GetDetailedStatus();
@@ -573,13 +580,16 @@ void SyncBackendHostImpl::HandleControlTypesDownloadRetry() {
void SyncBackendHostImpl::HandleInitializationSuccessOnFrontendLoop(
const syncer::WeakHandle<syncer::JsBackend> js_backend,
const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>
- debug_info_listener) {
+ debug_info_listener,
+ syncer::SyncCoreProxy sync_core_proxy) {
DCHECK_EQ(base::MessageLoop::current(), frontend_loop_);
if (!frontend_)
return;
initialized_ = true;
+ sync_core_proxy_.reset(new syncer::SyncCoreProxy(sync_core_proxy));
+
invalidator_->RegisterInvalidationHandler(this);
invalidation_handler_registered_ = true;
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host_impl.h ('k') | chrome/browser/sync/glue/sync_backend_host_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698