commit | 49cd773cf2e325f00481b876b543a5540bb461fc | [log] [tgz] |
---|---|---|
author | ulan <[email protected]> | Wed Jun 24 16:38:08 2015 |
committer | Commit bot <[email protected]> | Wed Jun 24 16:38:54 2015 |
tree | 6fe38ae57ba3dddcb47b74715d026dd52c3de7fb | |
parent | 7af486bccd1c3db4b8ded4ad66fcb28c976974af [diff] [blame] |
Reland "Implement V8Platform::CallDelayedOnForegroundThread. (patchset #2 id:20001 of https://codereview.chromium.org/1181113003/)" This reverts commit f4f00c7a28bb5786f5dce52acf4e8bd2d39df6a2. BUG=490559 Review URL: https://codereview.chromium.org/1204873003 Cr-Commit-Position: refs/heads/master@{#335937}
diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc index 330aeb3..6214d3d3 100644 --- a/gin/v8_platform.cc +++ b/gin/v8_platform.cc
@@ -38,6 +38,14 @@ FROM_HERE, base::Bind(&v8::Task::Run, base::Owned(task))); } +void V8Platform::CallDelayedOnForegroundThread(v8::Isolate* isolate, + v8::Task* task, + double delay_in_seconds) { + PerIsolateData::From(isolate)->task_runner()->PostDelayedTask( + FROM_HERE, base::Bind(&v8::Task::Run, base::Owned(task)), + base::TimeDelta::FromSecondsD(delay_in_seconds)); +} + double V8Platform::MonotonicallyIncreasingTime() { return base::TimeTicks::Now().ToInternalValue() / static_cast<double>(base::Time::kMicrosecondsPerSecond);