Skip to content

Commit

Permalink
Add implementation of MonotonicallyIncreasingTime to Gin's V8 platfor…
Browse files Browse the repository at this point in the history
…m implementation.

BUG=417668

Review URL: https://codereview.chromium.org/634523002

Cr-Commit-Position: refs/heads/master@{#298684}
  • Loading branch information
rmcilroy authored and Commit bot committed Oct 8, 2014
1 parent 0e0d15d commit 05d2662
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions gin/public/v8_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class GIN_EXPORT V8Platform : public NON_EXPORTED_BASE(v8::Platform) {
v8::Platform::ExpectedRuntime expected_runtime) OVERRIDE;
virtual void CallOnForegroundThread(v8::Isolate* isolate,
v8::Task* task) OVERRIDE;
virtual double MonotonicallyIncreasingTime() OVERRIDE;
private:
friend struct base::DefaultLazyInstanceTraits<V8Platform>;

Expand Down
5 changes: 5 additions & 0 deletions gin/v8_platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@ void V8Platform::CallOnForegroundThread(v8::Isolate* isolate, v8::Task* task) {
FROM_HERE, base::Bind(&v8::Task::Run, base::Owned(task)));
}

double V8Platform::MonotonicallyIncreasingTime() {
return base::TimeTicks::Now().ToInternalValue() /
static_cast<double>(base::Time::kMicrosecondsPerSecond);
}

} // namespace gin

0 comments on commit 05d2662

Please sign in to comment.