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

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: 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 24b62f70699856d7839c4f50b0ca54b4b9765b5c..43a6546a08fa45f1eb8d1f65b5132c61ecf5bb25 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());
@@ -629,14 +636,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() {

Powered by Google App Engine
This is Rietveld 408576698