Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2a66dfcd19dbbc5fcdb0d7cd3acd1d891b63bf93
      
https://github.com/WebKit/WebKit/commit/2a66dfcd19dbbc5fcdb0d7cd3acd1d891b63bf93
  Author: Youenn Fablet <[email protected]>
  Date:   2026-07-22 (Wed, 22 Jul 2026)

  Changed paths:
    M Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp
    M Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h

  Log Message:
  -----------
  WebSWServerConnection::networkProcess should account for a nullptr 
m_networkConnectionToWebProcess
rdar://182761259
https://bugs.webkit.org/show_bug.cgi?id=319968

Reviewed by Chris Dumez.

WebSWServerConnection sometimes calls networkProcess() asynchronously following 
an IPC message, for instance in 
WebSWServerConnection::postMessageToServiceWorkerClient.
In that case, there is no guarantee that m_networkConnectionToWebProcess is not 
nullptr and calling WebSWServerConnection::networkProcess should return nullptr.

We change WebSWServerConnection::networkProcess to account for this and return 
a NetworkProcess pointer instead of a ref.
At call sites, we check for networkProcess being nullptr for async cases.

Covered by existing tests.

* Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::networkProcess):
(WebKit::WebSWServerConnection::sharedPreferencesForWebProcess const):
(WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
* Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to