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

Unified Diff: sync/engine/sync_scheduler.cc

Issue 10006046: Abort sync cycles when download step fails (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 8 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 87304ea576484fce9d96ad6bea8c64cd4fdc4f71..4d537aef8fd9b41d31d2b3e0af420e664d806be6 100644
--- a/sync/engine/sync_scheduler.cc
+++ b/sync/engine/sync_scheduler.cc
@@ -683,6 +683,37 @@ const char* SyncScheduler::GetDecisionString(
return "";
}
+// static
+void SyncScheduler::SetSyncerStepsForPurpose(
+ SyncSessionJob::SyncSessionJobPurpose purpose,
+ SyncerStep* start,
+ SyncerStep* end) {
+ switch (purpose) {
+ case SyncSessionJob::CONFIGURATION:
+ *start = DOWNLOAD_UPDATES;
+ *end = APPLY_UPDATES;
+ return;
+ case SyncSessionJob::CLEAR_USER_DATA:
+ *start = CLEAR_PRIVATE_DATA;
+ *end = CLEAR_PRIVATE_DATA;
+ return;
+ case SyncSessionJob::NUDGE:
+ case SyncSessionJob::POLL:
+ *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;
+ *end = SYNCER_END;
+ return;
+ }
+}
+
void SyncScheduler::PostTask(
const tracked_objects::Location& from_here,
const char* name, const base::Closure& task) {
@@ -731,36 +762,6 @@ void SyncScheduler::ScheduleSyncSessionJob(const SyncSessionJob& job) {
delay);
}
-void SyncScheduler::SetSyncerStepsForPurpose(
- SyncSessionJob::SyncSessionJobPurpose purpose,
- SyncerStep* start, SyncerStep* end) {
- DCHECK_EQ(MessageLoop::current(), sync_loop_);
- switch (purpose) {
- case SyncSessionJob::CONFIGURATION:
- *start = DOWNLOAD_UPDATES;
- *end = APPLY_UPDATES;
- return;
- case SyncSessionJob::CLEAR_USER_DATA:
- *start = CLEAR_PRIVATE_DATA;
- *end = CLEAR_PRIVATE_DATA;
- return;
- case SyncSessionJob::NUDGE:
- case SyncSessionJob::POLL:
- *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;
- *end = SYNCER_END;
- return;
- }
-}
-
void SyncScheduler::DoSyncSessionJob(const SyncSessionJob& job) {
DCHECK_EQ(MessageLoop::current(), sync_loop_);
if (!ShouldRunJob(job)) {
« no previous file with comments | « sync/engine/sync_scheduler.h ('k') | sync/engine/syncer.cc » ('j') | sync/engine/syncer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698