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

Unified Diff: sync/engine/sync_scheduler_impl.h

Issue 10826194: sync: raise initial backoff interval from 1 second to 5 minutes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo Created 8 years, 4 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 | « chrome/browser/sync/test/integration/sync_test.cc ('k') | 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 c86588a254a24ee947bb597635dd6fa2a66db506..586ccdc363822f6d121e4334e945760c0b9df326 100644
--- a/sync/engine/sync_scheduler_impl.h
+++ b/sync/engine/sync_scheduler_impl.h
@@ -77,6 +77,11 @@ class SyncSchedulerImpl : public SyncScheduler {
// TODO(tim): Look at URLRequestThrottlerEntryInterface.
static base::TimeDelta GetRecommendedDelay(const base::TimeDelta& base_delay);
+ // For integration tests only. Override initial backoff value.
+ // TODO(tim): Remove this, use command line flag and plumb through. Done
+ // this way to reduce diffs in hotfix.
+ static void ForceShortInitialBackoffRetry();
+
private:
enum JobProcessDecision {
// Indicates we should continue with the current job.
@@ -143,6 +148,7 @@ class SyncSchedulerImpl : public SyncScheduler {
FRIEND_TEST_ALL_PREFIXES(SyncSchedulerWhiteboxTest,
ContinueNudgeWhileExponentialBackOff);
FRIEND_TEST_ALL_PREFIXES(SyncSchedulerTest, TransientPollFailure);
+ FRIEND_TEST_ALL_PREFIXES(SyncSchedulerTest, GetInitialBackoffDelay);
// A component used to get time delays associated with exponential backoff.
// Encapsulated into a class to facilitate testing.
@@ -228,6 +234,11 @@ class SyncSchedulerImpl : public SyncScheduler {
// Helper to ScheduleNextSync in case of consecutive sync errors.
void HandleContinuationError(const SyncSessionJob& old_job);
+ // Helper to calculate the initial value for exponential backoff.
+ // See possible values and comments in polling_constants.h.
+ base::TimeDelta GetInitialBackoffDelay(
+ const sessions::ModelNeutralState& state) const;
+
// Determines if it is legal to run |job| by checking current
// operational mode, backoff or throttling, freshness
// (so we don't make redundant syncs), and connection.
« no previous file with comments | « chrome/browser/sync/test/integration/sync_test.cc ('k') | sync/engine/sync_scheduler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698