Every RemoteDisplayListRecorder currently has a SharedVideoFrameReader by value. 99% of them will never use it. so it should be allocated lazily.
There is some cost here to: _kernelrpc_mach_port_mod_refs_trap WTF::MachSendRight::MachSendRight(WTF::MachSendRight const&) WebKit::SharedVideoFrameReader::SharedVideoFrameReader(WTF::RefPtr<WebKit::RemoteVideoFrameObjectHeap, WTF::RawPtrTraits<WebKit::RemoteVideoFrameObjectHeap>, WTF::DefaultRefDerefTraits<WebKit::RemoteVideoFrameObjectHeap>>&&, WebCore::ProcessIdentity const&, WebKit::SharedVideoFrameReader::UseIOSurfaceBufferPool) WebKit::RemoteDisplayListRecorder::create(WebCore::ImageBuffer&, WTF::ObjectIdentifierGeneric<WebCore::RenderingResourceIdentifierType, WTF::ObjectIdentifierThreadSafeAccessTraits>, WebKit::RemoteRenderingBackend&) WebKit::RemoteRenderingBackend::didCreateImageBuffer(WTF::Ref<WebCore::ImageBuffer, WTF::RawPtrTraits<WebCore::ImageBuffer>>)
I did the same on the other side of the connection in bug 258379.
<rdar://problem/116586176>
Pull request: https://github.com/WebKit/WebKit/pull/20141
Committed 270404@main (34b59cbee757): <https://commits.webkit.org/270404@main> Reviewed commits have been landed. Closing PR #20141 and removing active labels.