Skip to content

Commit

Permalink
IPC testing API tries to allocate JS objects during sweeping
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=270328

Reviewed by Mark Lam.

Delay the IPC until the next run loop to avoid sending in the middle of sweeping.

* Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):

Canonical link: https://commits.webkit.org/275577@main
  • Loading branch information
rniwa committed Mar 1, 2024
1 parent 81d1596 commit afa8e8e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ void WebSWClientConnection::addServiceWorkerRegistrationInServer(ServiceWorkerRe

void WebSWClientConnection::removeServiceWorkerRegistrationInServer(ServiceWorkerRegistrationIdentifier identifier)
{
if (WebProcess::singleton().removeServiceWorkerRegistration(identifier))
send(Messages::WebSWServerConnection::RemoveServiceWorkerRegistrationInServer { identifier });
if (WebProcess::singleton().removeServiceWorkerRegistration(identifier)) {
RunLoop::main().dispatch([identifier, connection = Ref { *this }]() {
connection->send(Messages::WebSWServerConnection::RemoveServiceWorkerRegistrationInServer { identifier });
});
}
}

void WebSWClientConnection::scheduleUnregisterJobInServer(ServiceWorkerRegistrationIdentifier registrationIdentifier, WebCore::ServiceWorkerOrClientIdentifier documentIdentifier, CompletionHandler<void(ExceptionOr<bool>&&)>&& completionHandler)
Expand Down

0 comments on commit afa8e8e

Please sign in to comment.