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

Unified Diff: sync/sessions/nudge_tracker.cc

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
« no previous file with comments | « sync/sessions/nudge_tracker.h ('k') | sync/sessions/nudge_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/nudge_tracker.cc
diff --git a/sync/sessions/nudge_tracker.cc b/sync/sessions/nudge_tracker.cc
index d109294a2170c34f52cf7af1d3b683e67758719d..f96d3464826e86653fb04d515c7d9575d891f2be 100644
--- a/sync/sessions/nudge_tracker.cc
+++ b/sync/sessions/nudge_tracker.cc
@@ -44,9 +44,13 @@ bool NudgeTracker::IsSyncRequired() const {
return false;
}
-bool NudgeTracker::IsGetUpdatesRequired() const {
+bool NudgeTracker::IsGetUpdatesRequired(base::TimeTicks now) const {
if (invalidations_out_of_sync_)
return true;
+
+ if (IsRetryRequired(now))
+ return true;
+
for (TypeTrackerMap::const_iterator it = type_trackers_.begin();
it != type_trackers_.end(); ++it) {
if (it->second.IsGetUpdatesRequired()) {
@@ -56,8 +60,16 @@ bool NudgeTracker::IsGetUpdatesRequired() const {
return false;
}
-void NudgeTracker::RecordSuccessfulSyncCycle() {
+bool NudgeTracker::IsRetryRequired(base::TimeTicks now) const {
+ return !next_retry_time_.is_null() && next_retry_time_ < now;
+}
+
+void NudgeTracker::RecordSuccessfulSyncCycle(base::TimeTicks now) {
updates_source_ = sync_pb::GetUpdatesCallerInfo::UNKNOWN;
+ last_successful_sync_time_ = now;
+
+ if (next_retry_time_ < now)
+ next_retry_time_ = base::TimeTicks();
// A successful cycle while invalidations are enabled puts us back into sync.
invalidations_out_of_sync_ = !invalidations_enabled_;
« no previous file with comments | « sync/sessions/nudge_tracker.h ('k') | sync/sessions/nudge_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698