diff options
author | rmcilroy <rmcilroy@chromium.org> | 2014-10-08 04:28:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-08 11:28:26 +0000 |
commit | 05d2662cec862897675cad4616ddb9e31bdbf626 (patch) | |
tree | 9576fea15132d894a286191ee524d64eaf918493 /gin | |
parent | 0e0d15d2c30855673b458d6cce37554a28610ee0 (diff) | |
download | chromium_src-05d2662cec862897675cad4616ddb9e31bdbf626.zip chromium_src-05d2662cec862897675cad4616ddb9e31bdbf626.tar.gz chromium_src-05d2662cec862897675cad4616ddb9e31bdbf626.tar.bz2 |
Add implementation of MonotonicallyIncreasingTime to Gin's V8 platform implementation.
BUG=417668
Review URL: https://codereview.chromium.org/634523002
Cr-Commit-Position: refs/heads/master@{#298684}
Diffstat (limited to 'gin')
-rw-r--r-- | gin/public/v8_platform.h | 1 | ||||
-rw-r--r-- | gin/v8_platform.cc | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/gin/public/v8_platform.h b/gin/public/v8_platform.h index 2df0f84..f085b58 100644 --- a/gin/public/v8_platform.h +++ b/gin/public/v8_platform.h @@ -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>; diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc index d50ff24..ec163de 100644 --- a/gin/v8_platform.cc +++ b/gin/v8_platform.cc @@ -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 |