// Copyright 2012 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_SYNC_ENGINE_POLLING_CONSTANTS_H_ #define COMPONENTS_SYNC_ENGINE_POLLING_CONSTANTS_H_ #include <stdint.h> #include "base/time/time.h" namespace syncer { // Constants used by SyncScheduler when polling servers for updates. // Factor by which the backoff time will be multiplied. inline constexpr double kBackoffMultiplyFactor = …; // Backoff interval randomization factor. inline constexpr double kBackoffJitterFactor = …; // Server can overwrite these values via client commands. // We use high values here to ensure that failure to receive poll updates from // the server doesn't result in rapid-fire polling from the client due to low // local limits. inline constexpr base::TimeDelta kDefaultPollInterval = …; // Minimum and maximum interval for exponential backoff. inline constexpr base::TimeDelta kMinBackoffTime = …; inline constexpr base::TimeDelta kMaxBackoffTime = …; // After a failure contacting sync servers, specifies how long to wait before // reattempting and entering exponential backoff if consecutive failures // occur. inline constexpr base::TimeDelta kInitialBackoffRetryTime = …; // A dangerously short retry value that would not actually protect servers from // DDoS if it were used as a seed for exponential backoff, although the client // would still follow exponential backoff. Useful for debugging and tests (when // you don't want to wait 5 minutes). inline constexpr base::TimeDelta kInitialBackoffShortRetryTime = …; // Similar to kInitialBackoffRetryTime above, but only to be used in // certain exceptional error cases, such as MIGRATION_DONE. inline constexpr base::TimeDelta kInitialBackoffImmediateRetryTime = …; } // namespace syncer #endif // COMPONENTS_SYNC_ENGINE_POLLING_CONSTANTS_H_