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

Unified Diff: components/sync/engine_impl/cycle/nudge_tracker.h

Issue 2475043002: [Sync] Sync client should to exponential backoff when receive partial failure (Closed)
Patch Set: review by self Created 4 years, 1 month 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: components/sync/engine_impl/cycle/nudge_tracker.h
diff --git a/components/sync/engine_impl/cycle/nudge_tracker.h b/components/sync/engine_impl/cycle/nudge_tracker.h
index 5bd69c9259e534d766b8cba42a394f87005818b9..1840f5c2ba092937aa644922341a84ee73c0e14c 100644
--- a/components/sync/engine_impl/cycle/nudge_tracker.h
+++ b/components/sync/engine_impl/cycle/nudge_tracker.h
@@ -84,22 +84,43 @@ class NudgeTracker {
base::TimeDelta length,
base::TimeTicks now);
- // Removes any throttling that have expired by time |now|.
- void UpdateTypeThrottlingState(base::TimeTicks now);
+ // Marks |type| as being backed off from |now| until |now| + |length|.
+ void SetTypeBackedOff(ModelType type,
+ base::TimeDelta length,
+ base::TimeTicks now);
+
+ // Removes any throttling and backoff that have expired by time |now|.
+ void UpdateTypeThrottlingAndBackoffState(base::TimeTicks now);
// Returns the time of the next type unthrottling, relative to
// the input |now| value.
base::TimeDelta GetTimeUntilNextUnthrottle(base::TimeTicks now) const;
+ // Returns the time of the next type unbackoff, relative to
+ // the input |now| value.
+ base::TimeDelta GetTimeUntilNextUnbackoff(base::TimeTicks now) const;
+
+ // Returns the time of for type last backing off interval.
+ base::TimeDelta GetTypeLastBackoffInterval(ModelType type) const;
+
// Returns true if any type is currenlty throttled.
bool IsAnyTypeThrottled() const;
+ // Returns true if any type is currenlty backed off.
+ bool IsAnyTypeBackedOff() const;
+
// Returns true if |type| is currently throttled.
bool IsTypeThrottled(ModelType type) const;
+ // Returns true if |type| is currently backed off.
+ bool IsTypeBackedOff(ModelType type) const;
+
// Returns the set of currently throttled types.
ModelTypeSet GetThrottledTypes() const;
+ // Returns the set of currently backed off types.
+ ModelTypeSet GetBackedOffTypes() const;
+
// Returns the set of types with local changes pending.
ModelTypeSet GetNudgedTypes() const;

Powered by Google App Engine
This is Rietveld 408576698