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

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: rebase 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..86cbe1c8c03e8c02c9c4720f72c3f27e402566aa 100644
--- a/components/sync/engine_impl/cycle/nudge_tracker.h
+++ b/components/sync/engine_impl/cycle/nudge_tracker.h
@@ -84,21 +84,31 @@ 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);
- // Returns the time of the next type unthrottling, relative to
- // the input |now| value.
- base::TimeDelta GetTimeUntilNextUnthrottle(base::TimeTicks now) const;
+ // Removes any throttling and backoff that have expired.
+ void UpdateTypeThrottlingAndBackoffState();
- // Returns true if any type is currenlty throttled.
- bool IsAnyTypeThrottled() const;
+ // Returns the time of the next type unthrottling or unbackoff.
+ base::TimeDelta GetTimeUntilNextUnblock() const;
- // Returns true if |type| is currently throttled.
- bool IsTypeThrottled(ModelType type) const;
+ // Returns the time of for type last backing off interval.
+ base::TimeDelta GetTypeLastBackoffInterval(ModelType type) const;
- // Returns the set of currently throttled types.
- ModelTypeSet GetThrottledTypes() const;
+ // Returns true if any type is currenlty throttled or backed off.
+ bool IsAnyTypeBlocked() const;
+
+ // Returns true if |type| is currently blocked.
+ bool IsTypeBlocked(ModelType type) const;
+
+ // Returns |type|'s blocking mode.
+ WaitInterval::BlockingMode GetTypeBlockingMode(ModelType type) const;
+
+ // Returns the set of currently throttled or backed off types.
+ ModelTypeSet GetBlockedTypes() const;
// Returns the set of types with local changes pending.
ModelTypeSet GetNudgedTypes() const;
@@ -158,6 +168,8 @@ class NudgeTracker {
private:
using TypeTrackerMap = std::map<ModelType, std::unique_ptr<DataTypeTracker>>;
+ friend class SyncSchedulerImplTest;
+
TypeTrackerMap type_trackers_;
// Tracks whether or not invalidations are currently enabled.
« no previous file with comments | « components/sync/engine_impl/cycle/data_type_tracker.cc ('k') | components/sync/engine_impl/cycle/nudge_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698