[API] Remove deprecated tasks API
It has been deprecated in v7.9, but needed to be changed again for v8.0 by providing a default implementation. This allowed embedders to remove all overrides. We can now remove the definitions in v8.1. R=ulan@chromium.org CC=ahaas@chromium.org Bug: v8:9810 Change-Id: I9d303bf8a01d863bce3522abccdd3ded5e551818 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1868620 Reviewed-by: Andreas Haas <ahaas@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Clemens Backes <clemensb@chromium.org> Cr-Commit-Position: refs/heads/master@{#65633}
This commit is contained in:
parent
947142734a
commit
95aba36b52
@ -362,39 +362,6 @@ class Platform {
|
||||
virtual void CallDelayedOnWorkerThread(std::unique_ptr<Task> task,
|
||||
double delay_in_seconds) = 0;
|
||||
|
||||
/**
|
||||
* Schedules a task to be invoked on a foreground thread wrt a specific
|
||||
* |isolate|. Tasks posted for the same isolate should be execute in order of
|
||||
* scheduling. The definition of "foreground" is opaque to V8.
|
||||
*/
|
||||
V8_DEPRECATED("Use a taskrunner acquired by GetForegroundTaskRunner instead.")
|
||||
virtual void CallOnForegroundThread(Isolate* isolate, Task* task) { abort(); }
|
||||
|
||||
/**
|
||||
* Schedules a task to be invoked on a foreground thread wrt a specific
|
||||
* |isolate| after the given number of seconds |delay_in_seconds|.
|
||||
* Tasks posted for the same isolate should be execute in order of
|
||||
* scheduling. The definition of "foreground" is opaque to V8.
|
||||
*/
|
||||
V8_DEPRECATED("Use a taskrunner acquired by GetForegroundTaskRunner instead.")
|
||||
virtual void CallDelayedOnForegroundThread(Isolate* isolate, Task* task,
|
||||
double delay_in_seconds) {
|
||||
abort();
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedules a task to be invoked on a foreground thread wrt a specific
|
||||
* |isolate| when the embedder is idle.
|
||||
* Requires that SupportsIdleTasks(isolate) is true.
|
||||
* Idle tasks may be reordered relative to other task types and may be
|
||||
* starved for an arbitrarily long time if no idle time is available.
|
||||
* The definition of "foreground" is opaque to V8.
|
||||
*/
|
||||
V8_DEPRECATED("Use a taskrunner acquired by GetForegroundTaskRunner instead.")
|
||||
virtual void CallIdleOnForegroundThread(Isolate* isolate, IdleTask* task) {
|
||||
abort();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if idle tasks are enabled for the given |isolate|.
|
||||
*/
|
||||
|
@ -53,21 +53,6 @@ class PredictablePlatform : public Platform {
|
||||
// Never run delayed tasks.
|
||||
}
|
||||
|
||||
void CallOnForegroundThread(v8::Isolate* isolate, Task* task) override {
|
||||
// This is a deprecated function and should not be called anymore.
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
void CallDelayedOnForegroundThread(v8::Isolate* isolate, Task* task,
|
||||
double delay_in_seconds) override {
|
||||
// This is a deprecated function and should not be called anymore.
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
void CallIdleOnForegroundThread(Isolate* isolate, IdleTask* task) override {
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
bool IdleTasksEnabled(Isolate* isolate) override { return false; }
|
||||
|
||||
double MonotonicallyIncreasingTime() override {
|
||||
@ -162,22 +147,6 @@ class DelayedTasksPlatform : public Platform {
|
||||
delay_in_seconds);
|
||||
}
|
||||
|
||||
void CallOnForegroundThread(v8::Isolate* isolate, Task* task) override {
|
||||
// This is a deprecated function and should not be called anymore.
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
void CallDelayedOnForegroundThread(v8::Isolate* isolate, Task* task,
|
||||
double delay_in_seconds) override {
|
||||
// This is a deprecated function and should not be called anymore.
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
void CallIdleOnForegroundThread(Isolate* isolate, IdleTask* task) override {
|
||||
// This is a deprecated function and should not be called anymore.
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
bool IdleTasksEnabled(Isolate* isolate) override {
|
||||
return platform_->IdleTasksEnabled(isolate);
|
||||
}
|
||||
|
@ -193,23 +193,6 @@ void DefaultPlatform::CallDelayedOnWorkerThread(std::unique_ptr<Task> task,
|
||||
delay_in_seconds);
|
||||
}
|
||||
|
||||
void DefaultPlatform::CallOnForegroundThread(v8::Isolate* isolate, Task* task) {
|
||||
GetForegroundTaskRunner(isolate)->PostTask(std::unique_ptr<Task>(task));
|
||||
}
|
||||
|
||||
void DefaultPlatform::CallDelayedOnForegroundThread(Isolate* isolate,
|
||||
Task* task,
|
||||
double delay_in_seconds) {
|
||||
GetForegroundTaskRunner(isolate)->PostDelayedTask(std::unique_ptr<Task>(task),
|
||||
delay_in_seconds);
|
||||
}
|
||||
|
||||
void DefaultPlatform::CallIdleOnForegroundThread(Isolate* isolate,
|
||||
IdleTask* task) {
|
||||
GetForegroundTaskRunner(isolate)->PostIdleTask(
|
||||
std::unique_ptr<IdleTask>(task));
|
||||
}
|
||||
|
||||
bool DefaultPlatform::IdleTasksEnabled(Isolate* isolate) {
|
||||
return idle_task_support_ == IdleTaskSupport::kEnabled;
|
||||
}
|
||||
|
@ -61,10 +61,6 @@ class V8_PLATFORM_EXPORT DefaultPlatform : public NON_EXPORTED_BASE(Platform) {
|
||||
void CallOnWorkerThread(std::unique_ptr<Task> task) override;
|
||||
void CallDelayedOnWorkerThread(std::unique_ptr<Task> task,
|
||||
double delay_in_seconds) override;
|
||||
void CallOnForegroundThread(v8::Isolate* isolate, Task* task) override;
|
||||
void CallDelayedOnForegroundThread(Isolate* isolate, Task* task,
|
||||
double delay_in_seconds) override;
|
||||
void CallIdleOnForegroundThread(Isolate* isolate, IdleTask* task) override;
|
||||
bool IdleTasksEnabled(Isolate* isolate) override;
|
||||
double MonotonicallyIncreasingTime() override;
|
||||
double CurrentClockTimeMillis() override;
|
||||
|
@ -707,17 +707,6 @@ class TestPlatform : public v8::Platform {
|
||||
old_platform_->CallDelayedOnWorkerThread(std::move(task), delay_in_seconds);
|
||||
}
|
||||
|
||||
void CallOnForegroundThread(v8::Isolate* isolate, v8::Task* task) override {
|
||||
// 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 {
|
||||
// This is a deprecated function and should not be called anymore.
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
double MonotonicallyIncreasingTime() override {
|
||||
return old_platform_->MonotonicallyIncreasingTime();
|
||||
}
|
||||
@ -726,12 +715,6 @@ class TestPlatform : public v8::Platform {
|
||||
return old_platform_->CurrentClockTimeMillis();
|
||||
}
|
||||
|
||||
void CallIdleOnForegroundThread(v8::Isolate* isolate,
|
||||
v8::IdleTask* task) override {
|
||||
// This is a deprecated function and should not be called anymore.
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
bool IdleTasksEnabled(v8::Isolate* isolate) override {
|
||||
return old_platform_->IdleTasksEnabled(isolate);
|
||||
}
|
||||
|
@ -32,10 +32,6 @@ class MockPlatformForUnmapper : public TestPlatform {
|
||||
worker_tasks_.clear();
|
||||
}
|
||||
|
||||
void CallOnForegroundThread(v8::Isolate* isolate, Task* task) override {
|
||||
task_ = task;
|
||||
}
|
||||
|
||||
void CallOnWorkerThread(std::unique_ptr<Task> task) override {
|
||||
worker_tasks_.push_back(std::move(task));
|
||||
}
|
||||
|
@ -38,10 +38,6 @@ class MockPlatform final : public TestPlatform {
|
||||
return task_runner_;
|
||||
}
|
||||
|
||||
void CallOnForegroundThread(v8::Isolate* isolate, Task* task) override {
|
||||
task_runner_->PostTask(std::unique_ptr<Task>(task));
|
||||
}
|
||||
|
||||
void CallOnWorkerThread(std::unique_ptr<v8::Task> task) override {
|
||||
task_runner_->PostTask(std::move(task));
|
||||
}
|
||||
|
@ -137,23 +137,6 @@ class MockPlatform : public v8::Platform {
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
void CallOnForegroundThread(v8::Isolate* isolate, Task* task) override {
|
||||
base::MutexGuard lock(&mutex_);
|
||||
foreground_tasks_.push_back(std::unique_ptr<Task>(task));
|
||||
}
|
||||
|
||||
void CallDelayedOnForegroundThread(v8::Isolate* isolate, Task* task,
|
||||
double delay_in_seconds) override {
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
void CallIdleOnForegroundThread(v8::Isolate* isolate,
|
||||
IdleTask* task) override {
|
||||
base::MutexGuard lock(&mutex_);
|
||||
ASSERT_TRUE(idle_task_ == nullptr);
|
||||
idle_task_ = task;
|
||||
}
|
||||
|
||||
bool IdleTasksEnabled(v8::Isolate* isolate) override { return true; }
|
||||
|
||||
double MonotonicallyIncreasingTime() override {
|
||||
|
Loading…
Reference in New Issue
Block a user