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

Unified Diff: sync/sessions/nudge_tracker.cc

Issue 163413004: Add base::TimeDelta::Max(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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 | « net/spdy/spdy_session.cc ('k') | no next file » | 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 212500aa38b4ac20990419455e7365c678688416..b69d7539b23b7e3561a6e511a893887d9e742b37 100644
--- a/sync/sessions/nudge_tracker.cc
+++ b/sync/sessions/nudge_tracker.cc
@@ -192,11 +192,9 @@ bool NudgeTracker::IsTypeThrottled(ModelType type) const {
base::TimeDelta NudgeTracker::GetTimeUntilNextUnthrottle(
base::TimeTicks now) const {
DCHECK(IsAnyTypeThrottled()) << "This function requires a pending unthrottle";
- const base::TimeDelta kMaxTimeDelta =
- base::TimeDelta::FromInternalValue(kint64max);
// Return min of GetTimeUntilUnthrottle() values for all IsThrottled() types.
- base::TimeDelta time_until_next_unthrottle = kMaxTimeDelta;
+ base::TimeDelta time_until_next_unthrottle = base::TimeDelta::Max();
for (TypeTrackerMap::const_iterator it = type_trackers_.begin();
it != type_trackers_.end(); ++it) {
if (it->second.IsThrottled()) {
@@ -205,7 +203,7 @@ base::TimeDelta NudgeTracker::GetTimeUntilNextUnthrottle(
it->second.GetTimeUntilUnthrottle(now));
}
}
- DCHECK(kMaxTimeDelta != time_until_next_unthrottle);
+ DCHECK(!time_until_next_unthrottle.is_max());
return time_until_next_unthrottle;
}
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698