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

Unified Diff: sync/engine/sync_scheduler.cc

Issue 10541079: [Sync] Remove CleanupDisabledTypes command and move purge logic into SyncManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 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
Index: sync/engine/sync_scheduler.cc
diff --git a/sync/engine/sync_scheduler.cc b/sync/engine/sync_scheduler.cc
index 04b30f0d1028bd1a845cc11c3b0a64d441ddd8b2..c351326e70ccf10769624a55f3710d5e51084aa3 100644
--- a/sync/engine/sync_scheduler.cc
+++ b/sync/engine/sync_scheduler.cc
@@ -133,7 +133,6 @@ const char* SyncScheduler::SyncSessionJob::GetPurposeString(
ENUM_CASE(POLL);
ENUM_CASE(NUDGE);
ENUM_CASE(CONFIGURATION);
- ENUM_CASE(CLEANUP_DISABLED_TYPES);
}
NOTREACHED();
return "";
@@ -354,17 +353,6 @@ bool SyncScheduler::ScheduleConfiguration(const ConfigurationParams& params) {
&restricted_workers);
session_context_->set_routing_info(params.routing_info);
- // We rely on this not failing, so don't need to worry about checking for
- // success. In addition, this will be removed as part of crbug.com/131433.
- SyncSessionJob cleanup_job(
- SyncSessionJob::CLEANUP_DISABLED_TYPES,
- TimeTicks::Now(),
- make_linked_ptr(CreateSyncSession(SyncSourceInfo())),
- false,
- ConfigurationParams(),
- FROM_HERE);
- DoSyncSessionJob(cleanup_job);
-
if (params.keystore_key_status == ConfigurationParams::KEYSTORE_KEY_NEEDED) {
// TODO(zea): implement in such a way that we can handle failures and the
// subsequent retrys the scheduler might perform. See crbug.com/129665.
@@ -410,7 +398,6 @@ SyncScheduler::JobProcessDecision SyncScheduler::DecideWhileInWaitInterval(
const SyncSessionJob& job) {
DCHECK_EQ(MessageLoop::current(), sync_loop_);
DCHECK(wait_interval_.get());
- DCHECK_NE(job.purpose, SyncSessionJob::CLEANUP_DISABLED_TYPES);
SDVLOG(2) << "DecideWhileInWaitInterval with WaitInterval mode "
<< WaitInterval::GetModeString(wait_interval_->mode)
@@ -443,8 +430,6 @@ SyncScheduler::JobProcessDecision SyncScheduler::DecideWhileInWaitInterval(
SyncScheduler::JobProcessDecision SyncScheduler::DecideOnJob(
const SyncSessionJob& job) {
DCHECK_EQ(MessageLoop::current(), sync_loop_);
- if (job.purpose == SyncSessionJob::CLEANUP_DISABLED_TYPES)
- return CONTINUE;
// See if our type is throttled.
syncer::ModelTypeSet throttled_types =
@@ -538,8 +523,6 @@ bool SyncScheduler::ShouldRunJob(const SyncSessionJob& job) {
void SyncScheduler::SaveJob(const SyncSessionJob& job) {
DCHECK_EQ(MessageLoop::current(), sync_loop_);
- // TODO(sync): Should we also check that job.purpose !=
- // CLEANUP_DISABLED_TYPES? (See http://crbug.com/90868.)
if (job.purpose == SyncSessionJob::NUDGE) {
SDVLOG(2) << "Saving a nudge job";
InitOrCoalescePendingJob(job);
@@ -696,10 +679,6 @@ void SyncScheduler::SetSyncerStepsForPurpose(
*start = SYNCER_BEGIN;
*end = SYNCER_END;
return;
- case SyncSessionJob::CLEANUP_DISABLED_TYPES:
- *start = CLEANUP_DISABLED_TYPES;
- *end = CLEANUP_DISABLED_TYPES;
- return;
default:
NOTREACHED();
*start = SYNCER_END;
@@ -804,27 +783,6 @@ void SyncScheduler::DoSyncSessionJob(const SyncSessionJob& job) {
FinishSyncSessionJob(job);
}
-void SyncScheduler::UpdateCarryoverSessionState(
- const SyncSessionJob& old_job) {
- DCHECK_EQ(MessageLoop::current(), sync_loop_);
- if (old_job.purpose == SyncSessionJob::CONFIGURATION) {
- // Whatever types were part of a configuration task will have had updates
- // downloaded. For that reason, we make sure they get recorded in the
- // event that they get disabled at a later time.
- ModelSafeRoutingInfo r(session_context_->previous_session_routing_info());
- if (!r.empty()) {
- ModelSafeRoutingInfo temp_r;
- ModelSafeRoutingInfo old_info(old_job.session->routing_info());
- std::set_union(r.begin(), r.end(), old_info.begin(), old_info.end(),
- std::insert_iterator<ModelSafeRoutingInfo>(temp_r, temp_r.begin()));
- session_context_->set_previous_session_routing_info(temp_r);
- }
- } else {
- session_context_->set_previous_session_routing_info(
- old_job.session->routing_info());
- }
-}
-
void SyncScheduler::FinishSyncSessionJob(const SyncSessionJob& job) {
DCHECK_EQ(MessageLoop::current(), sync_loop_);
// Update timing information for how often datatypes are triggering nudges.
@@ -854,7 +812,6 @@ void SyncScheduler::FinishSyncSessionJob(const SyncSessionJob& job) {
ServerConnectionManager* scm = session_context_->connection_manager();
UpdateServerConnectionManagerStatus(scm->server_status());
- UpdateCarryoverSessionState(job);
if (IsSyncingCurrentlySilenced()) {
SDVLOG(2) << "We are currently throttled; not scheduling the next sync.";
// TODO(sync): Investigate whether we need to check job.purpose

Powered by Google App Engine
This is Rietveld 408576698