Chromium Code Reviews| Index: src/platform/time.h |
| diff --git a/src/platform/time.h b/src/platform/time.h |
| index 3fed6287fe0d1e0b2bdd0b79830285ae9b2da88a..2777cee08d9a6fb9393f1463057b468fec4b3530 100644 |
| --- a/src/platform/time.h |
| +++ b/src/platform/time.h |
| @@ -222,6 +222,15 @@ class Time V8_FINAL BASE_EMBEDDED { |
| // with which we might compare it. |
| static Time Max() { return Time(std::numeric_limits<int64_t>::max()); } |
| + // Converts to/from internal values. The meaning of the "internal value" is |
| + // completely up to the implementation, so it should be treated as opaque. |
| + static Time FromInternalValue(int64_t value) V8_WARN_UNUSED_RESULT { |
|
Michael Starzinger
2013/09/09 17:11:25
Ceterum censeo V8_WARN_UNUSED_RESULT esse delendam
Benedikt Meurer
2013/09/10 06:08:07
Done.
|
| + return Time(value); |
| + } |
| + int64_t ToInternalValue() const V8_WARN_UNUSED_RESULT { |
|
Michael Starzinger
2013/09/09 17:11:25
Ceterum censeo V8_WARN_UNUSED_RESULT esse delendam
Benedikt Meurer
2013/09/10 06:08:07
Done.
|
| + return us_; |
| + } |
| + |
| // Converts to/from POSIX time specs. |
| static Time FromTimespec(struct timespec ts); |
| struct timespec ToTimespec() const; |
| @@ -329,6 +338,15 @@ class TimeTicks V8_FINAL BASE_EMBEDDED { |
| // Returns true if this object has not been initialized. |
| bool IsNull() const { return ticks_ == 0; } |
| + // Converts to/from internal values. The meaning of the "internal value" is |
| + // completely up to the implementation, so it should be treated as opaque. |
| + static TimeTicks FromInternalValue(int64_t value) V8_WARN_UNUSED_RESULT { |
|
Michael Starzinger
2013/09/09 17:11:25
Ceterum censeo V8_WARN_UNUSED_RESULT esse delendam
Benedikt Meurer
2013/09/10 06:08:07
Done.
|
| + return TimeTicks(value); |
| + } |
| + int64_t ToInternalValue() const V8_WARN_UNUSED_RESULT { |
|
Michael Starzinger
2013/09/09 17:11:25
Ceterum censeo V8_WARN_UNUSED_RESULT esse delendam
Benedikt Meurer
2013/09/10 06:08:07
Done.
|
| + return ticks_; |
| + } |
| + |
| TimeTicks& operator=(const TimeTicks other) { |
| ticks_ = other.ticks_; |
| return *this; |