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

Unified Diff: sync/sessions/nudge_tracker.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/sessions/nudge_tracker.h
diff --git a/sync/sessions/nudge_tracker.h b/sync/sessions/nudge_tracker.h
index fcd015034101312d6e71822ee7a772bbbb0af278..aa1d59d5978ec8683c0175215c9c155e800ce34f 100644
--- a/sync/sessions/nudge_tracker.h
+++ b/sync/sessions/nudge_tracker.h
@@ -11,6 +11,7 @@
#include <map>
#include "base/compiler_specific.h"
+#include "base/time/clock.h"
rlarocque 2014/01/08 20:30:08 I think you can remove this now.
haitaol1 2014/01/09 00:30:44 Done.
#include "sync/base/sync_export.h"
#include "sync/internal_api/public/base/model_type.h"
#include "sync/protocol/sync.pb.h"
@@ -36,11 +37,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() const;
+ bool IsGetUpdatesRequired(base::TimeTicks now) const;
- // Tells this class that all required update fetching and committing has
+ // Return true if should perform a sync cycle for GU retry.
+ bool IsRetryRequired(base::TimeTicks now) const;
+
+ // Tells this class that all required update fetching or committing has
// completed successfully.
- void RecordSuccessfulSyncCycle();
+ void RecordSuccessfulSyncCycle(base::TimeTicks now);
// Takes note of a local change.
void RecordLocalChange(ModelTypeSet types);
@@ -105,6 +109,10 @@ class SYNC_EXPORT_PRIVATE NudgeTracker {
// 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;
+ }
+
private:
typedef std::map<ModelType, DataTypeTracker> TypeTrackerMap;
@@ -130,6 +138,11 @@ class SYNC_EXPORT_PRIVATE NudgeTracker {
size_t num_payloads_per_type_;
+ base::TimeTicks last_successful_sync_time_;
+
+ // A retry GU should be issued after this time.
+ base::TimeTicks next_retry_time_;
+
DISALLOW_COPY_AND_ASSIGN(NudgeTracker);
};

Powered by Google App Engine
This is Rietveld 408576698