Bug 1908789 - Check for null return from MakePreallocProcess, r=ipc-reviewers,mccr8

Differential Revision: https://phabricator.services.mozilla.com/D217103
This commit is contained in:
Nika Layzell 2024-07-23 20:17:52 +00:00
parent ef1946d9f8
commit aafab294b3

View File

@ -316,6 +316,14 @@ void PreallocatedProcessManagerImpl::AllocateNow() {
}
UniqueContentParentKeepAlive process = ContentParent::MakePreallocProcess();
if (!process) {
// We fully failed to create a prealloc process. Don't try to kick off a new
// preallocation here, to avoid possible looping.
MOZ_LOG(ContentParent::GetLog(), LogLevel::Debug,
("Failed to launch prealloc process"));
return;
}
process->WaitForLaunchAsync(PROCESS_PRIORITY_PREALLOC)
->Then(
GetCurrentSerialEventTarget(), __func__,