Bug 1648356 - Don't crash the parent process we fail to share font-list blocks while launching a child; the content process will safely handle this by requesting blocks as needed. r=jwatt

Differential Revision: https://phabricator.services.mozilla.com/D81338
This commit is contained in:
Jonathan Kew 2020-06-26 21:25:25 +00:00
Родитель 893cb93c43
Коммит 72f3b67c66
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -615,7 +615,12 @@ void FontList::ShareBlocksToProcess(nsTArray<base::SharedMemoryHandle>* aBlocks,
base::SharedMemoryHandle* handle =
aBlocks->AppendElement(base::SharedMemory::NULLHandle());
if (!shmem->ShareToProcess(aPid, handle)) {
MOZ_CRASH("failed to share block");
// If something went wrong here, we just bail out; the child will need to
// request the blocks as needed, at some performance cost. (Although in
// practice this may mean resources are so constrained the child process
// isn't really going to work at all. But that's not our problem here.)
aBlocks->Clear();
return;
}
}
}