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

Unified Diff: sync/engine/model_type_sync_worker_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/engine/model_type_sync_worker_impl.h ('k') | sync/engine/model_type_sync_worker_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/model_type_sync_worker_impl.cc
diff --git a/sync/engine/model_type_sync_worker_impl.cc b/sync/engine/model_type_sync_worker_impl.cc
index 090db11e04540d389285e0f34efda5d4dfe58d07..a5402c20ae42b875482b75f16ab0e98258dd0c97 100644
--- a/sync/engine/model_type_sync_worker_impl.cc
+++ b/sync/engine/model_type_sync_worker_impl.cc
@@ -20,12 +20,18 @@ namespace syncer {
ModelTypeSyncWorkerImpl::ModelTypeSyncWorkerImpl(
ModelType type,
const DataTypeState& initial_state,
+ NudgeHandler* nudge_handler,
scoped_ptr<ModelTypeSyncProxy> type_sync_proxy)
: type_(type),
data_type_state_(initial_state),
type_sync_proxy_(type_sync_proxy.Pass()),
+ nudge_handler_(nudge_handler),
entities_deleter_(&entities_),
weak_ptr_factory_(this) {
+ // Request an initial sync if it hasn't been completed yet.
+ if (!data_type_state_.initial_sync_done) {
+ nudge_handler_->NudgeForInitialDownload(type_);
+ }
}
ModelTypeSyncWorkerImpl::~ModelTypeSyncWorkerImpl() {
@@ -217,7 +223,8 @@ void ModelTypeSyncWorkerImpl::StorePendingCommit(
request.specifics);
}
- // TODO: Nudge SyncScheduler.
+ if (CanCommitItems())
+ nudge_handler_->NudgeForCommit(type_);
}
void ModelTypeSyncWorkerImpl::OnCommitResponse(
« no previous file with comments | « sync/engine/model_type_sync_worker_impl.h ('k') | sync/engine/model_type_sync_worker_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698