Skip to content

Commit

Permalink
Crash under IPC::Connection::setOutgoingMessageQueueIsGrowingLargeCal…
Browse files Browse the repository at this point in the history
…lback()'s lambda

https://bugs.webkit.org/show_bug.cgi?id=260033

Reviewed by Brent Fulgham.

The lambda may get called off the main thread, make sure we dispatch back to the main
thread before using the NetworkProcess object.

* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::m_allowTestOnlyIPC):

Canonical link: https://commits.webkit.org/266773@main
  • Loading branch information
cdumez committed Aug 10, 2023
1 parent c952560 commit bd5d32f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ NetworkConnectionToWebProcess::NetworkConnectionToWebProcess(NetworkProcess& net
m_connection->open(*this);
#if USE(RUNNINGBOARD)
m_connection->setOutgoingMessageQueueIsGrowingLargeCallback([weakThis = WeakPtr { *this }] {
if (weakThis)
weakThis->networkProcess().parentProcessConnection()->send(Messages::NetworkProcessProxy::WakeUpWebProcessForIPC(weakThis->m_webProcessIdentifier), 0);
ensureOnMainRunLoop([weakThis] {
if (weakThis)
weakThis->networkProcess().parentProcessConnection()->send(Messages::NetworkProcessProxy::WakeUpWebProcessForIPC(weakThis->m_webProcessIdentifier), 0);
});
});
#endif

Expand Down

0 comments on commit bd5d32f

Please sign in to comment.