Title: [291140] trunk/Source/WebKit
Revision
291140
Author
cdu...@apple.com
Date
2022-03-10 17:47:40 -0800 (Thu, 10 Mar 2022)

Log Message

Fix naming in NetworkProcessProxy::registerRemoteWorkerClientProcess()
https://bugs.webkit.org/show_bug.cgi?id=237737

Reviewed by Geoffrey Garen.

Fix naming in NetworkProcessProxy::registerRemoteWorkerClientProcess() to store referring to
shared workers and add logging.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::registerRemoteWorkerClientProcess):
(WebKit::NetworkProcessProxy::unregisterRemoteWorkerClientProcess):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (291139 => 291140)


--- trunk/Source/WebKit/ChangeLog	2022-03-11 01:20:55 UTC (rev 291139)
+++ trunk/Source/WebKit/ChangeLog	2022-03-11 01:47:40 UTC (rev 291140)
@@ -1,3 +1,19 @@
+2022-03-10  Chris Dumez  <cdu...@apple.com>
+
+        Fix naming in NetworkProcessProxy::registerRemoteWorkerClientProcess()
+        https://bugs.webkit.org/show_bug.cgi?id=237737
+
+        Reviewed by Geoffrey Garen.
+
+        Fix naming in NetworkProcessProxy::registerRemoteWorkerClientProcess() to store referring to
+        shared workers and add logging.
+
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::registerRemoteWorkerClientProcess):
+        (WebKit::NetworkProcessProxy::unregisterRemoteWorkerClientProcess):
+        * UIProcess/Network/NetworkProcessProxy.h:
+        * UIProcess/Network/NetworkProcessProxy.messages.in:
+
 2022-03-10  Michael Saboff  <msab...@apple.com>
 
         Catalyst _javascript_Core, WebCore, WebKitLegacy, and WebKit shouldn't be copied to the Secondary Path

Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (291139 => 291140)


--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp	2022-03-11 01:20:55 UTC (rev 291139)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp	2022-03-11 01:47:40 UTC (rev 291140)
@@ -1481,24 +1481,30 @@
 }
 #endif
 
-void NetworkProcessProxy::registerRemoteWorkerClientProcess(RemoteWorkerType workerType, WebCore::ProcessIdentifier webProcessIdentifier, WebCore::ProcessIdentifier sharedWorkerProcessIdentifier)
+void NetworkProcessProxy::registerRemoteWorkerClientProcess(RemoteWorkerType workerType, WebCore::ProcessIdentifier clientProcessIdentifier, WebCore::ProcessIdentifier remoteWorkerProcessIdentifier)
 {
-    auto* webProcess = WebProcessProxy::processForIdentifier(webProcessIdentifier);
-    auto* sharedWorkerProcess = WebProcessProxy::processForIdentifier(sharedWorkerProcessIdentifier);
-    if (!webProcess || !sharedWorkerProcess)
+    RELEASE_LOG(Worker, "NetworkProcessProxy::registerRemoteWorkerClientProcess: workerType=%{public}s, clientProcessIdentifier=%" PRIu64 ", remoteWorkerProcessIdentifier=%" PRIu64, workerType == RemoteWorkerType::ServiceWorker ? "service" : "shared", clientProcessIdentifier.toUInt64(), remoteWorkerProcessIdentifier.toUInt64());
+    auto* clientWebProcess = WebProcessProxy::processForIdentifier(clientProcessIdentifier);
+    auto* remoteWorkerProcess = WebProcessProxy::processForIdentifier(remoteWorkerProcessIdentifier);
+    if (!clientWebProcess || !remoteWorkerProcess) {
+        RELEASE_LOG_ERROR(Worker, "NetworkProcessProxy::registerRemoteWorkerClientProcess: Could not look up one of the processes (clientWebProcess=%p, remoteWorkerProcess=%p)", clientWebProcess, remoteWorkerProcess);
         return;
+    }
 
-    sharedWorkerProcess->registerRemoteWorkerClientProcess(workerType, *webProcess);
+    remoteWorkerProcess->registerRemoteWorkerClientProcess(workerType, *clientWebProcess);
 }
 
