summaryrefslogtreecommitdiffstats
path: root/sync/engine/sync_scheduler_impl.h
diff options
context:
space:
mode:
authorhaitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-14 16:17:43 +0000
committerhaitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-14 16:17:43 +0000
commit3dfc7b7970b85378523b53bea33b1139dceaca6e (patch)
tree74450de20b350f2995db44f319b8da0f4911e97d /sync/engine/sync_scheduler_impl.h
parentea7f19230d44bd71eef8082ee79740d11ac047d1 (diff)
downloadchromium_src-3dfc7b7970b85378523b53bea33b1139dceaca6e.zip
chromium_src-3dfc7b7970b85378523b53bea33b1139dceaca6e.tar.gz
chromium_src-3dfc7b7970b85378523b53bea33b1139dceaca6e.tar.bz2
[Recommit]
Support GU retry command in sync engine. The command specifies a delay after which syncer should issue a GU to pick up updates missed by last GU. TBR=rlarocque@chromium.org Review URL: https://codereview.chromium.org/133763007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244736 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/engine/sync_scheduler_impl.h')
-rw-r--r--sync/engine/sync_scheduler_impl.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/sync/engine/sync_scheduler_impl.h b/sync/engine/sync_scheduler_impl.h
index 81a4fcf..68d2a80 100644
--- a/sync/engine/sync_scheduler_impl.h
+++ b/sync/engine/sync_scheduler_impl.h
@@ -89,6 +89,10 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl
virtual void OnReceivedClientInvalidationHintBufferSize(int size) OVERRIDE;
virtual void OnSyncProtocolError(
const sessions::SyncSessionSnapshot& snapshot) OVERRIDE;
+ virtual void OnReceivedGuRetryDelay(const base::TimeDelta& delay) OVERRIDE;
+
+ // Returns true if the client is currently in exponential backoff.
+ bool IsBackingOff() const;
private:
enum JobPriority {
@@ -167,6 +171,9 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl
// Invoke the Syncer to perform a poll job.
void DoPollSyncSessionJob();
+ // Invoke the Syncer to perform a retry job.
+ void DoRetrySyncSessionJob();
+
// Helper function to calculate poll interval.
base::TimeDelta GetPollInterval();
@@ -191,9 +198,6 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl
const base::TimeDelta& delay,
const tracked_objects::Location& nudge_location);
- // Returns true if the client is currently in exponential backoff.
- bool IsBackingOff() const;
-
// Helper to signal all listeners registered with |session_context_|.
void Notify(SyncEngineEvent::EventCause cause);
@@ -230,6 +234,9 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl
// Creates a session for a poll and performs the sync.
void PollTimerCallback();
+ // Creates a session for a retry and performs the sync.
+ void RetryTimerCallback();
+
// Returns the set of types that are enabled and not currently throttled.
ModelTypeSet GetEnabledAndUnthrottledTypes();
@@ -336,6 +343,9 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl
// to be const and alleviate threading concerns.
base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_for_weak_handle_;
+ // One-shot timer for scheduling GU retry according to delay set by server.
+ base::OneShotTimer<SyncSchedulerImpl> retry_timer_;
+
DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl);
};