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

Unified Diff: chrome/browser/sync/engine/sync_scheduler.h

Issue 7604019: [Sync] Add client-side plumbing for server control of sessions commit delay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
Index: chrome/browser/sync/engine/sync_scheduler.h
diff --git a/chrome/browser/sync/engine/sync_scheduler.h b/chrome/browser/sync/engine/sync_scheduler.h
index 2d33b8f96e5ac260f49901864dd43d1bbf061f44..57e5b1a8b2da6c723c5cf41c082de72fcfa9e7aa 100644
--- a/chrome/browser/sync/engine/sync_scheduler.h
+++ b/chrome/browser/sync/engine/sync_scheduler.h
@@ -10,6 +10,7 @@
#include <string>
#include "base/callback.h"
+#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
#include "base/memory/linked_ptr.h"
#include "base/memory/scoped_ptr.h"
@@ -98,23 +99,29 @@ class SyncScheduler : public sessions::SyncSession::Delegate,
// Change status of notifications in the SyncSessionContext.
void set_notifications_enabled(bool notifications_enabled);
+ base::TimeDelta GetSessionsCommitDelay() const;
+
// DDOS avoidance function. Calculates how long we should wait before trying
// again after a failed sync attempt, where the last delay was |base_delay|.
// TODO(tim): Look at URLRequestThrottlerEntryInterface.
static base::TimeDelta GetRecommendedDelay(const base::TimeDelta& base_delay);
// SyncSession::Delegate implementation.
- virtual void OnSilencedUntil(const base::TimeTicks& silenced_until);
- virtual bool IsSyncingCurrentlySilenced();
+ virtual void OnSilencedUntil(
+ const base::TimeTicks& silenced_until) OVERRIDE;
+ virtual bool IsSyncingCurrentlySilenced() OVERRIDE;
virtual void OnReceivedShortPollIntervalUpdate(
- const base::TimeDelta& new_interval);
+ const base::TimeDelta& new_interval) OVERRIDE;
virtual void OnReceivedLongPollIntervalUpdate(
- const base::TimeDelta& new_interval);
- virtual void OnShouldStopSyncingPermanently();
+ const base::TimeDelta& new_interval) OVERRIDE;
+ virtual void OnReceivedSessionsCommitDelay(
+ const base::TimeDelta& new_delay) OVERRIDE;
+ virtual void OnShouldStopSyncingPermanently() OVERRIDE;
// ServerConnectionEventListener implementation.
// TODO(tim): schedule a nudge when valid connection detected? in 1 minute?
- virtual void OnServerConnectionEvent(const ServerConnectionEvent& event);
+ virtual void OnServerConnectionEvent(
+ const ServerConnectionEvent& event) OVERRIDE;
private:
enum JobProcessDecision {
@@ -359,6 +366,9 @@ class SyncScheduler : public sessions::SyncSession::Delegate,
base::TimeDelta syncer_short_poll_interval_seconds_;
base::TimeDelta syncer_long_poll_interval_seconds_;
+ // Server-tweakable sessions commit delay.
+ base::TimeDelta sessions_commit_delay_;
+
// Periodic timer for polling. See AdjustPolling.
base::RepeatingTimer<SyncScheduler> poll_timer_;
« no previous file with comments | « no previous file | chrome/browser/sync/engine/sync_scheduler.cc » ('j') | chrome/browser/sync/engine/sync_scheduler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698