Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4ee566546310303a1411e417006e9cb06a43045a
      
https://github.com/WebKit/WebKit/commit/4ee566546310303a1411e417006e9cb06a43045a
  Author: Sihui Liu <[email protected]>
  Date:   2025-06-02 (Mon, 02 Jun 2025)

  Changed paths:
    M Source/WebCore/workers/service/server/SWServer.cpp
    M Source/WebCore/workers/service/server/SWServer.h
    M Source/WebKit/NetworkProcess/NetworkProcess.cpp
    M Source/WebKit/NetworkProcess/NetworkProcess.h
    M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
    M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h

  Log Message:
  -----------
  Avoid terminating service worker processes for deleting website data
rdar://151327930
https://bugs.webkit.org/show_bug.cgi?id=293890

Reviewed by Chris Dumez.

In 290386@main, we started to terminate service worker process before deleting 
website data, to ensure service worker
process cannot create more website data after deletion starts. The problem is 
in existing implementation, network
process may notice service worker process is gone before it receives website 
data deletion request, in which case it
will ask UI process to relaunch the service worker process (when there is 
active service worker client). The new service
worker process might be discarded soon after the website data deletion has 
finished, which makes the process launch
wasteful. To fix this, now UI process does not directly terminate service 
worker process. Instead, network process will
wait for service worker clients to exit before starting to delete website data.

This patch also contains a drive-by fix to make 
m_webProcessConnectionCloseHandlers keep track of multiple handlers
for each connection. Otherwise, if two delete data requests are received, only 
one of them will wait for connection to
close (the other will start directly since the handler is not saved).

* Source/WebCore/workers/service/server/SWServer.cpp:
(WebCore::SWServer::unregisterServiceWorkerClientInternal):
(WebCore::SWServer::addHandlerIfHasControlledClients):
* Source/WebCore/workers/service/server/SWServer.h:
* Source/WebKit/NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
(WebKit::NetworkProcess::performDeleteWebsiteDataTask):
(WebKit::NetworkProcess::deleteWebsiteData):
* Source/WebKit/NetworkProcess/NetworkProcess.h:
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::activeWebProcesses const):
(WebKit::WebsiteDataStore::removeDataInNetworkProcess):
(WebKit::WebsiteDataStore::removeData):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h:

Canonical link: https://commits.webkit.org/295728@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to