tor-browser

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

commit 7b8ddfce05cf8d0cb4c549272e7ba20b768ff3e3
parent 3e242617348362bc707dcaf113ceee4a62b84e40
Author: Andrew Osmond <aosmond@gmail.com>
Date:   Thu,  9 Oct 2025 23:47:10 +0000

Bug 1993553 - Remove call to EnsureGPUReady in GPUProcessManager::UnmapLayerTreeId. r=gfx-reviewers,lsalzman

This reduces the pathways from which we can create a GPU process. In
this case, it should not be necessary because we either 1) have a GPU
process already, in which case we can send an IPDL message to destroy
it, 2) are compositing in the parent process, in which case we won't
relaunch it, or 3) we don't have a GPU process at this moment, but need
one, and the layer ID isn't valid anyways.

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

Diffstat:
Mgfx/ipc/GPUProcessManager.cpp | 16++++------------
1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/gfx/ipc/GPUProcessManager.cpp b/gfx/ipc/GPUProcessManager.cpp @@ -1555,23 +1555,15 @@ void GPUProcessManager::MapLayerTreeId(LayersId aLayersId, void GPUProcessManager::UnmapLayerTreeId(LayersId aLayersId, base::ProcessId aOwningId) { - // Only call EnsureGPUReady() if we have already launched the process, to - // avoid launching a new process unnecesarily. (eg if we are backgrounded) - nsresult rv = mProcess ? EnsureGPUReady() : NS_ERROR_NOT_AVAILABLE; - if (NS_WARN_IF(rv == NS_ERROR_ILLEGAL_DURING_SHUTDOWN)) { - return; - } - - if (NS_SUCCEEDED(rv)) { + // If the GPU process is down, but not disabled, there is no need to relaunch + // here because the layers ID is already invalid. + if (mGPUChild) { mGPUChild->SendRemoveLayerTreeIdMapping( LayerTreeIdMapping(aLayersId, aOwningId)); - } else if (!mProcess) { + } else if (!gfxConfig::IsEnabled(Feature::GPU_PROCESS)) { CompositorBridgeParent::DeallocateLayerTreeId(aLayersId); } - // Must do this *after* the call to EnsureGPUReady, so that if the - // process is launched as a result then it is initialized with this - // LayersId, meaning it can be successfully unmapped. LayerTreeOwnerTracker::Get()->Unmap(aLayersId, aOwningId); }