| Index: base/time/time.cc
|
| diff --git a/base/time/time.cc b/base/time/time.cc
|
| index 2c6388608ed714c9264cddb7d34804e568bdd6f5..4605d56ee007dba02029e17d9601618d528e23da 100644
|
| --- a/base/time/time.cc
|
| +++ b/base/time/time.cc
|
| @@ -17,81 +17,40 @@
|
|
|
| // TimeDelta ------------------------------------------------------------------
|
|
|
| -// static
|
| -TimeDelta TimeDelta::Max() {
|
| - return TimeDelta(std::numeric_limits<int64>::max());
|
| -}
|
| -
|
| int TimeDelta::InDays() const {
|
| - if (is_max()) {
|
| - // Preserve max to prevent overflow.
|
| - return std::numeric_limits<int>::max();
|
| - }
|
| return static_cast<int>(delta_ / Time::kMicrosecondsPerDay);
|
| }
|
|
|
| int TimeDelta::InHours() const {
|
| - if (is_max()) {
|
| - // Preserve max to prevent overflow.
|
| - return std::numeric_limits<int>::max();
|
| - }
|
| return static_cast<int>(delta_ / Time::kMicrosecondsPerHour);
|
| }
|
|
|
| int TimeDelta::InMinutes() const {
|
| - if (is_max()) {
|
| - // Preserve max to prevent overflow.
|
| - return std::numeric_limits<int>::max();
|
| - }
|
| return static_cast<int>(delta_ / Time::kMicrosecondsPerMinute);
|
| }
|
|
|
| double TimeDelta::InSecondsF() const {
|
| - if (is_max()) {
|
| - // Preserve max to prevent overflow.
|
| - return std::numeric_limits<double>::infinity();
|
| - }
|
| return static_cast<double>(delta_) / Time::kMicrosecondsPerSecond;
|
| }
|
|
|
| int64 TimeDelta::InSeconds() const {
|
| - if (is_max()) {
|
| - // Preserve max to prevent overflow.
|
| - return std::numeric_limits<int64>::max();
|
| - }
|
| return delta_ / Time::kMicrosecondsPerSecond;
|
| }
|
|
|
| double TimeDelta::InMillisecondsF() const {
|
| - if (is_max()) {
|
| - // Preserve max to prevent overflow.
|
| - return std::numeric_limits<double>::infinity();
|
| - }
|
| return static_cast<double>(delta_) / Time::kMicrosecondsPerMillisecond;
|
| }
|
|
|
| int64 TimeDelta::InMilliseconds() const {
|
| - if (is_max()) {
|
| - // Preserve max to prevent overflow.
|
| - return std::numeric_limits<int64>::max();
|
| - }
|
| return delta_ / Time::kMicrosecondsPerMillisecond;
|
| }
|
|
|
| int64 TimeDelta::InMillisecondsRoundedUp() const {
|
| - if (is_max()) {
|
| - // Preserve max to prevent overflow.
|
| - return std::numeric_limits<int64>::max();
|
| - }
|
| return (delta_ + Time::kMicrosecondsPerMillisecond - 1) /
|
| Time::kMicrosecondsPerMillisecond;
|
| }
|
|
|
| int64 TimeDelta::InMicroseconds() const {
|
| - if (is_max()) {
|
| - // Preserve max to prevent overflow.
|
| - return std::numeric_limits<int64>::max();
|
| - }
|
| return delta_;
|
| }
|
|
|
|
|