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

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

Issue 1418513005: [sync] Set up notification-free infra for triggering local sync refresh (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review Created 5 years, 2 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 5306835d220fc980b3dba01fb8621e2bc7d664e2..b96d46a93a0f32dc6a1786ecd41af3f8a6167391 100644
--- a/chrome/browser/sync/glue/sync_backend_host_impl.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_impl.cc
@@ -174,6 +174,13 @@ void SyncBackendHostImpl::Initialize(
InitCore(init_opts.Pass());
}
+void SyncBackendHostImpl::TriggerRefresh(const syncer::ModelTypeSet& types) {
+ DCHECK(ui_thread_->BelongsToCurrentThread());
+ registrar_->sync_thread()->task_runner()->PostTask(
+ FROM_HERE,
+ base::Bind(&SyncBackendHostCore::DoRefreshTypes, core_.get(), types));
+}
+
void SyncBackendHostImpl::UpdateCredentials(
const syncer::SyncCredentials& credentials) {
DCHECK(registrar_->sync_thread()->IsRunning());
@@ -622,14 +629,11 @@ void SyncBackendHostImpl::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- DCHECK(ui_thread_->BelongsToCurrentThread());
DCHECK_EQ(type, chrome::NOTIFICATION_SYNC_REFRESH_LOCAL);
content::Details<const syncer::ModelTypeSet> state_details(details);
const syncer::ModelTypeSet& types = *(state_details.ptr());
- registrar_->sync_thread()->task_runner()->PostTask(
- FROM_HERE,
- base::Bind(&SyncBackendHostCore::DoRefreshTypes, core_.get(), types));
+ TriggerRefresh(types);
}
void SyncBackendHostImpl::AddExperimentalTypes() {
« 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