commit 8c871c264e99d1815a5fd548090c45f689078ea6
parent ee04f679028991831bbd092cbe81a4f6b0894789
Author: Andrew Osmond <aosmond@gmail.com>
Date: Fri, 10 Oct 2025 02:41:10 +0000
Bug 1993562 - Remove call to EnsureGPUReady in GPUProcessManager::GetProcessMemoryReporter. r=gfx-reviewers,lsalzman
We only need to wait for a GPU process to finish launching if it is in
progress, so that we can include it in the report.
Differential Revision: https://phabricator.services.mozilla.com/D268197
Diffstat:
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/gfx/ipc/GPUProcessManager.cpp b/gfx/ipc/GPUProcessManager.cpp
@@ -1730,9 +1730,7 @@ class GPUMemoryReporter : public MemoryReportingProcess {
private:
GPUChild* GetChild() const {
if (GPUProcessManager* gpm = GPUProcessManager::Get()) {
- if (GPUChild* child = gpm->GetGPUChild()) {
- return child;
- }
+ return gpm->GetGPUChild();
}
return nullptr;
}
@@ -1742,12 +1740,14 @@ class GPUMemoryReporter : public MemoryReportingProcess {
};
RefPtr<MemoryReportingProcess> GPUProcessManager::GetProcessMemoryReporter() {
- // Ensure mProcess is non-null before calling EnsureGPUReady, to avoid
- // launching the process if it has not already been launched.
- if (!mProcess || NS_FAILED(EnsureGPUReady())) {
+ // If we are in the middle of launching a GPU process, we can wait for it to
+ // finish, otherwise if there is no GPU process, we should just return now to
+ // avoid launching it again.
+ if (!mProcess || AppShutdown::IsInOrBeyond(ShutdownPhase::XPCOMShutdown) ||
+ !mProcess->WaitForLaunch()) {
return nullptr;
}
- return new GPUMemoryReporter();
+ return MakeRefPtr<GPUMemoryReporter>();
}
void GPUProcessManager::SetAppInForeground(bool aInForeground) {