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

Unified Diff: net/base/backoff_entry.cc

Issue 1498003003: Remove kint64max. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: INT64_MAX Created 5 years 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/base/backoff_entry.h ('k') | net/cert/ct_serialization.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/backoff_entry.cc
diff --git a/net/base/backoff_entry.cc b/net/base/backoff_entry.cc
index ac4882c9a28da134281056820efbce97574f0714..64125721c57f92f850b790b686986f6725825b63 100644
--- a/net/base/backoff_entry.cc
+++ b/net/base/backoff_entry.cc
@@ -8,7 +8,6 @@
#include <cmath>
#include <limits>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "base/numerics/safe_math.h"
#include "base/rand_util.h"
@@ -145,7 +144,7 @@ base::TimeTicks BackoffEntry::CalculateReleaseTime() const {
base::internal::CheckedNumeric<int64_t> backoff_duration_us = delay_ms + 0.5;
backoff_duration_us *= base::Time::kMicrosecondsPerMillisecond;
base::TimeDelta backoff_duration = base::TimeDelta::FromMicroseconds(
- backoff_duration_us.ValueOrDefault(kint64max));
+ backoff_duration_us.ValueOrDefault(std::numeric_limits<int64_t>::max()));
base::TimeTicks release_time = BackoffDurationToReleaseTime(backoff_duration);
// Never reduce previously set release horizon, e.g. due to Retry-After
@@ -162,7 +161,8 @@ base::TimeTicks BackoffEntry::BackoffDurationToReleaseTime(
backoff_duration.InMicroseconds();
calculated_release_time_us += kTimeTicksNowUs;
- base::internal::CheckedNumeric<int64_t> maximum_release_time_us = kint64max;
+ base::internal::CheckedNumeric<int64_t> maximum_release_time_us =
+ std::numeric_limits<int64_t>::max();
if (policy_->maximum_backoff_ms >= 0) {
maximum_release_time_us = policy_->maximum_backoff_ms;
maximum_release_time_us *= base::Time::kMicrosecondsPerMillisecond;
@@ -171,9 +171,10 @@ base::TimeTicks BackoffEntry::BackoffDurationToReleaseTime(
// Decide between maximum release time and calculated release time, accounting
// for overflow with both.
- int64_t release_time_us =
- std::min(calculated_release_time_us.ValueOrDefault(kint64max),
- maximum_release_time_us.ValueOrDefault(kint64max));
+ int64_t release_time_us = std::min(calculated_release_time_us.ValueOrDefault(
+ std::numeric_limits<int64_t>::max()),
+ maximum_release_time_us.ValueOrDefault(
+ std::numeric_limits<int64_t>::max()));
return base::TimeTicks() + base::TimeDelta::FromMicroseconds(release_time_us);
}
« no previous file with comments | « net/base/backoff_entry.h ('k') | net/cert/ct_serialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698