 Chromium Code Reviews
 Chromium Code Reviews Issue 10916089:
  Fixing Time::Max()'s behavior with Time::ToTimeT() and friends.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 10916089:
  Fixing Time::Max()'s behavior with Time::ToTimeT() and friends.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| Index: base/time_mac.cc | 
| diff --git a/base/time_mac.cc b/base/time_mac.cc | 
| index 98641bb98b8ee6a9ba3b0ce0379bcf7edd1ac5d3..3fadf9b7635d4bc4963196b8a8921ecd48cbad93 100644 | 
| --- a/base/time_mac.cc | 
| +++ b/base/time_mac.cc | 
| @@ -54,6 +54,8 @@ Time Time::Now() { | 
| Time Time::FromCFAbsoluteTime(CFAbsoluteTime t) { | 
| if (t == 0) | 
| return Time(); // Consider 0 as a null Time. | 
| + if (static_cast<int64>(t) == std::numeric_limits<int64>::max()) | 
| 
Mark Mentovai
2012/09/05 15:27:53
This is very weird. Did std::numeric_limits<CFAbso
 | 
| + return Max(); | 
| return Time(static_cast<int64>( | 
| (t + kCFAbsoluteTimeIntervalSince1970) * kMicrosecondsPerSecond) + | 
| kWindowsEpochDeltaMicroseconds); | 
| @@ -62,6 +64,8 @@ Time Time::FromCFAbsoluteTime(CFAbsoluteTime t) { | 
| CFAbsoluteTime Time::ToCFAbsoluteTime() const { | 
| if (is_null()) | 
| return 0; // Consider 0 as a null Time. | 
| + if (is_max()) | 
| + return static_cast<CFAbsoluteTime>(std::numeric_limits<int64>::max()); | 
| 
Mark Mentovai
2012/09/05 15:27:53
Same.
 | 
| return (static_cast<CFAbsoluteTime>(us_ - kWindowsEpochDeltaMicroseconds) / | 
| kMicrosecondsPerSecond) - kCFAbsoluteTimeIntervalSince1970; | 
| } |