Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
src: update GetForegroundTaskRunner override
  • Loading branch information
etiennep-chromium authored and targos committed Jan 30, 2025
commit 8253b2712bc41ead60dda0467dc7280bb66d15dd
4 changes: 2 additions & 2 deletions src/node_platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,8 @@ bool NodePlatform::IdleTasksEnabled(Isolate* isolate) {
return ForIsolate(isolate)->IdleTasksEnabled();
}

std::shared_ptr<v8::TaskRunner>
NodePlatform::GetForegroundTaskRunner(Isolate* isolate) {
std::shared_ptr<v8::TaskRunner> NodePlatform::GetForegroundTaskRunner(
Isolate* isolate, v8::TaskPriority priority) {
return ForIsolate(isolate)->GetForegroundTaskRunner();
}

Expand Down
2 changes: 1 addition & 1 deletion src/node_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class NodePlatform : public MultiIsolatePlatform {
void* data) override;

std::shared_ptr<v8::TaskRunner> GetForegroundTaskRunner(
v8::Isolate* isolate) override;
v8::Isolate* isolate, v8::TaskPriority priority) override;

Platform::StackTracePrinter GetStackTracePrinter() override;
v8::PageAllocator* GetPageAllocator() override;
Expand Down
6 changes: 4 additions & 2 deletions test/cctest/test_platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class RepostingTask : public v8::Task {
if (repost_count_ > 0) {
--repost_count_;
std::shared_ptr<v8::TaskRunner> task_runner =
platform_->GetForegroundTaskRunner(isolate_);
platform_->GetForegroundTaskRunner(isolate_,
v8::TaskPriority::kUserBlocking);
task_runner->PostTask(std::make_unique<RepostingTask>(
repost_count_, run_count_, isolate_, platform_));
}
Expand All @@ -46,7 +47,8 @@ TEST_F(PlatformTest, SkipNewTasksInFlushForegroundTasks) {
Env env {handle_scope, argv};
int run_count = 0;
std::shared_ptr<v8::TaskRunner> task_runner =
platform->GetForegroundTaskRunner(isolate_);
platform->GetForegroundTaskRunner(isolate_,
v8::TaskPriority::kUserBlocking);
task_runner->PostTask(
std::make_unique<RepostingTask>(2, &run_count, isolate_, platform.get()));
EXPECT_TRUE(platform->FlushForegroundTasks(isolate_));
Expand Down