Bug 1766132 - Use right process behaviour with BFCache in parent. r=smaug

Because we rely on the process switching code for replacing the
frameloaders for BFCache in the parent, we need to force the process
switch behaviour to PROCESS_BEHAVIOR_STANDARD if BFCache in the parent
is on.

Differential Revision: https://phabricator.services.mozilla.com/D144518
This commit is contained in:
Peter Van der Beken 2022-04-28 16:53:24 +00:00
Родитель 12f8ed22e1
Коммит a2c5c5d3b6
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -1546,8 +1546,10 @@ static DocumentLoadListener::ProcessBehavior GetProcessSwitchBehavior(
bool isRemoteBrowser = false;
browser->GetIsRemoteBrowser(&isRemoteBrowser);
if (isRemoteBrowser) {
return DocumentLoadListener::ProcessBehavior::
PROCESS_BEHAVIOR_SUBFRAME_ONLY;
return mozilla::BFCacheInParent() ? DocumentLoadListener::ProcessBehavior::
PROCESS_BEHAVIOR_STANDARD
: DocumentLoadListener::ProcessBehavior::
PROCESS_BEHAVIOR_SUBFRAME_ONLY;
}
return DocumentLoadListener::ProcessBehavior::PROCESS_BEHAVIOR_DISABLED;
}