diff options
author | haitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-11 23:00:43 +0000 |
---|---|---|
committer | haitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-11 23:00:43 +0000 |
commit | e3e44e71643ae5d04dc9ea3303c2ae949c2038ab (patch) | |
tree | 4ef8b7a6d96171e9c307fff723b70d08a22c3682 /sync/sessions/nudge_tracker.h | |
parent | de764e8a49e46e0902fa40aa4c73427fcc95a562 (diff) | |
download | chromium_src-e3e44e71643ae5d04dc9ea3303c2ae949c2038ab.zip chromium_src-e3e44e71643ae5d04dc9ea3303c2ae949c2038ab.tar.gz chromium_src-e3e44e71643ae5d04dc9ea3303c2ae949c2038ab.tar.bz2 |
Support GU retry command in sync engine. The command specifies a delay after which syncer should issue a GU to pick up updates missed by last GU.
BUG=
Review URL: https://codereview.chromium.org/124083002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244381 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/sessions/nudge_tracker.h')
-rw-r--r-- | sync/sessions/nudge_tracker.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sync/sessions/nudge_tracker.h b/sync/sessions/nudge_tracker.h index fcd0150..1663f0c 100644 --- a/sync/sessions/nudge_tracker.h +++ b/sync/sessions/nudge_tracker.h @@ -36,11 +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() 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 +108,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 +137,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); }; |