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

Unified Diff: sync/internal_api/sync_manager_impl.cc

Issue 375023002: sync: Support nudges from non-blocking sync types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 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
« no previous file with comments | « sync/internal_api/sync_manager_impl.h ('k') | sync/sessions/model_type_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/sync_manager_impl.cc
diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc
index 54ce66d7f57e6ebe171884dfeb030042104da6ea..168c19f9fc7124ea084948456d50a0ff8b600cec 100644
--- a/sync/internal_api/sync_manager_impl.cc
+++ b/sync/internal_api/sync_manager_impl.cc
@@ -396,7 +396,7 @@ void SyncManagerImpl::Init(
DVLOG(1) << "Setting invalidator client ID: " << invalidator_client_id;
allstatus_.SetInvalidatorClientId(invalidator_client_id);
- model_type_registry_.reset(new ModelTypeRegistry(workers, directory()));
+ model_type_registry_.reset(new ModelTypeRegistry(workers, directory(), this));
// Bind the SyncContext WeakPtr to this thread. This helps us crash earlier
// if the pointer is misused in debug mode.
@@ -900,6 +900,22 @@ void SyncManagerImpl::RequestNudgeForDataTypes(
nudge_location);
}
+void SyncManagerImpl::NudgeForInitialDownload(syncer::ModelType type) {
+ // TODO(rlarocque): Initial downloads should have a separate nudge type.
+ DCHECK(thread_checker_.CalledOnValidThread());
+ RefreshTypes(ModelTypeSet(type));
+}
+
+void SyncManagerImpl::NudgeForCommit(syncer::ModelType type) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ RequestNudgeForDataTypes(FROM_HERE, ModelTypeSet(type));
+}
+
+void SyncManagerImpl::NudgeForRefresh(syncer::ModelType type) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ RefreshTypes(ModelTypeSet(type));
+}
+
void SyncManagerImpl::OnSyncCycleEvent(const SyncCycleEvent& event) {
DCHECK(thread_checker_.CalledOnValidThread());
// Only send an event if this is due to a cycle ending and this cycle
« no previous file with comments | « sync/internal_api/sync_manager_impl.h ('k') | sync/sessions/model_type_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698