Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d760572

Browse filesBrowse files
cjihrigBethGriggs
authored andcommitted
src: remove use of CallOnForegroundThread()
The V8 platform's CallOnForegroundThread() method is deprecated. This commit replaces its use with GetForegroundTaskRunner() functionality instead. PR-URL: #24925 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent e050a57 commit d760572
Copy full SHA for d760572

File tree

Expand file treeCollapse file tree

2 files changed

+9
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-4
lines changed
Open diff view settings
Collapse file

‎src/inspector/main_thread_interface.cc‎

Copy file name to clipboardExpand all lines: src/inspector/main_thread_interface.cc
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,9 @@ void MainThreadInterface::Post(std::unique_ptr<Request> request) {
255255
if (needs_notify) {
256256
CHECK_EQ(0, uv_async_send(&main_thread_request_->first));
257257
if (isolate_ != nullptr && platform_ != nullptr) {
258-
platform_->CallOnForegroundThread(isolate_,
259-
new DispatchMessagesTask(this));
258+
std::shared_ptr<v8::TaskRunner> taskrunner =
259+
platform_->GetForegroundTaskRunner(isolate_);
260+
taskrunner->PostTask(std::make_unique<DispatchMessagesTask>(this));
260261
isolate_->RequestInterrupt([](v8::Isolate* isolate, void* thread) {
261262
static_cast<MainThreadInterface*>(thread)->DispatchMessages();
262263
}, this);
Collapse file

‎src/inspector_agent.cc‎

Copy file name to clipboardExpand all lines: src/inspector_agent.cc
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ using v8::Local;
4040
using v8::Message;
4141
using v8::Object;
4242
using v8::String;
43+
using v8::Task;
44+
using v8::TaskRunner;
4345
using v8::Value;
4446

4547
using v8_inspector::StringBuffer;
@@ -50,7 +52,7 @@ using v8_inspector::V8InspectorClient;
5052
static uv_sem_t start_io_thread_semaphore;
5153
static uv_async_t start_io_thread_async;
5254

53-
class StartIoTask : public v8::Task {
55+
class StartIoTask : public Task {
5456
public:
5557
explicit StartIoTask(Agent* agent) : agent(agent) {}
5658

@@ -861,7 +863,9 @@ void Agent::RequestIoThreadStart() {
861863
uv_async_send(&start_io_thread_async);
862864
Isolate* isolate = parent_env_->isolate();
863865
v8::Platform* platform = parent_env_->isolate_data()->platform();
864-
platform->CallOnForegroundThread(isolate, new StartIoTask(this));
866+
std::shared_ptr<TaskRunner> taskrunner =
867+
platform->GetForegroundTaskRunner(isolate);
868+
taskrunner->PostTask(std::make_unique<StartIoTask>(this));
865869
isolate->RequestInterrupt(StartIoInterrupt, this);
866870
uv_async_send(&start_io_thread_async);
867871
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.