Title: [276753] trunk/Source
Revision
276753
Author
[email protected]
Date
2021-04-29 00:45:45 -0700 (Thu, 29 Apr 2021)

Log Message

[GPU Process] REGRESSION(r272888): Don't assert the validity of the dataURL mimeType inside GPU Process
https://bugs.webkit.org/show_bug.cgi?id=225175
<rdar://76286963>

Reviewed by Simon Fraser.

Source/WebCore:

* platform/MIMETypeRegistry.h:
Export isSupportedImageMIMETypeForEncoding() so it can be called in WebKit.

* platform/graphics/cg/ImageBufferCGBackend.cpp:
(WebCore::ImageBufferCGBackend::toCFData const):
Do not assert if we are inside the GPU Process.

Source/WebKit:

* WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
Assert the validity of the mimeType before sending it to GPU Process.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (276752 => 276753)


--- trunk/Source/WebCore/ChangeLog	2021-04-29 07:24:27 UTC (rev 276752)
+++ trunk/Source/WebCore/ChangeLog	2021-04-29 07:45:45 UTC (rev 276753)
@@ -1,3 +1,18 @@
+2021-04-29  Said Abou-Hallawa  <[email protected]>
+
+        [GPU Process] REGRESSION(r272888): Don't assert the validity of the dataURL mimeType inside GPU Process
+        https://bugs.webkit.org/show_bug.cgi?id=225175
+        <rdar://76286963>
+
+        Reviewed by Simon Fraser.
+
+        * platform/MIMETypeRegistry.h:
+        Export isSupportedImageMIMETypeForEncoding() so it can be called in WebKit.
+
+        * platform/graphics/cg/ImageBufferCGBackend.cpp:
+        (WebCore::ImageBufferCGBackend::toCFData const):
+        Do not assert if we are inside the GPU Process.
+
 2021-04-28  Ryosuke Niwa  <[email protected]>
 
         Use a WeakHashSet for Document::m_mediaElements

Modified: trunk/Source/WebCore/platform/MIMETypeRegistry.h (276752 => 276753)


--- trunk/Source/WebCore/platform/MIMETypeRegistry.h	2021-04-29 07:24:27 UTC (rev 276752)
+++ trunk/Source/WebCore/platform/MIMETypeRegistry.h	2021-04-29 07:45:45 UTC (rev 276753)
@@ -71,7 +71,7 @@
     WEBCORE_EXPORT static bool isSupportedImageVideoOrSVGMIMEType(const String& mimeType);
 
     // Check to see if a MIME type is suitable for being encoded.
-    static bool isSupportedImageMIMETypeForEncoding(const String& mimeType);
+    WEBCORE_EXPORT static bool isSupportedImageMIMETypeForEncoding(const String& mimeType);
 
     // Check to see if a MIME type is suitable for being loaded as a _javascript_ or JSON resource.
     WEBCORE_EXPORT static bool isSupportedJavaScriptMIMEType(const String& mimeType);

Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBackend.cpp (276752 => 276753)


--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBackend.cpp	2021-04-29 07:24:27 UTC (rev 276752)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBackend.cpp	2021-04-29 07:45:45 UTC (rev 276753)
@@ -34,6 +34,7 @@
 #include "ImageData.h"
 #include "IntRect.h"
 #include "MIMETypeRegistry.h"
+#include "RuntimeApplicationChecks.h"
 
 #if USE(ACCELERATE)
 #include <Accelerate/Accelerate.h>
@@ -173,7 +174,11 @@
 
 RetainPtr<CFDataRef> ImageBufferCGBackend::toCFData(const String& mimeType, Optional<double> quality, PreserveResolution preserveResolution) const
 {
+#if ENABLE(GPU_PROCESS)
+    ASSERT_IMPLIES(!isInGPUProcess(), MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
+#else
     ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
+#endif
 
     auto uti = utiFromImageBufferMIMEType(mimeType);
     ASSERT(uti);

Modified: trunk/Source/WebKit/ChangeLog (276752 => 276753)


--- trunk/Source/WebKit/ChangeLog	2021-04-29 07:24:27 UTC (rev 276752)
+++ trunk/Source/WebKit/ChangeLog	2021-04-29 07:45:45 UTC (rev 276753)
@@ -1,3 +1,14 @@
+2021-04-29  Said Abou-Hallawa  <[email protected]>
+
+        [GPU Process] REGRESSION(r272888): Don't assert the validity of the dataURL mimeType inside GPU Process
+        https://bugs.webkit.org/show_bug.cgi?id=225175
+        <rdar://76286963>
+
+        Reviewed by Simon Fraser.
+
+        * WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
+        Assert the validity of the mimeType before sending it to GPU Process.
+
 2021-04-28  Wenson Hsieh  <[email protected]>
 
         [iOS] Coalesce adjacent selection geometries when rendering individual selection quads

Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h (276752 => 276753)


--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h	2021-04-29 07:24:27 UTC (rev 276752)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h	2021-04-29 07:45:45 UTC (rev 276753)
@@ -35,6 +35,7 @@
 #include <WebCore/DisplayListItems.h>
 #include <WebCore/DisplayListRecorder.h>
 #include <WebCore/DisplayListReplayer.h>
+#include <WebCore/MIMETypeRegistry.h>
 #include <wtf/Condition.h>
 #include <wtf/Lock.h>
 #include <wtf/SystemTracing.h>
@@ -151,6 +152,7 @@
         if (UNLIKELY(!m_remoteRenderingBackendProxy))
             return { };
 
+        ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
         return m_remoteRenderingBackendProxy->getDataURLForImageBuffer(mimeType, quality, preserveResolution, m_renderingResourceIdentifier);
     }
 
@@ -159,6 +161,7 @@
         if (UNLIKELY(!m_remoteRenderingBackendProxy))
             return { };
 
+        ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
         return m_remoteRenderingBackendProxy->getDataForImageBuffer(mimeType, quality, m_renderingResourceIdentifier);
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to