Title: [289371] trunk/Source/WebKit
Revision
289371
Author
[email protected]
Date
2022-02-08 06:19:50 -0800 (Tue, 08 Feb 2022)

Log Message

GPUP WebGL RELEASE_LOGs errorneously for unhandled messages
https://bugs.webkit.org/show_bug.cgi?id=236288

Patch by Kimmo Kinnunen <[email protected]> on 2022-02-08
Reviewed by Antti Koivisto.

Remove a RELEASE_LOG when GPUProcessConnection sees a RemoteGraphicsContextGLProxy
message that was not delivered to a specific instance.
This is business as usual, as the proxy intends to be asynchronous and can be destroyed
without coordinating with the GPUP side. The Proxy object cannot know at which point
of time a message to it might be delivered.
Move the message handling to RemoteGraphicsContextGLProxy static method,
so that the RELEASE_LOG does not get added erroneosly again.

* WebProcess/GPU/GPUProcessConnection.cpp:
(WebKit::GPUProcessConnection::dispatchMessage):
* WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp:
(WebKit::RemoteGraphicsContextGLProxy::handleMessageToRemovedDestination):
* WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (289370 => 289371)


--- trunk/Source/WebKit/ChangeLog	2022-02-08 14:07:12 UTC (rev 289370)
+++ trunk/Source/WebKit/ChangeLog	2022-02-08 14:19:50 UTC (rev 289371)
@@ -1,3 +1,24 @@
+2022-02-08  Kimmo Kinnunen  <[email protected]>
+
+        GPUP WebGL RELEASE_LOGs errorneously for unhandled messages
+        https://bugs.webkit.org/show_bug.cgi?id=236288
+
+        Reviewed by Antti Koivisto.
+
+        Remove a RELEASE_LOG when GPUProcessConnection sees a RemoteGraphicsContextGLProxy
+        message that was not delivered to a specific instance.
+        This is business as usual, as the proxy intends to be asynchronous and can be destroyed
+        without coordinating with the GPUP side. The Proxy object cannot know at which point
+        of time a message to it might be delivered.
+        Move the message handling to RemoteGraphicsContextGLProxy static method,
+        so that the RELEASE_LOG does not get added erroneosly again.
+
+        * WebProcess/GPU/GPUProcessConnection.cpp:
+        (WebKit::GPUProcessConnection::dispatchMessage):
+        * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp:
+        (WebKit::RemoteGraphicsContextGLProxy::handleMessageToRemovedDestination):
+        * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h:
+
 2022-02-08  Carlos Garcia Campos  <[email protected]>
 
         [GTK][WPE] Crash at  WebKit::bindA11y() in WebKitGTK 2.35.2

Modified: trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp (289370 => 289371)


--- trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp	2022-02-08 14:07:12 UTC (rev 289370)
+++ trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp	2022-02-08 14:19:50 UTC (rev 289371)
@@ -77,6 +77,7 @@
 #endif
 
 #if ENABLE(WEBGL)
+#include "RemoteGraphicsContextGLProxy.h"
 #include "RemoteGraphicsContextGLProxyMessages.h"
 #endif
 
@@ -203,12 +204,9 @@
     if (messageReceiverMap().dispatchMessage(connection, decoder))
         return true;
 
-    // Skip messages intended for already removed messageReceiverMap() destinations.
 #if ENABLE(WEBGL)
-    if (decoder.messageReceiverName() == Messages::RemoteGraphicsContextGLProxy::messageReceiverName()) {
-        RELEASE_LOG_ERROR(WebGL, "The RemoteGraphicsContextGLProxy object has beed destroyed");
-        return true;
-    }
+    if (decoder.messageReceiverName() == Messages::RemoteGraphicsContextGLProxy::messageReceiverName())
+        return RemoteGraphicsContextGLProxy::handleMessageToRemovedDestination(connection, decoder);
 #endif
 
 #if USE(AUDIO_SESSION)

Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp (289370 => 289371)


--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp	2022-02-08 14:07:12 UTC (rev 289370)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp	2022-02-08 14:19:50 UTC (rev 289371)
@@ -198,6 +198,20 @@
         client->forceContextLost();
 }
 
+bool RemoteGraphicsContextGLProxy::handleMessageToRemovedDestination(IPC::Connection&, IPC::Decoder& decoder)
+{
+    // Skip messages intended for already removed messageReceiverMap() destinations.
+    // These are business as usual. These can happen for example by:
+    //  - The object is created and immediately destroyed, before WasCreated was handled.
+    //  - A send to GPU process times out, we remove the object. If the GPU process delivers the message at the same
+    //    time, it might be in the message delivery callback.
+    // When adding new messages to RemoteGraphicsContextGLProxy, add them to this list.
+    ASSERT(decoder.messageName() == Messages::RemoteGraphicsContextGLProxy::WasCreated::name()
+        || decoder.messageName() == Messages::RemoteGraphicsContextGLProxy::WasLost::name()
+        || decoder.messageName() == Messages::RemoteGraphicsContextGLProxy::WasChanged::name());
+    return true;
+}
+
 void RemoteGraphicsContextGLProxy::waitUntilInitialized()
 {
     if (isContextLost())

Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h (289370 => 289371)


--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h	2022-02-08 14:07:12 UTC (rev 289370)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h	2022-02-08 14:19:50 UTC (rev 289371)
@@ -317,6 +317,7 @@
     std::optional<WebCore::PixelBuffer> paintRenderingResultsToPixelBuffer() final;
     // End of list used by generate-gpup-webgl script.
 
+    static bool handleMessageToRemovedDestination(IPC::Connection&, IPC::Decoder&);
 protected:
     RemoteGraphicsContextGLProxy(GPUProcessConnection&, const WebCore::GraphicsContextGLAttributes&, RenderingBackendIdentifier);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to