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

Unified Diff: sync/engine/sync_scheduler_impl.h

Issue 68013007: Channel all low lever scheduling calls through single function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@FreshToken2.Step1.Cleanup
Patch Set: Created 7 years, 1 month 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') | sync/engine/sync_scheduler_impl.cc » ('J')
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 60d1c3873af77d4273790ade9ff52494836eda0b..edd844c622a1c7489cc05b7c9191217c7e3fd142 100644
--- a/sync/engine/sync_scheduler_impl.h
+++ b/sync/engine/sync_scheduler_impl.h
@@ -167,6 +167,9 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl
// Invoke the Syncer to perform a poll job.
void DoPollSyncSessionJob();
+ // Helper function to calculate poll interval.
+ base::TimeDelta GetPollInterval();
+
// Adjusts the poll timer to account for new poll interval, and possibly
// resets the poll interval, depedning on the flag's value.
void AdjustPolling(PollAdjustType type);
@@ -204,6 +207,8 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl
// priority.
void TryCanaryJob();
+ void TryJob(JobPriority priority);
+
// Transitions out of the THROTTLED WaitInterval then calls TryCanaryJob().
void Unthrottle();
@@ -309,6 +314,11 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl
// after credentials are updated.
bool do_poll_after_credentials_updated_;
+ // TryJob might get called for multiple reasons. It should only call
+ // DoPollSyncSessionJob after some time since the last attempt.
+ // last_poll_reset_ keeps track of when was last attempt.
+ base::TimeTicks last_poll_reset_;
+
base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_;
// A second factory specially for weak_handle_this_, to allow the handle
« no previous file with comments | « no previous file | sync/engine/sync_scheduler_impl.cc » ('j') | sync/engine/sync_scheduler_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698