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

Unified Diff: src/platform/time.h

Issue 23548024: Introduce a RandonNumberGenerator class. Refactor the random/private_random uses in Isolate/Context. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE 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-win32.cc ('k') | src/utils/random-number-generator.h » ('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 3fed6287fe0d1e0b2bdd0b79830285ae9b2da88a..2ce6cdd3e99137505243ca47d139eeab5f7a0e34 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) {
+ return Time(value);
+ }
+ int64_t ToInternalValue() const {
+ 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) {
+ return TimeTicks(value);
+ }
+ int64_t ToInternalValue() const {
+ return ticks_;
+ }
+
TimeTicks& operator=(const TimeTicks other) {
ticks_ = other.ticks_;
return *this;
« no previous file with comments | « src/platform-win32.cc ('k') | src/utils/random-number-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698