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 time, internally represented as | 5 // Time represents an absolute point in time, internally represented as |
6 // microseconds (s/1,000,000) since the Windows epoch (1601-01-01 00:00:00 UTC) | 6 // microseconds (s/1,000,000) since the Windows epoch (1601-01-01 00:00:00 UTC) |
7 // (See http://crbug.com/14734). System-dependent clock interface routines are | 7 // (See http://crbug.com/14734). System-dependent clock interface routines are |
8 // defined in time_PLATFORM.cc. | 8 // defined in time_PLATFORM.cc. |
9 // | 9 // |
10 // TimeDelta represents a duration of time, internally represented in | 10 // TimeDelta represents a duration of time, internally represented in |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 // https://developer.apple.com/legacy/library/#technotes/tn/tn1150.html#HFSPlu
sDates. | 293 // https://developer.apple.com/legacy/library/#technotes/tn/tn1150.html#HFSPlu
sDates. |
294 static Time FromTimeSpec(const timespec& ts); | 294 static Time FromTimeSpec(const timespec& ts); |
295 #endif | 295 #endif |
296 | 296 |
297 // Converts to/from the Javascript convention for times, a number of | 297 // Converts to/from the Javascript convention for times, a number of |
298 // milliseconds since the epoch: | 298 // milliseconds since the epoch: |
299 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/g
etTime. | 299 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/g
etTime. |
300 static Time FromJsTime(double ms_since_epoch); | 300 static Time FromJsTime(double ms_since_epoch); |
301 double ToJsTime() const; | 301 double ToJsTime() const; |
302 | 302 |
| 303 // Converts to Java convention for times, a number of |
| 304 // milliseconds since the epoch. |
| 305 int64 ToJavaTime() const; |
| 306 |
303 #if defined(OS_POSIX) | 307 #if defined(OS_POSIX) |
304 static Time FromTimeVal(struct timeval t); | 308 static Time FromTimeVal(struct timeval t); |
305 struct timeval ToTimeVal() const; | 309 struct timeval ToTimeVal() const; |
306 #endif | 310 #endif |
307 | 311 |
308 #if defined(OS_MACOSX) | 312 #if defined(OS_MACOSX) |
309 static Time FromCFAbsoluteTime(CFAbsoluteTime t); | 313 static Time FromCFAbsoluteTime(CFAbsoluteTime t); |
310 CFAbsoluteTime ToCFAbsoluteTime() const; | 314 CFAbsoluteTime ToCFAbsoluteTime() const; |
311 #endif | 315 #endif |
312 | 316 |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 #endif | 673 #endif |
670 }; | 674 }; |
671 | 675 |
672 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { | 676 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { |
673 return TimeTicks(t.ticks_ + delta_); | 677 return TimeTicks(t.ticks_ + delta_); |
674 } | 678 } |
675 | 679 |
676 } // namespace base | 680 } // namespace base |
677 | 681 |
678 #endif // BASE_TIME_TIME_H_ | 682 #endif // BASE_TIME_TIME_H_ |
OLD | NEW |