Commit 3f8c6e01 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[api][cleanup] Mark Call*OnForegroundThread as V8_DEPRECATE_SOON

These functions got replaced the the taskrunner API. The new way to
post tasks is as follows:

v8::Platform* platform = ...; // e.g. V8::GetCurrentPlatform();
v8::Isolate* = ...;

std::shared_ptr<v8::TaskRunner> taskrunner = platform->GetForegroundTaskRunner(isolate);
std::unique_ptr<v8::Task> task = ...;

taskrunner->PostTask(std::move(task));

R=ulan@chromium.org

Bug: v8:8238
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I44a70fc530daae581ee31e54fd09e776ba648406
Reviewed-on: https://chromium-review.googlesource.com/c/1261936Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56400}
parent 2abb31a9
......@@ -322,7 +322,9 @@ class Platform {
* |isolate|. Tasks posted for the same isolate should be execute in order of
* scheduling. The definition of "foreground" is opaque to V8.
*/
virtual void CallOnForegroundThread(Isolate* isolate, Task* task) = 0;
V8_DEPRECATE_SOON(
"Use a taskrunner acquired by GetForegroundTaskRunner instead.",
virtual void CallOnForegroundThread(Isolate* isolate, Task* task)) = 0;
/**
* Schedules a task to be invoked on a foreground thread wrt a specific
......@@ -330,8 +332,10 @@ class Platform {
* Tasks posted for the same isolate should be execute in order of
* scheduling. The definition of "foreground" is opaque to V8.
*/
virtual void CallDelayedOnForegroundThread(Isolate* isolate, Task* task,
double delay_in_seconds) = 0;
V8_DEPRECATE_SOON(
"Use a taskrunner acquired by GetForegroundTaskRunner instead.",
virtual void CallDelayedOnForegroundThread(Isolate* isolate, Task* task,
double delay_in_seconds)) = 0;
/**
* Schedules a task to be invoked on a foreground thread wrt a specific
......@@ -341,7 +345,10 @@ class Platform {
* starved for an arbitrarily long time if no idle time is available.
* The definition of "foreground" is opaque to V8.
*/
virtual void CallIdleOnForegroundThread(Isolate* isolate, IdleTask* task) {
V8_DEPRECATE_SOON(
"Use a taskrunner acquired by GetForegroundTaskRunner instead.",
virtual void CallIdleOnForegroundThread(Isolate* isolate,
IdleTask* task)) {
// This must be overriden if |IdleTasksEnabled()|.
abort();
}
......
......@@ -231,12 +231,14 @@ class PredictablePlatform : public Platform {
}
void CallOnForegroundThread(v8::Isolate* isolate, Task* task) override {
platform_->CallOnForegroundThread(isolate, task);
// This is a deprecated function and should not be called anymore.
UNREACHABLE();
}
void CallDelayedOnForegroundThread(v8::Isolate* isolate, Task* task,
double delay_in_seconds) override {
platform_->CallDelayedOnForegroundThread(isolate, task, delay_in_seconds);
// This is a deprecated function and should not be called anymore.
UNREACHABLE();
}
void CallIdleOnForegroundThread(Isolate* isolate, IdleTask* task) override {
......
......@@ -684,13 +684,14 @@ class TestPlatform : public v8::Platform {
}
void CallOnForegroundThread(v8::Isolate* isolate, v8::Task* task) override {
old_platform_->CallOnForegroundThread(isolate, task);
// This is a deprecated function and should not be called anymore.
UNREACHABLE();
}
void CallDelayedOnForegroundThread(v8::Isolate* isolate, v8::Task* task,
double delay_in_seconds) override {
old_platform_->CallDelayedOnForegroundThread(isolate, task,
delay_in_seconds);
// This is a deprecated function and should not be called anymore.
UNREACHABLE();
}
double MonotonicallyIncreasingTime() override {
......@@ -703,7 +704,8 @@ class TestPlatform : public v8::Platform {
void CallIdleOnForegroundThread(v8::Isolate* isolate,
v8::IdleTask* task) override {
old_platform_->CallIdleOnForegroundThread(isolate, task);
// This is a deprecated function and should not be called anymore.
UNREACHABLE();
}
bool IdleTasksEnabled(v8::Isolate* isolate) override {
......
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