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

Unified Diff: sync/engine/sync_scheduler_impl.h

Issue 124083002: Client-side changes to support retry GU. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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: sync/engine/sync_scheduler_impl.h
diff --git a/sync/engine/sync_scheduler_impl.h b/sync/engine/sync_scheduler_impl.h
index 81a4fcf68d1534d0c2bd703102294d0e71ab7a52..0a481e3246a1b59d047fdee1078d379409d41bca 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 OnReceivedGuRetryDelaySeconds(int delay_seconds) 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);
};

Powered by Google App Engine
This is Rietveld 408576698