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

Unified Diff: src/platform/time.h

Issue 23748003: Cleanup Semaphore class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Build fix for Mac OS X. Created 7 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform/semaphore.cc ('k') | src/platform/time.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/time.h
diff --git a/src/platform/time.h b/src/platform/time.h
index 57b894d814b87b862d1e8c687000fd89829218d3..a0d5425b1949a5ce11fcae151834b34d2df6b2ef 100644
--- a/src/platform/time.h
+++ b/src/platform/time.h
@@ -36,6 +36,8 @@
// Forward declarations.
extern "C" {
struct _FILETIME;
+struct mach_timespec;
+struct timespec;
struct timeval;
}
@@ -82,6 +84,10 @@ class TimeDelta V8_FINAL BASE_EMBEDDED {
int64_t InMicroseconds() const { return delta_; }
int64_t InNanoseconds() const;
+ // Converts to/from Mach time specs.
+ static TimeDelta FromMachTimespec(struct mach_timespec ts);
+ struct mach_timespec ToMachTimespec() const;
+
TimeDelta& operator=(const TimeDelta& other) {
delta_ = other.delta_;
return *this;
@@ -212,6 +218,10 @@ 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 POSIX time specs.
+ static Time FromTimespec(struct timespec ts);
+ struct timespec ToTimespec() const;
+
// Converts to/from POSIX time values.
static Time FromTimeval(struct timeval tv);
struct timeval ToTimeval() const;
« no previous file with comments | « src/platform/semaphore.cc ('k') | src/platform/time.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698