<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[279221] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/279221">279221</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2021-06-24 07:38:17 -0700 (Thu, 24 Jun 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Using a video as a source for a WebGL texture is slow and hangs on iOS 15
https://bugs.webkit.org/show_bug.cgi?id=227081

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-06-24
Reviewed by Eric Carlson.

Source/WebCore:

Video frame transfer from GPU process to Web process would fail when
WebGL tried to copy the video frame to a texture. The failure was
artificial, due to use of WebCore::IOSurface as a unneeeded helper
to convert CVPixelBufferRef to cross-process object.

This would cause performance regression when WebGL would
fall back to software conversion fallback. This callback did work
as it obtains the image through "get last frame as native image"
API.

* platform/cocoa/CoreVideoSoftLink.cpp:
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
Remove CVPixelBufferRef -> WebCore::IOSurface conversion function.
Remove WebCore::IOSurface -> CVPixelBufferRef conversion function.
These were used in WebKit IPC serialization for CVPixelBufferRef.
However, this is incorrect behavior as CVPixelBufferRef
is not always compatible with WebCore::IOSurface. IOSurfaceRef
has always a destination color space. This would be missing from
CVPixelBufferRef. The code is moved to the IPC serialization
functions.

Source/WebKit:

In current form, media is decoded in GPU process and WebGL is processed
in Web process.

Video frame transfer from GPU process to Web process would fail when
WebGL tried to copy the video frame to a texture. The failure was
artificial, due to use of WebCore::IOSurface as a unneeeded helper
to convert CVPixelBufferRef to a cross-process object.

The failure would occur when AVPlayerItemVideoOutput
would generate a CVPixelBufferRef without color space information. Creating
WebCore::IOSurface out of this would fail. WebCore::IOSurface
has always a color space. The failure is not significant, as WebCore::IOSurface
was only used as a convenience.

This would cause performance regression when WebGL would
fall back to software conversion fallback. This callback did work
as it obtains the image through "get last frame as native image"
API.

* GPUProcess/media/RemoteMediaPlayerProxy.h:
* GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
Use the correct type of object in the IPC messages:
Function `PixelBufferForCurrentTime` returns `CVPixelBufferRef`
so use that type instead of `MachPort`. It is an implementation
detail of `CVPixelBufferRef` encode/decode how the object
transfer is implemented.

The type of transfer must be RetainPtr<CVPixelBufferRef> as that
is how the IPC system operates wrt input, output and "storage"
types. This is the same as with IPC support for RefPtr<> types.

No tests as Sources/WebKit is not unit-testable ATM.

* GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:
(WebKit::RemoteMediaPlayerProxy::pixelBufferForCurrentTime):
Change the receive side according to the message type change.

* Scripts/webkit/messages.py:
(types_that_cannot_be_forward_declared):
(class_template_headers):
Add support for RetainPtr in the IPC message language.

* Scripts/webkit/messages_unittest.py:
* Scripts/webkit/tests/Makefile:
* Scripts/webkit/tests/MessageArgumentDescriptions.cpp:
(IPC::jsValueForArguments):
(IPC::messageArgumentDescriptions):
* Scripts/webkit/tests/MessageNames.cpp:
(IPC::description):
(IPC::receiverName):
(IPC::isValidMessageName):
* Scripts/webkit/tests/MessageNames.h:
* Scripts/webkit/tests/TestWithCVPixelBuffer.messages.in: Added.
* Scripts/webkit/tests/TestWithCVPixelBufferMessageReceiver.cpp: Added.
(WebKit::TestWithCVPixelBuffer::didReceiveMessage):
(WebKit::TestWithCVPixelBuffer::didReceiveSyncMessage):
* Scripts/webkit/tests/TestWithCVPixelBufferMessages.h: Copied from Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessagesReplies.h.
(Messages::TestWithCVPixelBuffer::messageReceiverName):
(Messages::TestWithCVPixelBuffer::SendCVPixelBuffer::name):
(Messages::TestWithCVPixelBuffer::SendCVPixelBuffer::SendCVPixelBuffer):
(Messages::TestWithCVPixelBuffer::SendCVPixelBuffer::arguments const):
(Messages::TestWithCVPixelBuffer::ReceiveCVPixelBuffer::name):
(Messages::TestWithCVPixelBuffer::ReceiveCVPixelBuffer::arguments const):
* Scripts/webkit/tests/TestWithCVPixelBufferMessagesReplies.h: Copied from Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessagesReplies.h.
* Scripts/webkit/tests/TestWithSuperclassMessagesReplies.h:
Add code generation examples for IPC implemetation regarding transferring
RetainPtr<CVPixelBufferRef>.

* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<RetainPtr<CVPixelBufferRef>>::encode):
(IPC::ArgumentCoder<RetainPtr<CVPixelBufferRef>>::decode):
* Shared/WebCoreArgumentCoders.h:
Move the CVPixelBufferRef transfer code from IOSurface
to the IPC layer.
The encode function must be of type RetainPtr<CVPixelBufferRef> instead of
CVPixelBufferRef, in contrast to existing RetainPtr<CF*> types.
The existing RetainPtr<CF*> types are not used as IPC message inputs,
only as subobjects. The IPC message language does not have concept of
encode type differing from decode type.

* WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm:
(WebKit::MediaPlayerPrivateRemote::pixelBufferForCurrentTime):
Change the send side according to the message type change.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaCoreVideoSoftLinkcpp">trunk/Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaIOSurfaceh">trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaIOSurfacemm">trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitGPUProcessmediaRemoteMediaPlayerProxyh">trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h</a></li>
<li><a href="#trunkSourceWebKitGPUProcessmediaRemoteMediaPlayerProxymessagesin">trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKitGPUProcessmediacocoaRemoteMediaPlayerProxyCocoamm">trunk/Source/WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm</a></li>
<li><a href="#trunkSourceWebKitScriptswebkitmessagespy">trunk/Source/WebKit/Scripts/webkit/messages.py</a></li>
<li><a href="#trunkSourceWebKitScriptswebkitmessages_unittestpy">trunk/Source/WebKit/Scripts/webkit/messages_unittest.py</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsMakefile">trunk/Source/WebKit/Scripts/webkit/tests/Makefile</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsMessageArgumentDescriptionscpp">trunk/Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsMessageNamescpp">trunk/Source/WebKit/Scripts/webkit/tests/MessageNames.cpp</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsMessageNamesh">trunk/Source/WebKit/Scripts/webkit/tests/MessageNames.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithIfMessageMessageReceivercpp">trunk/Source/WebKit/Scripts/webkit/tests/TestWithIfMessageMessageReceiver.cpp</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithIfMessageMessagesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithIfMessageMessages.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithIfMessageMessagesRepliesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithIfMessageMessagesReplies.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithImageDataMessageReceivercpp">trunk/Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessageReceiver.cpp</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithImageDataMessagesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessages.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithImageDataMessagesRepliesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessagesReplies.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithLegacyReceiverMessageReceivercpp">trunk/Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessageReceiver.cpp</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithLegacyReceiverMessagesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessages.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithLegacyReceiverMessagesRepliesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessagesReplies.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithSemaphoreMessageReceivercpp">trunk/Source/WebKit/Scripts/webkit/tests/TestWithSemaphoreMessageReceiver.cpp</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithSemaphoreMessagesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithSemaphoreMessages.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithSemaphoreMessagesRepliesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithSemaphoreMessagesReplies.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithStreamBufferMessageReceivercpp">trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamBufferMessageReceiver.cpp</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithStreamBufferMessagesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamBufferMessages.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithStreamBufferMessagesRepliesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamBufferMessagesReplies.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithStreamMessageReceivercpp">trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamMessageReceiver.cpp</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithStreamMessagesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamMessages.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithStreamMessagesRepliesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamMessagesReplies.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithSuperclassMessageReceivercpp">trunk/Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessageReceiver.cpp</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithSuperclassMessagesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessages.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithSuperclassMessagesRepliesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessagesReplies.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithoutAttributesMessageReceivercpp">trunk/Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessageReceiver.cpp</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithoutAttributesMessagesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessages.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithoutAttributesMessagesRepliesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessagesReplies.h</a></li>
<li><a href="#trunkSourceWebKitSharedCocoaWebCoreArgumentCodersCocoamm">trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm</a></li>
<li><a href="#trunkSourceWebKitSharedWebCoreArgumentCodersh">trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessGPUmediacocoaMediaPlayerPrivateRemoteCocoamm">trunk/Source/WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithCVPixelBuffermessagesin">trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBuffer.messages.in</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithCVPixelBufferMessageReceivercpp">trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBufferMessageReceiver.cpp</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithCVPixelBufferMessagesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBufferMessages.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkittestsTestWithCVPixelBufferMessagesRepliesh">trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBufferMessagesReplies.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebCore/ChangeLog      2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2021-06-24  Kimmo Kinnunen  <kkinnunen@apple.com>
+
+        Using a video as a source for a WebGL texture is slow and hangs on iOS 15
+        https://bugs.webkit.org/show_bug.cgi?id=227081
+
+        Reviewed by Eric Carlson.
+
+        Video frame transfer from GPU process to Web process would fail when
+        WebGL tried to copy the video frame to a texture. The failure was
+        artificial, due to use of WebCore::IOSurface as a unneeeded helper
+        to convert CVPixelBufferRef to cross-process object.
+
+        This would cause performance regression when WebGL would
+        fall back to software conversion fallback. This callback did work
+        as it obtains the image through "get last frame as native image"
+        API.
+
+        * platform/cocoa/CoreVideoSoftLink.cpp:
+        * platform/graphics/cocoa/IOSurface.h:
+        * platform/graphics/cocoa/IOSurface.mm:
+        Remove CVPixelBufferRef -> WebCore::IOSurface conversion function.
+        Remove WebCore::IOSurface -> CVPixelBufferRef conversion function.
+        These were used in WebKit IPC serialization for CVPixelBufferRef.
+        However, this is incorrect behavior as CVPixelBufferRef
+        is not always compatible with WebCore::IOSurface. IOSurfaceRef
+        has always a destination color space. This would be missing from
+        CVPixelBufferRef. The code is moved to the IPC serialization
+        functions.
+
</ins><span class="cx"> 2021-06-24  Alan Bujtas  <zalan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [IFC][Integration] Text selection flashing to end of paragraph
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaCoreVideoSoftLinkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp        2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebCore/platform/cocoa/CoreVideoSoftLink.cpp   2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVPixelBufferUnlockBaseAddress, CVReturn, (CVPixelBufferRef pixelBuffer, CVOptionFlags lockFlags), (pixelBuffer, lockFlags))
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVPixelBufferPoolCreate, CVReturn,(CFAllocatorRef allocator, CFDictionaryRef poolAttributes, CFDictionaryRef pixelBufferAttributes, CVPixelBufferPoolRef* poolOut), (allocator, poolAttributes, pixelBufferAttributes, poolOut))
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVPixelBufferPoolCreatePixelBuffer, CVReturn, (CFAllocatorRef allocator, CVPixelBufferPoolRef pixelBufferPool, CVPixelBufferRef* pixelBufferOut), (allocator, pixelBufferPool, pixelBufferOut))
</span><del>-SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVPixelBufferGetIOSurface, IOSurfaceRef, (CVPixelBufferRef pixelBuffer), (pixelBuffer))
</del><ins>+SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(WebCore, CoreVideo, CVPixelBufferGetIOSurface, IOSurfaceRef, (CVPixelBufferRef pixelBuffer), (pixelBuffer), WEBCORE_EXPORT)
</ins><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVImageBufferGetColorSpace, CGColorSpaceRef, (CVImageBufferRef pixelBuffer), (pixelBuffer))
</span><span class="cx"> 
</span><span class="cx"> SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(WebCore, CoreVideo, kCVPixelBufferPixelFormatTypeKey, CFStringRef, WEBCORE_EXPORT)
</span><span class="lines">@@ -98,5 +98,5 @@
</span><span class="cx"> 
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVPixelBufferCreate, CVReturn, (CFAllocatorRef allocator, size_t width, size_t height, OSType pixelFormatType, CFDictionaryRef pixelBufferAttributes, CVPixelBufferRef *pixelBufferOut), (allocator, width, height, pixelFormatType, pixelBufferAttributes, pixelBufferOut))
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVPixelBufferCreateWithBytes, CVReturn, (CFAllocatorRef allocator, size_t width, size_t height, OSType pixelFormatType, void* data, size_t bytesPerRow, void (*releaseCallback)(void*, const void*), void* releasePointer, CFDictionaryRef pixelBufferAttributes, CVPixelBufferRef *pixelBufferOut), (allocator, width, height, pixelFormatType, data, bytesPerRow, releaseCallback, releasePointer, pixelBufferAttributes, pixelBufferOut))
</span><del>-SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreVideo, CVPixelBufferCreateWithIOSurface, CVReturn, (CFAllocatorRef allocator, IOSurfaceRef surface, CFDictionaryRef pixelBufferAttributes, CVPixelBufferRef * pixelBufferOut), (allocator, surface, pixelBufferAttributes, pixelBufferOut))
</del><ins>+SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(WebCore, CoreVideo, CVPixelBufferCreateWithIOSurface, CVReturn, (CFAllocatorRef allocator, IOSurfaceRef surface, CFDictionaryRef pixelBufferAttributes, CVPixelBufferRef * pixelBufferOut), (allocator, surface, pixelBufferAttributes, pixelBufferOut), WEBCORE_EXPORT)
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaIOSurfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h 2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h    2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -36,8 +36,6 @@
</span><span class="cx"> #define HAVE_IOSURFACE_RGB10 1
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-using CVPixelBufferRef = struct __CVBuffer*;
-
</del><span class="cx"> namespace WTF {
</span><span class="cx"> class MachSendRight;
</span><span class="cx"> class TextStream;
</span><span class="lines">@@ -104,7 +102,6 @@
</span><span class="cx">     WEBCORE_EXPORT static std::unique_ptr<IOSurface> createFromSendRight(const WTF::MachSendRight&&, const DestinationColorSpace&);
</span><span class="cx">     WEBCORE_EXPORT static std::unique_ptr<IOSurface> createFromSurface(IOSurfaceRef, const DestinationColorSpace&);
</span><span class="cx">     WEBCORE_EXPORT static std::unique_ptr<IOSurface> createFromImage(CGImageRef);
</span><del>-    WEBCORE_EXPORT static std::unique_ptr<IOSurface> createFromPixelBuffer(CVPixelBufferRef);
</del><span class="cx">     
</span><span class="cx"> #if USE(IOSURFACE_CANVAS_BACKING_STORE)
</span><span class="cx">     static std::unique_ptr<IOSurface> createFromImageBuffer(RefPtr<ImageBuffer>);
</span><span class="lines">@@ -124,8 +121,6 @@
</span><span class="cx">     WEBCORE_EXPORT RetainPtr<CGImageRef> createImage();
</span><span class="cx">     WEBCORE_EXPORT static RetainPtr<CGImageRef> sinkIntoImage(std::unique_ptr<IOSurface>);
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT RetainPtr<CVPixelBufferRef> createPixelBuffer();
-
</del><span class="cx"> #ifdef __OBJC__
</span><span class="cx">     id asLayerContents() const { return (__bridge id)m_surface.get(); }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaIOSurfacemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm        2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm   2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -105,22 +105,6 @@
</span><span class="cx">     return surface;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr<IOSurface> IOSurface::createFromPixelBuffer(CVPixelBufferRef pixelBuffer)
-{
-    if (!pixelBuffer)
-        return nullptr;
-
-    auto surface = CVPixelBufferGetIOSurface(pixelBuffer);
-    if (!surface)
-        return nullptr;
-
-    auto colorSpace = CVImageBufferGetColorSpace(pixelBuffer);
-    if (!colorSpace)
-        return nullptr;
-
-    return createFromSurface(surface, DestinationColorSpace { colorSpace });
-}
-
</del><span class="cx"> void IOSurface::moveToPool(std::unique_ptr<IOSurface>&& surface)
</span><span class="cx"> {
</span><span class="cx">     IOSurfacePool::sharedPool().addSurface(WTFMove(surface));
</span><span class="lines">@@ -300,16 +284,6 @@
</span><span class="cx">     return adoptCF(CGIOSurfaceContextCreateImageReference(surface->ensurePlatformContext()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RetainPtr<CVPixelBufferRef> IOSurface::createPixelBuffer()
-{
-    CVPixelBufferRef rawBuffer = nullptr;
-    auto status = CVPixelBufferCreateWithIOSurface(kCFAllocatorDefault, m_surface.get(), nullptr, &rawBuffer);
-    if (status == noErr && rawBuffer)
-        return adoptCF(rawBuffer);
-
-    return nullptr;
-}
-
</del><span class="cx"> void IOSurface::setContextSize(IntSize contextSize)
</span><span class="cx"> {
</span><span class="cx">     if (contextSize == m_contextSize)
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/ChangeLog       2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,3 +1,94 @@
</span><ins>+2021-06-24  Kimmo Kinnunen  <kkinnunen@apple.com>
+
+        Using a video as a source for a WebGL texture is slow and hangs on iOS 15
+        https://bugs.webkit.org/show_bug.cgi?id=227081
+
+        Reviewed by Eric Carlson.
+
+        In current form, media is decoded in GPU process and WebGL is processed
+        in Web process.
+
+        Video frame transfer from GPU process to Web process would fail when
+        WebGL tried to copy the video frame to a texture. The failure was
+        artificial, due to use of WebCore::IOSurface as a unneeeded helper
+        to convert CVPixelBufferRef to a cross-process object.
+
+        The failure would occur when AVPlayerItemVideoOutput
+        would generate a CVPixelBufferRef without color space information. Creating
+        WebCore::IOSurface out of this would fail. WebCore::IOSurface
+        has always a color space. The failure is not significant, as WebCore::IOSurface
+        was only used as a convenience.
+
+        This would cause performance regression when WebGL would
+        fall back to software conversion fallback. This callback did work
+        as it obtains the image through "get last frame as native image"
+        API.
+
+        * GPUProcess/media/RemoteMediaPlayerProxy.h:
+        * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
+        Use the correct type of object in the IPC messages:
+        Function `PixelBufferForCurrentTime` returns `CVPixelBufferRef`
+        so use that type instead of `MachPort`. It is an implementation
+        detail of `CVPixelBufferRef` encode/decode how the object
+        transfer is implemented.
+
+        The type of transfer must be RetainPtr<CVPixelBufferRef> as that
+        is how the IPC system operates wrt input, output and "storage"
+        types. This is the same as with IPC support for RefPtr<> types.
+
+        No tests as Sources/WebKit is not unit-testable ATM.
+
+        * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:
+        (WebKit::RemoteMediaPlayerProxy::pixelBufferForCurrentTime):
+        Change the receive side according to the message type change.
+
+        * Scripts/webkit/messages.py:
+        (types_that_cannot_be_forward_declared):
+        (class_template_headers):
+        Add support for RetainPtr in the IPC message language.
+
+        * Scripts/webkit/messages_unittest.py:
+        * Scripts/webkit/tests/Makefile:
+        * Scripts/webkit/tests/MessageArgumentDescriptions.cpp:
+        (IPC::jsValueForArguments):
+        (IPC::messageArgumentDescriptions):
+        * Scripts/webkit/tests/MessageNames.cpp:
+        (IPC::description):
+        (IPC::receiverName):
+        (IPC::isValidMessageName):
+        * Scripts/webkit/tests/MessageNames.h:
+        * Scripts/webkit/tests/TestWithCVPixelBuffer.messages.in: Added.
+        * Scripts/webkit/tests/TestWithCVPixelBufferMessageReceiver.cpp: Added.
+        (WebKit::TestWithCVPixelBuffer::didReceiveMessage):
+        (WebKit::TestWithCVPixelBuffer::didReceiveSyncMessage):
+        * Scripts/webkit/tests/TestWithCVPixelBufferMessages.h: Copied from Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessagesReplies.h.
+        (Messages::TestWithCVPixelBuffer::messageReceiverName):
+        (Messages::TestWithCVPixelBuffer::SendCVPixelBuffer::name):
+        (Messages::TestWithCVPixelBuffer::SendCVPixelBuffer::SendCVPixelBuffer):
+        (Messages::TestWithCVPixelBuffer::SendCVPixelBuffer::arguments const):
+        (Messages::TestWithCVPixelBuffer::ReceiveCVPixelBuffer::name):
+        (Messages::TestWithCVPixelBuffer::ReceiveCVPixelBuffer::arguments const):
+        * Scripts/webkit/tests/TestWithCVPixelBufferMessagesReplies.h: Copied from Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessagesReplies.h.
+        * Scripts/webkit/tests/TestWithSuperclassMessagesReplies.h:
+        Add code generation examples for IPC implemetation regarding transferring
+        RetainPtr<CVPixelBufferRef>.
+
+        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
+        (IPC::ArgumentCoder<RetainPtr<CVPixelBufferRef>>::encode):
+        (IPC::ArgumentCoder<RetainPtr<CVPixelBufferRef>>::decode):
+        * Shared/WebCoreArgumentCoders.h:
+        Move the CVPixelBufferRef transfer code from IOSurface
+        to the IPC layer.
+        The encode function must be of type RetainPtr<CVPixelBufferRef> instead of
+        CVPixelBufferRef, in contrast to existing RetainPtr<CF*> types.
+        The existing RetainPtr<CF*> types are not used as IPC message inputs,
+        only as subobjects. The IPC message language does not have concept of
+        encode type differing from decode type.
+
+        * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm:
+        (WebKit::MediaPlayerPrivateRemote::pixelBufferForCurrentTime):
+        Change the send side according to the message type change.
+
</ins><span class="cx"> 2021-06-24  Martin Robinson  <mrobinson@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         [css-scroll-snap] Remove ENABLE_SCROLL_SNAP compile-time option
</span></span></pre></div>
<a id="trunkSourceWebKitGPUProcessmediaRemoteMediaPlayerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h    2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h       2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -62,6 +62,10 @@
</span><span class="cx"> #include "SharedRingBufferStorage.h"
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(AVFOUNDATION)
+#include <wtf/RetainPtr.h>
+#endif
+
</ins><span class="cx"> namespace WTF {
</span><span class="cx"> class MachSendRight;
</span><span class="cx"> }
</span><span class="lines">@@ -71,6 +75,10 @@
</span><span class="cx"> class VideoTrackPrivate;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if USE(AVFOUNDATION)
+typedef struct __CVBuffer* CVPixelBufferRef;
+#endif
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> using LayerHostingContextID = uint32_t;
</span><span class="lines">@@ -298,8 +306,10 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     void nativeImageForCurrentTime(CompletionHandler<void(std::optional<WTF::MachSendRight>&&)>&&);
</span><del>-    void pixelBufferForCurrentTime(CompletionHandler<void(std::optional<WTF::MachSendRight>&&)>&&);
</del><span class="cx"> #endif
</span><ins>+#if USE(AVFOUNDATION)
+    void pixelBufferForCurrentTime(CompletionHandler<void(RetainPtr<CVPixelBufferRef>&&)>&&);
+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if !RELEASE_LOG_DISABLED
</span><span class="cx">     const Logger& mediaPlayerLogger() final { return m_logger; }
</span></span></pre></div>
<a id="trunkSourceWebKitGPUProcessmediaRemoteMediaPlayerProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in  2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in     2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -124,8 +124,10 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     NativeImageForCurrentTime() -> (std::optional<MachSendRight> sendRight) Synchronous
</span><del>-    PixelBufferForCurrentTime() -> (std::optional<MachSendRight> sendRight) Synchronous
</del><span class="cx"> #endif
</span><ins>+#if USE(AVFOUNDATION)
+    PixelBufferForCurrentTime() -> (RetainPtr<CVPixelBufferRef> pixelBuffer) Synchronous
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitGPUProcessmediacocoaRemoteMediaPlayerProxyCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm        2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm   2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -107,30 +107,12 @@
</span><span class="cx">     completionHandler(surface->createSendRight());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RemoteMediaPlayerProxy::pixelBufferForCurrentTime(CompletionHandler<void(std::optional<WTF::MachSendRight>&&)>&& completionHandler)
</del><ins>+void RemoteMediaPlayerProxy::pixelBufferForCurrentTime(CompletionHandler<void(RetainPtr<CVPixelBufferRef>&&)>&& completionHandler)
</ins><span class="cx"> {
</span><del>-#if !USE(AVFOUNDATION)
-    completionHandler(std::nullopt);
-#else
-    if (!m_player) {
-        completionHandler(std::nullopt);
-        return;
-    }
-
-    auto pixelBuffer = m_player->pixelBufferForCurrentTime();
-    if (!pixelBuffer) {
-        completionHandler(std::nullopt);
-        return;
-    }
-
-    auto surface = WebCore::IOSurface::createFromPixelBuffer(pixelBuffer.get());
-    if (!surface) {
-        completionHandler(std::nullopt);
-        return;
-    }
-
-    completionHandler(surface->createSendRight());
-#endif
</del><ins>+    RetainPtr<CVPixelBufferRef> result;
+    if (m_player)
+        result = m_player->pixelBufferForCurrentTime();
+    completionHandler(WTFMove(result));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkitmessagespy"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/messages.py (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/messages.py   2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/messages.py      2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> from webkit.model import BUILTIN_ATTRIBUTE, ASYNC_ATTRIBUTE, SYNCHRONOUS_ATTRIBUTE, MAINTHREADCALLBACK_ATTRIBUTE, STREAM_ATTRIBUTE, WANTS_CONNECTION_ATTRIBUTE, MessageReceiver, Message
</span><span class="cx"> 
</span><span class="cx"> _license_header = """/*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -264,6 +264,7 @@
</span><span class="cx"> 
</span><span class="cx"> def types_that_cannot_be_forward_declared():
</span><span class="cx">     return frozenset([
</span><ins>+        'CVPixelBufferRef',
</ins><span class="cx">         'IPC::DataReference',
</span><span class="cx">         'IPC::FontReference',
</span><span class="cx">         'IPC::Semaphore',
</span><span class="lines">@@ -607,6 +608,7 @@
</span><span class="cx">         'std::pair': {'headers': ['<utility>'], 'argument_coder_headers': ['"ArgumentCoders.h"']},
</span><span class="cx">         'IPC::ArrayReference': {'headers': ['"ArrayReference.h"'], 'argument_coder_headers': ['"ArgumentCoders.h"']},
</span><span class="cx">         'RefPtr': {'headers': ['<wtf/RefCounted.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']},
</span><ins>+        'RetainPtr': {'headers': ['<wtf/RetainPtr.h>'], 'argument_coder_headers': ['"ArgumentCodersCF.h"']},
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     match = re.match('(?P<template_name>.+?)<(?P<parameter_string>.+)>', template_string)
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkitmessages_unittestpy"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/messages_unittest.py (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/messages_unittest.py  2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/messages_unittest.py     2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -47,7 +47,8 @@
</span><span class="cx">     'TestWithSemaphore',
</span><span class="cx">     'TestWithImageData',
</span><span class="cx">     'TestWithStream',
</span><del>-    'TestWithStreamBuffer'
</del><ins>+    'TestWithStreamBuffer',
+    'TestWithCVPixelBuffer',
</ins><span class="cx"> ]
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsMakefile"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/Makefile (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/Makefile        2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/Makefile   2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -6,8 +6,9 @@
</span><span class="cx">     TestWithIfMessage \
</span><span class="cx">     TestWithSemaphore \
</span><span class="cx">     TestWithImageData \
</span><del>-       TestWithStream \
-       TestWithStreamBuffer \
</del><ins>+    TestWithStream \
+    TestWithStreamBuffer \
+    TestWithCVPixelBuffer \
</ins><span class="cx"> #
</span><span class="cx"> 
</span><span class="cx"> all:
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsMessageArgumentDescriptionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp 2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp    2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -28,6 +28,9 @@
</span><span class="cx"> #if ENABLE(IPC_TESTING_API)
</span><span class="cx"> 
</span><span class="cx"> #include "ArgumentCoders.h"
</span><ins>+#if USE(AVFOUNDATION)
+#include "ArgumentCodersCF.h"
+#endif
</ins><span class="cx"> #include "Connection.h"
</span><span class="cx"> #if ENABLE(DEPRECATED_FEATURE) || ENABLE(EXPERIMENTAL_FEATURE)
</span><span class="cx"> #include "DummyType.h"
</span><span class="lines">@@ -46,6 +49,7 @@
</span><span class="cx"> #if ENABLE(TEST_FEATURE)
</span><span class="cx"> #include "TestTwoStateEnum.h"
</span><span class="cx"> #endif
</span><ins>+#include "TestWithCVPixelBufferMessages.h"
</ins><span class="cx"> #include "TestWithIfMessageMessages.h"
</span><span class="cx"> #include "TestWithImageDataMessages.h"
</span><span class="cx"> #include "TestWithLegacyReceiverMessages.h"
</span><span class="lines">@@ -75,6 +79,9 @@
</span><span class="cx"> #include <wtf/OptionSet.h>
</span><span class="cx"> #endif
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><ins>+#if USE(AVFOUNDATION)
+#include <wtf/RetainPtr.h>
+#endif
</ins><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx"> 
</span><span class="lines">@@ -249,6 +256,12 @@
</span><span class="cx"> #endif
</span><span class="cx">     case MessageName::TestWithStreamBuffer_SendStreamBuffer:
</span><span class="cx">         return jsValueForDecodedArguments<Messages::TestWithStreamBuffer::SendStreamBuffer::Arguments>(globalObject, decoder);
</span><ins>+#if USE(AVFOUNDATION)
+    case MessageName::TestWithCVPixelBuffer_SendCVPixelBuffer:
+        return jsValueForDecodedArguments<Messages::TestWithCVPixelBuffer::SendCVPixelBuffer::Arguments>(globalObject, decoder);
+    case MessageName::TestWithCVPixelBuffer_ReceiveCVPixelBuffer:
+        return jsValueForDecodedArguments<Messages::TestWithCVPixelBuffer::ReceiveCVPixelBuffer::Arguments>(globalObject, decoder);
+#endif
</ins><span class="cx">     default:
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="lines">@@ -586,6 +599,14 @@
</span><span class="cx">         return Vector<ArgumentDescription> {
</span><span class="cx">             {"stream", "IPC::StreamConnectionBuffer", nullptr, false},
</span><span class="cx">         };
</span><ins>+#if USE(AVFOUNDATION)
+    case MessageName::TestWithCVPixelBuffer_SendCVPixelBuffer:
+        return Vector<ArgumentDescription> {
+            {"s0", "RetainPtr<CVPixelBufferRef>", nullptr, false},
+        };
+    case MessageName::TestWithCVPixelBuffer_ReceiveCVPixelBuffer:
+        return Vector<ArgumentDescription> { };
+#endif
</ins><span class="cx">     default:
</span><span class="cx">         break;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsMessageNamescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/MessageNames.cpp (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/MessageNames.cpp        2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/MessageNames.cpp   2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -30,6 +30,10 @@
</span><span class="cx"> const char* description(MessageName name)
</span><span class="cx"> {
</span><span class="cx">     switch (name) {
</span><ins>+    case MessageName::TestWithCVPixelBuffer_ReceiveCVPixelBuffer:
+        return "TestWithCVPixelBuffer_ReceiveCVPixelBuffer";
+    case MessageName::TestWithCVPixelBuffer_SendCVPixelBuffer:
+        return "TestWithCVPixelBuffer_SendCVPixelBuffer";
</ins><span class="cx">     case MessageName::TestWithIfMessage_LoadURL:
</span><span class="cx">         return "TestWithIfMessage_LoadURL";
</span><span class="cx">     case MessageName::TestWithImageData_ReceiveImageData:
</span><span class="lines">@@ -182,6 +186,9 @@
</span><span class="cx"> ReceiverName receiverName(MessageName messageName)
</span><span class="cx"> {
</span><span class="cx">     switch (messageName) {
</span><ins>+    case MessageName::TestWithCVPixelBuffer_ReceiveCVPixelBuffer:
+    case MessageName::TestWithCVPixelBuffer_SendCVPixelBuffer:
+        return ReceiverName::TestWithCVPixelBuffer;
</ins><span class="cx">     case MessageName::TestWithIfMessage_LoadURL:
</span><span class="cx">         return ReceiverName::TestWithIfMessage;
</span><span class="cx">     case MessageName::TestWithImageData_ReceiveImageData:
</span><span class="lines">@@ -275,6 +282,14 @@
</span><span class="cx"> 
</span><span class="cx"> bool isValidMessageName(MessageName messageName)
</span><span class="cx"> {
</span><ins>+#if USE(AVFOUNDATION)
+    if (messageName == IPC::MessageName::TestWithCVPixelBuffer_ReceiveCVPixelBuffer)
+        return true;
+#endif
+#if USE(AVFOUNDATION)
+    if (messageName == IPC::MessageName::TestWithCVPixelBuffer_SendCVPixelBuffer)
+        return true;
+#endif
</ins><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     if (messageName == IPC::MessageName::TestWithIfMessage_LoadURL)
</span><span class="cx">         return true;
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsMessageNamesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/MessageNames.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/MessageNames.h  2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/MessageNames.h     2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,21 +29,24 @@
</span><span class="cx"> namespace IPC {
</span><span class="cx"> 
</span><span class="cx"> enum class ReceiverName : uint8_t {
</span><del>-    TestWithIfMessage = 1
-    , TestWithImageData = 2
-    , TestWithLegacyReceiver = 3
-    , TestWithSemaphore = 4
-    , TestWithStream = 5
-    , TestWithStreamBuffer = 6
-    , TestWithSuperclass = 7
-    , TestWithoutAttributes = 8
-    , IPC = 9
-    , AsyncReply = 10
-    , Invalid = 11
</del><ins>+    TestWithCVPixelBuffer = 1
+    , TestWithIfMessage = 2
+    , TestWithImageData = 3
+    , TestWithLegacyReceiver = 4
+    , TestWithSemaphore = 5
+    , TestWithStream = 6
+    , TestWithStreamBuffer = 7
+    , TestWithSuperclass = 8
+    , TestWithoutAttributes = 9
+    , IPC = 10
+    , AsyncReply = 11
+    , Invalid = 12
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> enum class MessageName : uint16_t {
</span><del>-    TestWithIfMessage_LoadURL
</del><ins>+    TestWithCVPixelBuffer_ReceiveCVPixelBuffer
+    , TestWithCVPixelBuffer_SendCVPixelBuffer
+    , TestWithIfMessage_LoadURL
</ins><span class="cx">     , TestWithImageData_ReceiveImageData
</span><span class="cx">     , TestWithImageData_SendImageData
</span><span class="cx">     , TestWithLegacyReceiver_AddEvent
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithCVPixelBuffermessagesin"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBuffer.messages.in (0 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBuffer.messages.in                               (rev 0)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBuffer.messages.in  2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+# Copyright (C) 2021 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+messages -> TestWithCVPixelBuffer {
+#if USE(AVFOUNDATION)
+    void SendCVPixelBuffer(RetainPtr<CVPixelBufferRef> s0)
+    void ReceiveCVPixelBuffer() -> (RetainPtr<CVPixelBufferRef> r0)
+#endif
+}
</ins></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithCVPixelBufferMessageReceivercppfromrev279220trunkSourceWebKitScriptswebkittestsTestWithImageDataMessageReceivercpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBufferMessageReceiver.cpp (from rev 279220, trunk/Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessageReceiver.cpp) (0 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBufferMessageReceiver.cpp                                (rev 0)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBufferMessageReceiver.cpp   2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TestWithCVPixelBuffer.h"
+
+#if USE(AVFOUNDATION)
+#include "ArgumentCodersCF.h"
+#endif
+#include "Decoder.h"
+#include "HandleMessage.h"
+#include "TestWithCVPixelBufferMessages.h"
+#if USE(AVFOUNDATION)
+#include <wtf/RetainPtr.h>
+#endif
+
+namespace WebKit {
+
+void TestWithCVPixelBuffer::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder)
+{
+    auto protectedThis = makeRef(*this);
+#if USE(AVFOUNDATION)
+    if (decoder.messageName() == Messages::TestWithCVPixelBuffer::SendCVPixelBuffer::name())
+        return IPC::handleMessage<Messages::TestWithCVPixelBuffer::SendCVPixelBuffer>(decoder, this, &TestWithCVPixelBuffer::sendCVPixelBuffer);
+#endif
+    UNUSED_PARAM(connection);
+    UNUSED_PARAM(decoder);
+#if ENABLE(IPC_TESTING_API)
+    if (connection.ignoreInvalidMessageForTesting())
+        return;
+#endif // ENABLE(IPC_TESTING_API)
+    ASSERT_NOT_REACHED_WITH_MESSAGE("Unhandled message %s to %" PRIu64, description(decoder.messageName()), decoder.destinationID());
+}
+
+bool TestWithCVPixelBuffer::didReceiveSyncMessage(IPC::Connection& connection, IPC::Decoder& decoder, UniqueRef<IPC::Encoder>& replyEncoder)
+{
+    auto protectedThis = makeRef(*this);
+#if USE(AVFOUNDATION)
+    if (decoder.messageName() == Messages::TestWithCVPixelBuffer::ReceiveCVPixelBuffer::name())
+        return IPC::handleMessage<Messages::TestWithCVPixelBuffer::ReceiveCVPixelBuffer>(decoder, *replyEncoder, this, &TestWithCVPixelBuffer::receiveCVPixelBuffer);
+#endif
+    UNUSED_PARAM(connection);
+    UNUSED_PARAM(decoder);
+    UNUSED_PARAM(replyEncoder);
+#if ENABLE(IPC_TESTING_API)
+    if (connection.ignoreInvalidMessageForTesting())
+        return false;
+#endif // ENABLE(IPC_TESTING_API)
+    ASSERT_NOT_REACHED_WITH_MESSAGE("Unhandled synchronous message %s to %" PRIu64, description(decoder.messageName()), decoder.destinationID());
+    return false;
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithCVPixelBufferMessageshfromrev279220trunkSourceWebKitScriptswebkittestsTestWithImageDataMessagesh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBufferMessages.h (from rev 279220, trunk/Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessages.h) (0 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBufferMessages.h                         (rev 0)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBufferMessages.h    2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "ArgumentCoders.h"
+#include "Connection.h"
+#include "MessageNames.h"
+#include "TestWithCVPixelBufferMessagesReplies.h"
+#include <wtf/Forward.h>
+#include <wtf/RetainPtr.h>
+#include <wtf/ThreadSafeRefCounted.h>
+
+
+namespace Messages {
+namespace TestWithCVPixelBuffer {
+
+static inline IPC::ReceiverName messageReceiverName()
+{
+    return IPC::ReceiverName::TestWithCVPixelBuffer;
+}
+
+#if USE(AVFOUNDATION)
+class SendCVPixelBuffer {
+public:
+    using Arguments = std::tuple<const RetainPtr<CVPixelBufferRef>&>;
+
+    static IPC::MessageName name() { return IPC::MessageName::TestWithCVPixelBuffer_SendCVPixelBuffer; }
+    static constexpr bool isSync = false;
+
+    explicit SendCVPixelBuffer(const RetainPtr<CVPixelBufferRef>& s0)
+        : m_arguments(s0)
+    {
+    }
+
+    const Arguments& arguments() const
+    {
+        return m_arguments;
+    }
+
+private:
+    Arguments m_arguments;
+};
+#endif
+
+#if USE(AVFOUNDATION)
+class ReceiveCVPixelBuffer {
+public:
+    using Arguments = std::tuple<>;
+
+    static IPC::MessageName name() { return IPC::MessageName::TestWithCVPixelBuffer_ReceiveCVPixelBuffer; }
+    static constexpr bool isSync = true;
+
+    static constexpr auto callbackThread = WTF::CompletionHandlerCallThread::ConstructionThread;
+    using Reply = std::tuple<RetainPtr<CVPixelBufferRef>&>;
+    using ReplyArguments = std::tuple<RetainPtr<CVPixelBufferRef>>;
+    const Arguments& arguments() const
+    {
+        return m_arguments;
+    }
+
+private:
+    Arguments m_arguments;
+};
+#endif
+
+} // namespace TestWithCVPixelBuffer
+} // namespace Messages
</ins></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithCVPixelBufferMessagesReplieshfromrev279220trunkSourceWebKitScriptswebkittestsTestWithStreamMessagesRepliesh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBufferMessagesReplies.h (from rev 279220, trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamMessagesReplies.h) (0 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBufferMessagesReplies.h                          (rev 0)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBufferMessagesReplies.h     2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "MessageNames.h"
+#include <wtf/Forward.h>
+
+
+namespace Messages {
+namespace TestWithCVPixelBuffer {
+
+
+} // namespace TestWithCVPixelBuffer
+} // namespace Messages
</ins></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithIfMessageMessageReceivercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithIfMessageMessageReceiver.cpp (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithIfMessageMessageReceiver.cpp    2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithIfMessageMessageReceiver.cpp       2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithIfMessageMessagesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithIfMessageMessages.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithIfMessageMessages.h     2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithIfMessageMessages.h        2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithIfMessageMessagesRepliesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithIfMessageMessagesReplies.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithIfMessageMessagesReplies.h      2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithIfMessageMessagesReplies.h 2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithImageDataMessageReceivercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessageReceiver.cpp (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessageReceiver.cpp    2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessageReceiver.cpp       2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithImageDataMessagesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessages.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessages.h     2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessages.h        2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithImageDataMessagesRepliesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessagesReplies.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessagesReplies.h      2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessagesReplies.h 2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithLegacyReceiverMessageReceivercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessageReceiver.cpp (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessageReceiver.cpp       2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessageReceiver.cpp  2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithLegacyReceiverMessagesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessages.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessages.h        2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessages.h   2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithLegacyReceiverMessagesRepliesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessagesReplies.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessagesReplies.h 2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessagesReplies.h    2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithSemaphoreMessageReceivercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithSemaphoreMessageReceiver.cpp (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithSemaphoreMessageReceiver.cpp    2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithSemaphoreMessageReceiver.cpp       2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithSemaphoreMessagesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithSemaphoreMessages.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithSemaphoreMessages.h     2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithSemaphoreMessages.h        2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithSemaphoreMessagesRepliesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithSemaphoreMessagesReplies.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithSemaphoreMessagesReplies.h      2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithSemaphoreMessagesReplies.h 2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithStreamBufferMessageReceivercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamBufferMessageReceiver.cpp (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamBufferMessageReceiver.cpp 2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamBufferMessageReceiver.cpp    2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithStreamBufferMessagesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamBufferMessages.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamBufferMessages.h  2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamBufferMessages.h     2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithStreamBufferMessagesRepliesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamBufferMessagesReplies.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamBufferMessagesReplies.h   2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamBufferMessagesReplies.h      2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithStreamMessageReceivercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamMessageReceiver.cpp (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamMessageReceiver.cpp       2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamMessageReceiver.cpp  2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithStreamMessagesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamMessages.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamMessages.h        2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamMessages.h   2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithStreamMessagesRepliesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamMessagesReplies.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamMessagesReplies.h 2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamMessagesReplies.h    2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithSuperclassMessageReceivercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessageReceiver.cpp (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessageReceiver.cpp   2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessageReceiver.cpp      2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithSuperclassMessagesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessages.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessages.h    2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessages.h       2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithSuperclassMessagesRepliesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessagesReplies.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessagesReplies.h     2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessagesReplies.h        2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "MessageNames.h"
</span><span class="cx"> #include "TestClassName.h"
</span><ins>+#include <optional>
</ins><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithoutAttributesMessageReceivercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessageReceiver.cpp (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessageReceiver.cpp        2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessageReceiver.cpp   2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithoutAttributesMessagesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessages.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessages.h 2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessages.h    2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkittestsTestWithoutAttributesMessagesRepliesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessagesReplies.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessagesReplies.h  2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessagesReplies.h     2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2021 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKitSharedCocoaWebCoreArgumentCodersCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm   2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm      2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -66,6 +66,10 @@
</span><span class="cx"> #import <pal/cocoa/DataDetectorsCoreSoftLink.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(AVFOUNDATION)
+#import <WebCore/CoreVideoSoftLink.h>
+#endif
+
</ins><span class="cx"> namespace IPC {
</span><span class="cx"> 
</span><span class="cx"> void ArgumentCoder<WebCore::AttributedString>::encode(Encoder& encoder, const WebCore::AttributedString& attributedString)
</span><span class="lines">@@ -732,4 +736,41 @@
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(IMAGE_ANALYSIS) && ENABLE(DATA_DETECTION)
</span><span class="cx"> 
</span><ins>+#if USE(AVFOUNDATION)
+
+void ArgumentCoder<RetainPtr<CVPixelBufferRef>>::encode(Encoder& encoder, const RetainPtr<CVPixelBufferRef>& pixelBuffer)
+{
+    // Use IOSurface as the means to transfer CVPixelBufferRef.
+    MachSendRight sendRight;
+    if (pixelBuffer) {
+        if (auto surface = WebCore::CVPixelBufferGetIOSurface(pixelBuffer.get()))
+            sendRight = MachSendRight::adopt(IOSurfaceCreateMachPort(surface));
+    }
+    encoder << WTFMove(sendRight);
+}
+
+std::optional<RetainPtr<CVPixelBufferRef>> ArgumentCoder<RetainPtr<CVPixelBufferRef>>::decode(Decoder& decoder)
+{
+    std::optional<MachSendRight> sendRight;
+    decoder >> sendRight;
+    if (!sendRight)
+        return std::nullopt;
+    RetainPtr<CVPixelBufferRef> pixelBuffer;
+    if (!*sendRight)
+        return pixelBuffer;
+    {
+        auto surface = adoptCF(IOSurfaceLookupFromMachPort(sendRight->sendRight()));
+        if (!surface)
+            return std::nullopt;
+        CVPixelBufferRef rawBuffer = nullptr;
+        auto status = WebCore::CVPixelBufferCreateWithIOSurface(kCFAllocatorDefault, surface.get(), nullptr, &rawBuffer);
+        if (status != noErr || !rawBuffer)
+            return std::nullopt;
+        pixelBuffer = adoptCF(rawBuffer);
+    }
+    return pixelBuffer;
+}
+
+#endif
+
</ins><span class="cx"> } // namespace IPC
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebCoreArgumentCodersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h       2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h  2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -89,6 +89,10 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(AVFOUNDATION)
+typedef struct __CVBuffer* CVPixelBufferRef;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class AbsolutePositionConstraints;
</span><span class="lines">@@ -853,6 +857,15 @@
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(IMAGE_ANALYSIS) && ENABLE(DATA_DETECTION)
</span><span class="cx"> 
</span><ins>+#if USE(AVFOUNDATION)
+
+template<> struct ArgumentCoder<RetainPtr<CVPixelBufferRef>> {
+    static void encode(Encoder&, const RetainPtr<CVPixelBufferRef>&);
+    static std::optional<RetainPtr<CVPixelBufferRef>> decode(Decoder&);
+};
+
+#endif
+
</ins><span class="cx"> } // namespace IPC
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessGPUmediacocoaMediaPlayerPrivateRemoteCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm (279220 => 279221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm  2021-06-24 13:49:54 UTC (rev 279220)
+++ trunk/Source/WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm     2021-06-24 14:38:17 UTC (rev 279221)
</span><span class="lines">@@ -84,18 +84,11 @@
</span><span class="cx"> 
</span><span class="cx"> RetainPtr<CVPixelBufferRef> MediaPlayerPrivateRemote::pixelBufferForCurrentTime()
</span><span class="cx"> {
</span><del>-    std::optional<MachSendRight> sendRight;
-    if (!connection().sendSync(Messages::RemoteMediaPlayerProxy::PixelBufferForCurrentTime(), Messages::RemoteMediaPlayerProxy::NativeImageForCurrentTime::Reply(sendRight), m_id))
-        return nullptr;
</del><span class="cx"> 
</span><del>-    if (!sendRight)
</del><ins>+    RetainPtr<CVPixelBufferRef> result;
+    if (!connection().sendSync(Messages::RemoteMediaPlayerProxy::PixelBufferForCurrentTime(), Messages::RemoteMediaPlayerProxy::PixelBufferForCurrentTime::Reply(result), m_id))
</ins><span class="cx">         return nullptr;
</span><del>-
-    auto surface = WebCore::IOSurface::createFromSendRight(WTFMove(*sendRight), WebCore::DestinationColorSpace::SRGB());
-    if (!surface)
-        return nullptr;
-
-    return surface->createPixelBuffer();
</del><ins>+    return result;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre>
</div>
</div>

</body>
</html>