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

Unified Diff: sync/engine/sync_scheduler_impl.cc

Issue 15764010: Experimental functionize patch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync: Expose sync functionality as functions Created 7 years, 6 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/sync_scheduler_impl.h ('k') | sync/engine/sync_scheduler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/sync_scheduler_impl.cc
diff --git a/sync/engine/sync_scheduler_impl.cc b/sync/engine/sync_scheduler_impl.cc
index 3921f672b23cce0610a436a85d8ba745182905b0..2223b9f2e52d4215c49f16d9bc228d4267bcb68f 100644
--- a/sync/engine/sync_scheduler_impl.cc
+++ b/sync/engine/sync_scheduler_impl.cc
@@ -237,6 +237,14 @@ void SyncSchedulerImpl::Start(Mode mode) {
}
}
+ModelTypeSet SyncSchedulerImpl::GetEnabledAndUnthrottledTypes() {
+ ModelTypeSet enabled_types =
+ GetRoutingInfoTypes(session_context_->routing_info());
+ ModelTypeSet throttled_types =
+ nudge_tracker_.GetThrottledTypes();
+ return Difference(enabled_types, throttled_types);
+}
+
void SyncSchedulerImpl::SendInitialSnapshot() {
DCHECK(CalledOnValidThread());
scoped_ptr<SyncSession> dummy(
@@ -461,14 +469,14 @@ void SyncSchedulerImpl::DoNudgeSyncSessionJob(JobPriority priority) {
DVLOG(2) << "Will run normal mode sync cycle with routing info "
<< ModelSafeRoutingInfoToString(session_context_->routing_info());
scoped_ptr<SyncSession> session(
- SyncSession::BuildForNudge(
+ SyncSession::Build(
session_context_,
this,
- nudge_tracker_.GetSourceInfo(),
- &nudge_tracker_));
- bool premature_exit = !syncer_->SyncShare(session.get(),
- SYNCER_BEGIN,
- SYNCER_END);
+ nudge_tracker_.GetSourceInfo()));
+ bool premature_exit = !syncer_->NormalSyncShare(
+ session.get(),
+ GetEnabledAndUnthrottledTypes(),
+ nudge_tracker_);
AdjustPolling(FORCE_RESET);
bool success = !premature_exit
@@ -507,9 +515,9 @@ bool SyncSchedulerImpl::DoConfigurationSyncSessionJob(JobPriority priority) {
std::string()));
scoped_ptr<SyncSession> session(
SyncSession::Build(session_context_, this, source_info));
- bool premature_exit = !syncer_->SyncShare(session.get(),
- DOWNLOAD_UPDATES,
- APPLY_UPDATES);
+ bool premature_exit = !syncer_->ConfigureSyncShare(
+ session.get(),
+ GetRoutingInfoTypes(session_context_->routing_info()));
AdjustPolling(FORCE_RESET);
bool success = !premature_exit
@@ -569,7 +577,9 @@ void SyncSchedulerImpl::DoPollSyncSessionJob() {
<< ModelSafeRoutingInfoToString(session_context_->routing_info());
scoped_ptr<SyncSession> session(
SyncSession::Build(session_context_, this, info));
- syncer_->SyncShare(session.get(), DOWNLOAD_UPDATES, APPLY_UPDATES);
+ syncer_->PollSyncShare(
+ session.get(),
+ GetEnabledAndUnthrottledTypes());
AdjustPolling(UPDATE_INTERVAL);
« no previous file with comments | « sync/engine/sync_scheduler_impl.h ('k') | sync/engine/sync_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698