Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: base/time/time.h

Issue 2548213005: Add base::time::FromJavaTime (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | base/time/time.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 // https://developer.apple.com/legacy/library/#technotes/tn/tn1150.html#HFSPlu sDates. 488 // https://developer.apple.com/legacy/library/#technotes/tn/tn1150.html#HFSPlu sDates.
489 static Time FromTimeSpec(const timespec& ts); 489 static Time FromTimeSpec(const timespec& ts);
490 #endif 490 #endif
491 491
492 // Converts to/from the Javascript convention for times, a number of 492 // Converts to/from the Javascript convention for times, a number of
493 // milliseconds since the epoch: 493 // milliseconds since the epoch:
494 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/g etTime. 494 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/g etTime.
495 static Time FromJsTime(double ms_since_epoch); 495 static Time FromJsTime(double ms_since_epoch);
496 double ToJsTime() const; 496 double ToJsTime() const;
497 497
498 // Converts to Java convention for times, a number of 498 // Converts to/from Java convention for times, a number of
499 // milliseconds since the epoch. 499 // milliseconds since the epoch.
500 static Time FromJavaTime(int64_t ms_since_epoch);
500 int64_t ToJavaTime() const; 501 int64_t ToJavaTime() const;
501 502
502 #if defined(OS_POSIX) 503 #if defined(OS_POSIX)
503 static Time FromTimeVal(struct timeval t); 504 static Time FromTimeVal(struct timeval t);
504 struct timeval ToTimeVal() const; 505 struct timeval ToTimeVal() const;
505 #endif 506 #endif
506 507
507 #if defined(OS_MACOSX) 508 #if defined(OS_MACOSX)
508 static Time FromCFAbsoluteTime(CFAbsoluteTime t); 509 static Time FromCFAbsoluteTime(CFAbsoluteTime t);
509 CFAbsoluteTime ToCFAbsoluteTime() const; 510 CFAbsoluteTime ToCFAbsoluteTime() const;
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 static void WaitUntilInitializedWin(); 851 static void WaitUntilInitializedWin();
851 #endif 852 #endif
852 }; 853 };
853 854
854 // For logging use only. 855 // For logging use only.
855 BASE_EXPORT std::ostream& operator<<(std::ostream& os, ThreadTicks time_ticks); 856 BASE_EXPORT std::ostream& operator<<(std::ostream& os, ThreadTicks time_ticks);
856 857
857 } // namespace base 858 } // namespace base
858 859
859 #endif // BASE_TIME_TIME_H_ 860 #endif // BASE_TIME_TIME_H_
OLDNEW
« no previous file with comments | « no previous file | base/time/time.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698