Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebGPU] Make RemoteGPU owned by RemoteRenderingBackend rather than G…
…PUConnectionToWebProcess https://bugs.webkit.org/show_bug.cgi?id=255429 <rdar://problem/108171820> Reviewed by Matt Woodrow. This patch isn't strictly necessary, but I do think this is a better design. Previously, every GPU object in the web process got its own identifier, and that identifier got sent to the GPU process. The GPU process has a GPUConnectionToWebProcess for each web process, and it owned a HashMap<> of the GPU objects for that web process. That's okay, but it doesn't fit very well with the design of the GPU process. Every Page in the web process has an associated RemoteRenderingBackend for that page, which is the owner of all the resources used by that page (the RemoteRenderingBackend owns a RemoteResourceCache which contains all the resources). It's a generally better design to match this for WebGPU, and make the GPU object owned by the RemoteRenderingBackend rather than the GPUConnectionToWebProcess. There are a few benefits to this design: 1. It more closely matches the ownership model for normal page drawing, which just makes it less complicated to understand and reason about 2. At some point, we're going to have to implement interactions with other parts of the web platform (videos, canvas 2d, etc.) in WebGPU. All those resources are owned by the RemoteRenderingBackend. We could have each individual entry point reach into the RemoteRenderingBackend to pull out what it needs, but it's a more convenient design if everything just already lives in the same place. No tests because there is no behavior change. * Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::createRemoteGPU): Deleted. (WebKit::GPUConnectionToWebProcess::releaseRemoteGPU): Deleted. * Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h: * Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in: * Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::createRemoteGPU): (WebKit::RemoteRenderingBackend::releaseRemoteGPU): * Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h: * Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.messages.in: * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteGPU.cpp: (WebKit::RemoteGPU::RemoteGPU): (WebKit::RemoteGPU::initialize): (WebKit::RemoteGPU::stopListeningForIPC): * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteGPU.h: * Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteGPUProxy.cpp: (WebKit::RemoteGPUProxy::create): (WebKit::RemoteGPUProxy::RemoteGPUProxy): (WebKit::RemoteGPUProxy::~RemoteGPUProxy): (WebKit::RemoteGPUProxy::initializeIPC): (WebKit::RemoteGPUProxy::disconnectGpuProcessIfNeeded): Deleted. (WebKit::RemoteGPUProxy::gpuProcessConnectionDidClose): Deleted. (WebKit::RemoteGPUProxy::abandonGPUProcess): Deleted. * Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteGPUProxy.h: * Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createGPUForWebGPU const): Canonical link: https://commits.webkit.org/263054@main
- Loading branch information
Showing
11 changed files
with
67 additions
and
105 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
Oops, something went wrong.