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

Unified Diff: sync/engine/sync_scheduler_impl.h

Issue 12538015: sync: Handle POLL jobs in separate a code path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Amend comments Created 7 years, 9 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 | « no previous file | sync/engine/sync_scheduler_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/sync_scheduler_impl.h
diff --git a/sync/engine/sync_scheduler_impl.h b/sync/engine/sync_scheduler_impl.h
index 7190bdf62113c991fd2ea1632d67c135479d4e71..61351b782e5ebb9ab6329569fb9869dbbb707c2e 100644
--- a/sync/engine/sync_scheduler_impl.h
+++ b/sync/engine/sync_scheduler_impl.h
@@ -169,25 +169,25 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl : public SyncScheduler {
const base::Closure& task,
base::TimeDelta delay);
- // Helper to assemble a job and post a delayed task to sync.
- void ScheduleSyncSessionJob(const tracked_objects::Location& loc,
- scoped_ptr<SyncSessionJob> job);
-
- // Invoke the Syncer to perform a sync.
+ // Invoke the Syncer to perform a non-poll job.
bool DoSyncSessionJob(scoped_ptr<SyncSessionJob> job,
JobPriority priority);
+ // Returns whether or not it's safe to run a poll job at this time.
+ bool ShouldPoll();
+
+ // Invoke the Syncer to perform a poll job.
+ void DoPollSyncSessionJob(scoped_ptr<SyncSessionJob> job);
+
// Called after the Syncer has performed the sync represented by |job|, to
// reset our state. |exited_prematurely| is true if the Syncer did not
// cycle from job.start_step() to job.end_step(), likely because the
// scheduler was forced to quit the job mid-way through.
- bool FinishSyncSessionJob(scoped_ptr<SyncSessionJob> job,
+ bool FinishSyncSessionJob(SyncSessionJob* job,
bool exited_prematurely);
- // Helper to FinishSyncSessionJob to schedule the next sync operation.
- // |succeeded| carries the return value of |old_job|->Finish.
- void ScheduleNextSync(scoped_ptr<SyncSessionJob> finished_job,
- bool succeeded);
+ // Helper to schedule retries of a failed configure or nudge job.
+ void ScheduleNextSync(scoped_ptr<SyncSessionJob> finished_job);
// Helper to configure polling intervals. Used by Start and ScheduleNextSync.
void AdjustPolling(const SyncSessionJob* old_job);
@@ -214,6 +214,11 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl : public SyncScheduler {
// 'Impl' here refers to real implementation of public functions, running on
// |thread_|.
void StopImpl(const base::Closure& callback);
+
+ // If the scheduler's current state supports it, this will create a job based
+ // on the passed in parameters and coalesce it with any other pending jobs,
+ // then post a delayed task to run it. It may also choose to drop the job or
+ // save it for later, depending on the scheduler's current state.
void ScheduleNudgeImpl(
const base::TimeDelta& delay,
sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source,
« no previous file with comments | « no previous file | sync/engine/sync_scheduler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698