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

Unified Diff: sync/sessions/nudge_tracker.h

Issue 146113003: sync: GU retry with less explicit TimeTicks logic (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/sessions/nudge_tracker.h
diff --git a/sync/sessions/nudge_tracker.h b/sync/sessions/nudge_tracker.h
index 1663f0ccad82b4d60af4626bb18a289a90c64bc7..22b4d7d43c1099d7d6885cbc97331ff24df3a7e6 100644
--- a/sync/sessions/nudge_tracker.h
+++ b/sync/sessions/nudge_tracker.h
@@ -36,14 +36,14 @@ class SYNC_EXPORT_PRIVATE NudgeTracker {
// Returns true if there is a good reason for performing a get updates
// request as part of the next sync cycle.
- bool IsGetUpdatesRequired(base::TimeTicks now) const;
+ bool IsGetUpdatesRequired() const;
// Return true if should perform a sync cycle for GU retry.
- bool IsRetryRequired(base::TimeTicks now) const;
+ bool IsRetryRequired() const;
// Tells this class that all required update fetching or committing has
// completed successfully.
- void RecordSuccessfulSyncCycle(base::TimeTicks now);
+ void RecordSuccessfulSyncCycle();
// Takes note of a local change.
void RecordLocalChange(ModelTypeSet types);
@@ -105,12 +105,14 @@ class SYNC_EXPORT_PRIVATE NudgeTracker {
ModelType type,
sync_pb::DataTypeProgressMarker* progress) const;
+ // Flips the flag if we're due for a retry.
+ void ToggleRetryFlagIfRequired(base::TimeTicks now);
+
// Adjusts the number of hints that can be stored locally.
void SetHintBufferSize(size_t size);
- void set_next_retry_time(base::TimeTicks next_retry_time) {
- next_retry_time_ = next_retry_time;
- }
+ // Schedules a retry GetUpdate request for some time in the future.
+ void SetNextRetryTime(base::TimeTicks next_retry_time);
private:
typedef std::map<ModelType, DataTypeTracker> TypeTrackerMap;
@@ -139,9 +141,13 @@ class SYNC_EXPORT_PRIVATE NudgeTracker {
base::TimeTicks last_successful_sync_time_;
- // A retry GU should be issued after this time.
+ // Time when the next retry is scheduled to execute. Will be null if no
+ // retry is currently pending, or the is_retry_required flag is set.
base::TimeTicks next_retry_time_;
+ // Set to true when the nudge tracker believes we're due for a GU retry.
+ bool is_retry_required_;
+
DISALLOW_COPY_AND_ASSIGN(NudgeTracker);
};

Powered by Google App Engine
This is Rietveld 408576698