tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 8da01c86fb24d3e2cca24b6482ceaeaa1b770f83
parent 25854fa1a7f3bfe514f27da5c7e4a5b128b4d77f
Author: Andrew Osmond <aosmond@gmail.com>
Date:   Tue, 28 Oct 2025 15:52:00 +0000

Bug 1996793 - Remove GPUProcessManager::EnsureGPUReady call in CreateContentBridges. r=gfx-reviewers,jnicol

No need to add a diagnostic assert because the other CreateContent
methods already assert.

Differential Revision: https://phabricator.services.mozilla.com/D270317

Diffstat:
Mdom/ipc/ContentParent.cpp | 5+++--
Mgfx/ipc/GPUProcessManager.cpp | 6+-----
Mgfx/ipc/GPUProcessManager.h | 3+++
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp @@ -2785,7 +2785,7 @@ bool ContentParent::InitInternal(ProcessPriority aInitialPriority) { // 1. Ensure the GPU process is ready, as we know we are not yet in shutdown. GPUProcessManager* gpm = GPUProcessManager::Get(); - gpm->EnsureGPUReady(); + nsresult gpuReadyRv = gpm->EnsureGPUReady(); // 2. Build ContentDeviceData first, as it may affect some gfxVars. gfxPlatform::GetPlatform()->BuildContentDeviceData( &xpcomInit.contentDeviceData()); @@ -2911,7 +2911,8 @@ bool ContentParent::InitInternal(ProcessPriority aInitialPriority) { Endpoint<PRemoteMediaManagerChild> videoManager; AutoTArray<uint32_t, 3> namespaces; - if (!gpm->CreateContentBridges(OtherEndpointProcInfo(), &compositor, + if (NS_FAILED(gpuReadyRv) || + !gpm->CreateContentBridges(OtherEndpointProcInfo(), &compositor, &imageBridge, &vrBridge, &videoManager, mChildID, &namespaces)) { // This can fail if we've already started shutting down the compositor diff --git a/gfx/ipc/GPUProcessManager.cpp b/gfx/ipc/GPUProcessManager.cpp @@ -1361,10 +1361,6 @@ bool GPUProcessManager::CreateContentBridges( ipc::Endpoint<PVRManagerChild>* aOutVRBridge, ipc::Endpoint<PRemoteMediaManagerChild>* aOutVideoManager, dom::ContentParentId aChildId, nsTArray<uint32_t>* aNamespaces) { - if (NS_WARN_IF(NS_FAILED(EnsureGPUReady()))) { - return false; - } - const uint32_t cmNamespace = AllocateNamespace(); if (!CreateContentCompositorManager(aOtherProcess, aChildId, cmNamespace, aOutCompositor) || @@ -1372,7 +1368,7 @@ bool GPUProcessManager::CreateContentBridges( !CreateContentVRManager(aOtherProcess, aChildId, aOutVRBridge)) { return false; } - // VideoDeocderManager is only supported in the GPU process, so we allow this + // RemoteMediaManager is only supported in the GPU process, so we allow this // to be fallible. CreateContentRemoteMediaManager(aOtherProcess, aChildId, aOutVideoManager); // Allocates 3 namespaces(for CompositorManagerChild, CompositorBridgeChild diff --git a/gfx/ipc/GPUProcessManager.h b/gfx/ipc/GPUProcessManager.h @@ -117,6 +117,9 @@ class GPUProcessManager final : public GPUProcessHost::Listener { bool aUseExternalSurfaceSize, const gfx::IntSize& aSurfaceSize, uint64_t aInnerWindowId, bool* aRetry); + // It is asserted that IsGPUReady() is true for this method. If not on a path + // which guarantees that, then the caller must call EnsureGPUReady() and check + // its return code first. bool CreateContentBridges( mozilla::ipc::EndpointProcInfo aOtherProcess, mozilla::ipc::Endpoint<PCompositorManagerChild>* aOutCompositor,