Chromium Code Reviews| Index: third_party/WebKit/Source/wtf/Time.h |
| diff --git a/third_party/WebKit/Source/wtf/Time.h b/third_party/WebKit/Source/wtf/Time.h |
| index 3bc5ae8c821e69001416ab360655be998ccc36fd..c8f69fac0e0537226ffcbc13b3731518142a0129 100644 |
| --- a/third_party/WebKit/Source/wtf/Time.h |
| +++ b/third_party/WebKit/Source/wtf/Time.h |
| @@ -43,6 +43,15 @@ class TimeWrapper { |
| return m_value.ToInternalValue(); |
| } |
| + // Only use this conversion when interfacing with legacy code that represents |
| + // time in double. Converting to double can lead to losing information for |
| + // large time values. |
| + double InSeconds() { return (m_value - WrappedTimeType()).InSecondsF(); } |
|
esprehn
2016/12/12 22:12:21
const
|
| + |
| + static TimeWrapper FromSeconds(double seconds) { |
| + return WrappedTimeType() + TimeDelta::FromSecondsD(seconds); |
| + } |
| + |
| TimeWrapper& operator=(TimeWrapper other) { |
| m_value = other.m_value; |
| return *this; |