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

Unified Diff: base/time/time.h

Issue 1782053004: Change how the quota system computes the total poolsize for temporary storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 2 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: base/time/time.h
diff --git a/base/time/time.h b/base/time/time.h
index 12e43d9e7a02cf52711684f389a49ac5e51237f2..01f7ef05560fe0708a81350cad33a68a8ef5e2e0 100644
--- a/base/time/time.h
+++ b/base/time/time.h
@@ -133,7 +133,7 @@ class BASE_EXPORT TimeDelta {
// Returns the maximum time delta, which should be greater than any reasonable
// time delta we might compare it to. Adding or subtracting the maximum time
// delta to a time or another time delta has an undefined result.
- static TimeDelta Max();
+ static constexpr TimeDelta Max();
// Returns the internal numeric value of the TimeDelta object. Please don't
// use this and do arithmetic on it, as it is more error prone than using the
@@ -662,6 +662,11 @@ constexpr TimeDelta TimeDelta::FromMicroseconds(int64_t us) {
}
// static
+constexpr TimeDelta TimeDelta::Max() {
+ return TimeDelta(std::numeric_limits<int64_t>::max());
+}
+
+// static
constexpr TimeDelta TimeDelta::FromDouble(double value) {
// TODO(crbug.com/612601): Use saturated_cast<int64_t>(value) once we sort out
// the Min() behavior.

Powered by Google App Engine
This is Rietveld 408576698