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

Unified Diff: base/time.h

Issue 10916089: Fixing Time::Max()'s behavior with Time::ToTimeT() and friends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | « no previous file | base/time.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time.h
diff --git a/base/time.h b/base/time.h
index 4d9bf350c598c336ed8e2c81b8bf65dadbd9ed4d..ceed500f5640286f8ac06c4e5e1c58bdedd0f51f 100644
--- a/base/time.h
+++ b/base/time.h
@@ -45,6 +45,8 @@
#include <windows.h>
#endif
+#include <limits>
+
namespace base {
class Time;
@@ -246,6 +248,11 @@ class BASE_EXPORT Time {
return us_ == 0;
}
+ // Returns true if the time object is the maximum time.
+ bool is_max() const {
+ return us_ == std::numeric_limits<int64>::max();
+ }
+
// Returns the time for epoch in Unix-like system (Jan 1, 1970).
static Time UnixEpoch();
« no previous file with comments | « no previous file | base/time.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698