-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use smart pointers to store references to ObjectHeap
https://bugs.webkit.org/show_bug.cgi?id=270892 rdar://124497369 Reviewed by Mike Wyrzykowski. We expect the objects to never outlive the ObjectHeap, so use WeakRef instead of WeakPtr. However, the objects are ThreadSafeRefCounted, so if something does happen and something keeps a strong reference to the objects to keep them alive beyond the lifetime of the ObjectHeap, we want to dereference null and crash safely instead of using a C++ reference to a freed object. While I was at it, I did the same with all stored C++ references in Source/WebKit/GPUProcess, and made withDisplayBufferAsNativeImage always call its completion handler. * Source/WebKit/GPUProcess/ShapeDetection/RemoteBarcodeDetector.h: * Source/WebKit/GPUProcess/ShapeDetection/RemoteFaceDetector.h: * Source/WebKit/GPUProcess/ShapeDetection/RemoteTextDetector.h: * Source/WebKit/GPUProcess/ShapeDetection/ShapeDetectionObjectHeap.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteAdapter.cpp: (WebKit::RemoteAdapter::destruct): (WebKit::RemoteAdapter::requestDevice): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteAdapter.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteBindGroup.cpp: (WebKit::RemoteBindGroup::destruct): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteBindGroup.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteBindGroupLayout.cpp: (WebKit::RemoteBindGroupLayout::destruct): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteBindGroupLayout.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteBuffer.cpp: (WebKit::RemoteBuffer::destruct): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteBuffer.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteCommandBuffer.cpp: (WebKit::RemoteCommandBuffer::destruct): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteCommandBuffer.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteCommandEncoder.cpp: (WebKit::RemoteCommandEncoder::destruct): (WebKit::RemoteCommandEncoder::beginRenderPass): (WebKit::RemoteCommandEncoder::beginComputePass): (WebKit::RemoteCommandEncoder::copyBufferToBuffer): (WebKit::RemoteCommandEncoder::copyBufferToTexture): (WebKit::RemoteCommandEncoder::copyTextureToBuffer): (WebKit::RemoteCommandEncoder::copyTextureToTexture): (WebKit::RemoteCommandEncoder::clearBuffer): (WebKit::RemoteCommandEncoder::writeTimestamp): (WebKit::RemoteCommandEncoder::resolveQuerySet): (WebKit::RemoteCommandEncoder::finish): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteCommandEncoder.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteCompositorIntegration.cpp: (WebKit::RemoteCompositorIntegration::destruct): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteCompositorIntegration.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteComputePassEncoder.cpp: (WebKit::RemoteComputePassEncoder::destruct): (WebKit::RemoteComputePassEncoder::setPipeline): (WebKit::RemoteComputePassEncoder::dispatchIndirect): (WebKit::RemoteComputePassEncoder::setBindGroup): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteComputePassEncoder.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteComputePipeline.cpp: (WebKit::RemoteComputePipeline::destruct): (WebKit::RemoteComputePipeline::getBindGroupLayout): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteComputePipeline.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.cpp: (WebKit::RemoteDevice::destruct): (WebKit::RemoteDevice::createBuffer): (WebKit::RemoteDevice::createTexture): (WebKit::RemoteDevice::createSampler): (WebKit::RemoteDevice::importExternalTextureFromVideoFrame): (WebKit::RemoteDevice::createBindGroupLayout): (WebKit::RemoteDevice::createPipelineLayout): (WebKit::RemoteDevice::createBindGroup): (WebKit::RemoteDevice::createShaderModule): (WebKit::RemoteDevice::createComputePipeline): (WebKit::RemoteDevice::createRenderPipeline): (WebKit::RemoteDevice::createComputePipelineAsync): (WebKit::RemoteDevice::createRenderPipelineAsync): (WebKit::RemoteDevice::createCommandEncoder): (WebKit::RemoteDevice::createRenderBundleEncoder): (WebKit::RemoteDevice::createQuerySet): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteExternalTexture.cpp: (WebKit::RemoteExternalTexture::destruct): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteExternalTexture.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemotePipelineLayout.cpp: (WebKit::RemotePipelineLayout::destruct): * Source/WebKit/GPUProcess/graphics/WebGPU/RemotePipelineLayout.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemotePresentationContext.cpp: (WebKit::RemotePresentationContext::configure): (WebKit::RemotePresentationContext::getCurrentTexture): * Source/WebKit/GPUProcess/graphics/WebGPU/RemotePresentationContext.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteQuerySet.cpp: (WebKit::RemoteQuerySet::destruct): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteQuerySet.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteQueue.cpp: (WebKit::RemoteQueue::destruct): (WebKit::RemoteQueue::submit): (WebKit::RemoteQueue::writeBuffer): (WebKit::RemoteQueue::writeTexture): (WebKit::RemoteQueue::copyExternalImageToTexture): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteQueue.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteRenderBundle.cpp: (WebKit::RemoteRenderBundle::destruct): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteRenderBundle.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteRenderBundleEncoder.cpp: (WebKit::RemoteRenderBundleEncoder::destruct): (WebKit::RemoteRenderBundleEncoder::setPipeline): (WebKit::RemoteRenderBundleEncoder::setIndexBuffer): (WebKit::RemoteRenderBundleEncoder::setVertexBuffer): (WebKit::RemoteRenderBundleEncoder::drawIndirect): (WebKit::RemoteRenderBundleEncoder::drawIndexedIndirect): (WebKit::RemoteRenderBundleEncoder::setBindGroup): (WebKit::RemoteRenderBundleEncoder::finish): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteRenderBundleEncoder.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteRenderPassEncoder.cpp: (WebKit::RemoteRenderPassEncoder::destruct): (WebKit::RemoteRenderPassEncoder::setPipeline): (WebKit::RemoteRenderPassEncoder::setIndexBuffer): (WebKit::RemoteRenderPassEncoder::setVertexBuffer): (WebKit::RemoteRenderPassEncoder::drawIndirect): (WebKit::RemoteRenderPassEncoder::drawIndexedIndirect): (WebKit::RemoteRenderPassEncoder::setBindGroup): (WebKit::RemoteRenderPassEncoder::setBlendConstant): (WebKit::RemoteRenderPassEncoder::executeBundles): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteRenderPassEncoder.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteRenderPipeline.cpp: (WebKit::RemoteRenderPipeline::destruct): (WebKit::RemoteRenderPipeline::getBindGroupLayout): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteRenderPipeline.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteSampler.cpp: (WebKit::RemoteSampler::destruct): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteSampler.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteShaderModule.cpp: (WebKit::RemoteShaderModule::destruct): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteShaderModule.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteTexture.cpp: (WebKit::RemoteTexture::createView): (WebKit::RemoteTexture::destruct): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteTexture.h: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteTextureView.cpp: (WebKit::RemoteTextureView::destruct): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteTextureView.h: * Source/WebKit/GPUProcess/graphics/WebGPU/WebGPUObjectHeap.h: Canonical link: https://commits.webkit.org/276036@main
- Loading branch information
1 parent
d83537a
commit 60aeffa
Showing
82 changed files
with
268 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.