Index: chrome/browser/sync/engine/sync_scheduler.cc |
diff --git a/chrome/browser/sync/engine/sync_scheduler.cc b/chrome/browser/sync/engine/sync_scheduler.cc |
index e2b235397257b6a937b5e3282001d79f7c7f073b..3d4dee1b02cfeb7e7a41562806fac835ab287499 100644 |
--- a/chrome/browser/sync/engine/sync_scheduler.cc |
+++ b/chrome/browser/sync/engine/sync_scheduler.cc |
@@ -32,9 +32,9 @@ using sync_pb::GetUpdatesCallerInfo; |
namespace { |
bool ShouldRequestEarlyExit( |
- const browser_sync::SyncProtocolError& error) { |
+ const browser_sync::SyncOperationResult& error) { |
switch (error.error_type) { |
- case browser_sync::SYNC_SUCCESS: |
+ case browser_sync::OPERATION_SUCCESS: |
case browser_sync::MIGRATION_DONE: |
case browser_sync::THROTTLED: |
case browser_sync::TRANSIENT_ERROR: |
@@ -60,7 +60,7 @@ bool ShouldRequestEarlyExit( |
} |
bool IsActionableError( |
- const browser_sync::SyncProtocolError& error) { |
+ const browser_sync::SyncOperationResult& error) { |
return (error.action != browser_sync::UNKNOWN_ACTION); |
} |
} // namespace |
@@ -821,30 +821,15 @@ void SyncScheduler::FinishSyncSessionJob(const SyncSessionJob& job) { |
void SyncScheduler::ScheduleNextSync(const SyncSessionJob& old_job) { |
DCHECK_EQ(MessageLoop::current(), sync_loop_); |
DCHECK(!old_job.session->HasMoreToSync()); |
- // Note: |num_server_changes_remaining| > 0 here implies that we received a |
- // broken response while trying to download all updates, because the Syncer |
- // will loop until this value is exhausted. Also, if unsynced_handles exist |
- // but HasMoreToSync is false, this implies that the Syncer determined no |
- // forward progress was possible at this time (an error, such as an HTTP |
- // 500, is likely to have occurred during commit). |
- int num_server_changes_remaining = |
- old_job.session->status_controller()->num_server_changes_remaining(); |
- size_t num_unsynced_handles = |
- old_job.session->status_controller()->unsynced_handles().size(); |
- const bool work_to_do = |
- num_server_changes_remaining > 0 || num_unsynced_handles > 0; |
- SVLOG(2) << "num server changes remaining: " << num_server_changes_remaining |
- << ", num unsynced handles: " << num_unsynced_handles |
- << ", syncer has work to do: " << work_to_do; |
AdjustPolling(&old_job); |
// TODO(tim): Old impl had special code if notifications disabled. Needed? |
- if (!work_to_do) { |
+ if (!old_job.session->ExperiencedTransientError()) { |
// Success implies backoff relief. Note that if this was a |
// "one-off" job (i.e. purpose == |
// SyncSessionJob::{CLEAR_USER_DATA,CLEANUP_DISABLED_TYPES}), if |
- // there was work_to_do before it ran this wont have changed, as |
+ // there was work to do before it ran this wont have changed, as |
// jobs like this don't run a full sync cycle. So we don't need |
// special code here. |
wait_interval_.reset(); |