| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Time represents an absolute point in coordinated universal time (UTC), | 5 // Time represents an absolute point in coordinated universal time (UTC), |
| 6 // internally represented as microseconds (s/1,000,000) since the Windows epoch | 6 // internally represented as microseconds (s/1,000,000) since the Windows epoch |
| 7 // (1601-01-01 00:00:00 UTC). System-dependent clock interface routines are | 7 // (1601-01-01 00:00:00 UTC). System-dependent clock interface routines are |
| 8 // defined in time_PLATFORM.cc. Note that values for Time may skew and jump | 8 // defined in time_PLATFORM.cc. Note that values for Time may skew and jump |
| 9 // around as the operating system makes adjustments to synchronize (e.g., with | 9 // around as the operating system makes adjustments to synchronize (e.g., with |
| 10 // NTP servers). Thus, client code that uses the Time class must account for | 10 // NTP servers). Thus, client code that uses the Time class must account for |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 ? Max() | 666 ? Max() |
| 667 : value < -std::numeric_limits<int64_t>::max() | 667 : value < -std::numeric_limits<int64_t>::max() |
| 668 ? -Max() | 668 ? -Max() |
| 669 : TimeDelta(static_cast<int64_t>(value)); | 669 : TimeDelta(static_cast<int64_t>(value)); |
| 670 } | 670 } |
| 671 | 671 |
| 672 // static | 672 // static |
| 673 constexpr TimeDelta TimeDelta::FromProduct(int64_t value, | 673 constexpr TimeDelta TimeDelta::FromProduct(int64_t value, |
| 674 int64_t positive_value) { | 674 int64_t positive_value) { |
| 675 return ( | 675 return ( |
| 676 #if !defined(_PREFAST_) || !defined(OS_WIN) | 676 #if false && (!defined(_PREFAST_) || !defined(OS_WIN)) |
| 677 // Avoid internal compiler errors in /analyze builds with VS 2015 | 677 // Avoid internal compiler errors in /analyze builds with VS 2015 |
| 678 // update 3. | 678 // update 3. |
| 679 // https://connect.microsoft.com/VisualStudio/feedback/details/2870865 | 679 // https://connect.microsoft.com/VisualStudio/feedback/details/2870865 |
| 680 DCHECK(positive_value > 0), | 680 DCHECK(positive_value > 0), |
| 681 #endif | 681 #endif |
| 682 value > std::numeric_limits<int64_t>::max() / positive_value | 682 value > std::numeric_limits<int64_t>::max() / positive_value |
| 683 ? Max() | 683 ? Max() |
| 684 : value < -std::numeric_limits<int64_t>::max() / positive_value | 684 : value < -std::numeric_limits<int64_t>::max() / positive_value |
| 685 ? -Max() | 685 ? -Max() |
| 686 : TimeDelta(value * positive_value)); | 686 : TimeDelta(value * positive_value)); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 static void WaitUntilInitializedWin(); | 839 static void WaitUntilInitializedWin(); |
| 840 #endif | 840 #endif |
| 841 }; | 841 }; |
| 842 | 842 |
| 843 // For logging use only. | 843 // For logging use only. |
| 844 BASE_EXPORT std::ostream& operator<<(std::ostream& os, ThreadTicks time_ticks); | 844 BASE_EXPORT std::ostream& operator<<(std::ostream& os, ThreadTicks time_ticks); |
| 845 | 845 |
| 846 } // namespace base | 846 } // namespace base |
| 847 | 847 |
| 848 #endif // BASE_TIME_TIME_H_ | 848 #endif // BASE_TIME_TIME_H_ |
| OLD | NEW |