commit a0b092e3854c4a6b59b2a124ecd67a2a789d1b5e
parent 7b8ddfce05cf8d0cb4c549272e7ba20b768ff3e3
Author: Andrew Osmond <aosmond@gmail.com>
Date: Thu, 9 Oct 2025 23:47:46 +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
@@ -1734,9 +1734,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;
}
@@ -1746,12 +1744,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) {