-void NetworkProcessProxy::unregisterRemoteWorkerClientProcess(RemoteWorkerType workerType, WebCore::ProcessIdentifier webProcessIdentifier, WebCore::ProcessIdentifier sharedWorkerProcessIdentifier)
+void NetworkProcessProxy::unregisterRemoteWorkerClientProcess(RemoteWorkerType workerType, WebCore::ProcessIdentifier clientProcessIdentifier, WebCore::ProcessIdentifier remoteWorkerProcessIdentifier)
 {
-    auto* webProcess = WebProcessProxy::processForIdentifier(webProcessIdentifier);
-    auto* sharedWorkerProcess = WebProcessProxy::processForIdentifier(sharedWorkerProcessIdentifier);
-    if (!webProcess || !sharedWorkerProcess)
+    RELEASE_LOG(Worker, "NetworkProcessProxy::unregisterRemoteWorkerClientProcess: workerType=%{public}s, clientProcessIdentifier=%" PRIu64 ", remoteWorkerProcessIdentifier=%" PRIu64, workerType == RemoteWorkerType::ServiceWorker ? "service" : "shared", clientProcessIdentifier.toUInt64(), remoteWorkerProcessIdentifier.toUInt64());
+    auto* clientWebProcess = WebProcessProxy::processForIdentifier(clientProcessIdentifier);
+    auto* remoteWorkerProcess = WebProcessProxy::processForIdentifier(remoteWorkerProcessIdentifier);
+    if (!clientWebProcess || !remoteWorkerProcess) {
+        RELEASE_LOG_ERROR(Worker, "NetworkProcessProxy::unregisterRemoteWorkerClientProcess: Could not look up one of the processes (clientWebProcess=%p, remoteWorkerProcess=%p)", clientWebProcess, remoteWorkerProcess);
         return;
+    }
 
-    sharedWorkerProcess->unregisterRemoteWorkerClientProcess(workerType, *webProcess);
+    remoteWorkerProcess->unregisterRemoteWorkerClientProcess(workerType, *clientWebProcess);
 }
 
 void NetworkProcessProxy::remoteWorkerContextConnectionNoLongerNeeded(RemoteWorkerType workerType, WebCore::ProcessIdentifier identifier)

Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (291139 => 291140)


--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h	2022-03-11 01:20:55 UTC (rev 291139)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h	2022-03-11 01:47:40 UTC (rev 291140)
@@ -350,8 +350,8 @@
 #endif
     void remoteWorkerContextConnectionNoLongerNeeded(RemoteWorkerType, WebCore::ProcessIdentifier);
     void establishRemoteWorkerContextConnectionToNetworkProcess(RemoteWorkerType, WebCore::RegistrableDomain&&, std::optional<WebCore::ProcessIdentifier> requestingProcessIdentifier, std::optional<WebCore::ScriptExecutionContextIdentifier> serviceWorkerPageIdentifier, PAL::SessionID, CompletionHandler<void()>&&);
-    void registerRemoteWorkerClientProcess(RemoteWorkerType, WebCore::ProcessIdentifier webProcessIdentifier, WebCore::ProcessIdentifier sharedWorkerProcessIdentifier);
-    void unregisterRemoteWorkerClientProcess(RemoteWorkerType, WebCore::ProcessIdentifier webProcessIdentifier, WebCore::ProcessIdentifier sharedWorkerProcessIdentifier);
+    void registerRemoteWorkerClientProcess(RemoteWorkerType, WebCore::ProcessIdentifier clientProcessIdentifier, WebCore::ProcessIdentifier remoteWorkerProcessIdentifier);
+    void unregisterRemoteWorkerClientProcess(RemoteWorkerType, WebCore::ProcessIdentifier clientProcessIdentifier, WebCore::ProcessIdentifier remoteWorkerProcessIdentifier);
 
     void terminateWebProcess(WebCore::ProcessIdentifier);
 

Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in (291139 => 291140)


--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in	2022-03-11 01:20:55 UTC (rev 291139)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in	2022-03-11 01:47:40 UTC (rev 291140)
@@ -58,8 +58,8 @@
 #endif
     EstablishRemoteWorkerContextConnectionToNetworkProcess(enum:bool WebKit::RemoteWorkerType workerType, WebCore::RegistrableDomain registrableDomain, std::optional<WebCore::ProcessIdentifier> requestingProcessIdentifier, std::optional<WebCore::ScriptExecutionContextIdentifier> serviceWorkerPageIdentifier, PAL::SessionID sessionID) -> ()
     RemoteWorkerContextConnectionNoLongerNeeded(enum:bool WebKit::RemoteWorkerType workerType, WebCore::ProcessIdentifier identifier)
-    RegisterRemoteWorkerClientProcess(enum:bool WebKit::RemoteWorkerType workerType, WebCore::ProcessIdentifier webProcessIdentifier, WebCore::ProcessIdentifier remoteWorkerProcessIdentifier);
-    UnregisterRemoteWorkerClientProcess(enum:bool WebKit::RemoteWorkerType workerType, WebCore::ProcessIdentifier webProcessIdentifier, WebCore::ProcessIdentifier remoteWorkerProcessIdentifier);
+    RegisterRemoteWorkerClientProcess(enum:bool WebKit::RemoteWorkerType workerType, WebCore::ProcessIdentifier clientProcessIdentifier, WebCore::ProcessIdentifier remoteWorkerProcessIdentifier);
+    UnregisterRemoteWorkerClientProcess(enum:bool WebKit::RemoteWorkerType workerType, WebCore::ProcessIdentifier clientProcessIdentifier, WebCore::ProcessIdentifier remoteWorkerProcessIdentifier);
 
     SetWebProcessHasUploads(WebCore::ProcessIdentifier processID, bool hasUpload)
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to