more PiP fixes

This commit is contained in:
wuggy 2026-09-13 11:52:14 -07:00
commit aac2156499
6 changed files with 56 additions and 7 deletions

View file

@ -881,9 +881,20 @@ ContentParent::CreateBrowser(const TabContext& aContext,
constructorSender = CreateContentBridgeParent(aContext, initialPriority,
openerTabId, &tabId);
} else {
constructorSender =
GetNewOrUsedBrowserProcess(aContext.IsMozBrowserElement(),
initialPriority, nullptr, aFreshProcess);
if (aOpenerContentParent && !aFreshProcess) {
// relatedBrowser requires the same process, not another process from
// the pool. Picture-in-Picture shares a video through a process-local
// module, and cannot use a randomly selected content process.
if (!aOpenerContentParent->IsAlive() ||
aOpenerContentParent->IsForBrowser() != aContext.IsMozBrowserElement()) {
return nullptr;
}
constructorSender = aOpenerContentParent;
} else {
constructorSender =
GetNewOrUsedBrowserProcess(aContext.IsMozBrowserElement(),
initialPriority, nullptr, aFreshProcess);
}
if (!constructorSender) {
return nullptr;
}