[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/1261936
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56400}
This commit is contained in:
Andreas Haas 2018-10-04 16:27:45 +02:00 committed by Commit Bot
parent 2abb31a9d6
commit 3f8c6e0143
3 changed files with 21 additions and 10 deletions

View File

@ -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.
*/
V8_DEPRECATE_SOON(
"Use a taskrunner acquired by GetForegroundTaskRunner instead.",
virtual void CallDelayedOnForegroundThread(Isolate* isolate, Task* task,
double delay_in_seconds) = 0;
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();
}

View File

@ -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 {

View File

@ -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 {