diff options
author | Michaƫl Zasso <targos@protonmail.com> | 2019-05-25 18:07:32 +0200 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-05-30 15:51:37 +0200 |
commit | 2c640bfa46a2fdc2f0e9e88c0377759fa82d9f32 (patch) | |
tree | 69d8038571ffc7623a0d77ed9663e509239df0c4 /test/cctest/test_platform.cc | |
parent | 6a3d7cffab187a4430a4b84b6dc2e92a35f82042 (diff) | |
download | android-node-v8-2c640bfa46a2fdc2f0e9e88c0377759fa82d9f32.tar.gz android-node-v8-2c640bfa46a2fdc2f0e9e88c0377759fa82d9f32.tar.bz2 android-node-v8-2c640bfa46a2fdc2f0e9e88c0377759fa82d9f32.zip |
src: unimplement deprecated v8-platform methods
This removes the implementations of NodePlatform::CallOnForegroundThread
and NodePlatform::CallDelayedOnForegroundThread and updates the
test_platform cctest to stop using them.
PR-URL: https://github.com/nodejs/node/pull/27872
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'test/cctest/test_platform.cc')
-rw-r--r-- | test/cctest/test_platform.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/cctest/test_platform.cc b/test/cctest/test_platform.cc index 876547480b..5420502124 100644 --- a/test/cctest/test_platform.cc +++ b/test/cctest/test_platform.cc @@ -23,8 +23,10 @@ class RepostingTask : public v8::Task { ++*run_count_; if (repost_count_ > 0) { --repost_count_; - platform_->CallOnForegroundThread(isolate_, - new RepostingTask(repost_count_, run_count_, isolate_, platform_)); + std::shared_ptr<v8::TaskRunner> task_runner = + platform_->GetForegroundTaskRunner(isolate_); + task_runner->PostTask(std::make_unique<RepostingTask>( + repost_count_, run_count_, isolate_, platform_)); } } @@ -43,8 +45,10 @@ TEST_F(PlatformTest, SkipNewTasksInFlushForegroundTasks) { const Argv argv; Env env {handle_scope, argv}; int run_count = 0; - platform->CallOnForegroundThread( - isolate_, new RepostingTask(2, &run_count, isolate_, platform.get())); + std::shared_ptr<v8::TaskRunner> task_runner = + platform->GetForegroundTaskRunner(isolate_); + task_runner->PostTask( + std::make_unique<RepostingTask>(2, &run_count, isolate_, platform.get())); EXPECT_TRUE(platform->FlushForegroundTasks(isolate_)); EXPECT_EQ(1, run_count); EXPECT_TRUE(platform->FlushForegroundTasks(isolate_)); |