Commit 50a876d2 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[platform] Implement TaskRunners on the PredictablePlatform

On the PredictablePlatform we return the ForegroundTaskRunner of the
underlying platform in both GetForeGroundTaskRunner and
GetBackgroundTaskRunner. The reason is that thereby we can enforce a
predictable, sequential execution of tasks.

R=clemensh@chromium.org, rmcilroy@chromium.org

Change-Id: Icec9fe52da922b1e75a3fb5b0155083be0a3a0fd
Reviewed-on: https://chromium-review.googlesource.com/771792Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49384}
parent 859af1b7
......@@ -211,6 +211,18 @@ class PredictablePlatform : public Platform {
DCHECK_NOT_NULL(platform_);
}
std::shared_ptr<TaskRunner> GetForegroundTaskRunner(
v8::Isolate* isolate) override {
return platform_->GetForegroundTaskRunner(isolate);
}
std::shared_ptr<TaskRunner> GetBackgroundTaskRunner(
v8::Isolate* isolate) override {
// Return the foreground task runner here, so that all tasks get executed
// sequentially in a predictable order.
return platform_->GetForegroundTaskRunner(isolate);
}
void CallOnBackgroundThread(Task* task,
ExpectedRuntime expected_runtime) override {
// It's not defined when background tasks are being executed, so we can just
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment