Bug 1563409: Inherit RemoteSubframes and RemoteTabs flags from parent docshells. r=nika

This also adds an extra assertion against browsing context mismatches that
happen when we don't get this right.

Differential Revision: https://phabricator.services.mozilla.com/D36852

--HG--
extra : source : 4b07deb4cd2ef4c98b6d6ee961a20705f4f2deae
This commit is contained in:
Kris Maglione 2019-07-03 16:09:20 -07:00
Родитель df8521eddf
Коммит 4503ade360
2 изменённых файлов: 4 добавлений и 0 удалений

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

@ -3344,6 +3344,9 @@ nsDocShell::AddChild(nsIDocShellTreeItem* aChild) {
childDocShell->SetUseGlobalHistory(true);
}
Cast(childDocShell)->SetRemoteTabs(mUseRemoteTabs);
Cast(childDocShell)->SetRemoteSubframes(mUseRemoteSubframes);
if (aChild->ItemType() != mItemType) {
return NS_OK;
}

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

@ -333,6 +333,7 @@ already_AddRefed<Promise> WindowGlobalParent::ChangeFrameRemoteness(
// in-process frame. For remote frames, the BrowserBridgeParent::Init
// method should've already set up the OwnerProcessId.
uint64_t childId = browserParent->Manager()->ChildID();
MOZ_ASSERT_IF(bridge, browsingContext == browserParent->GetBrowsingContext());
MOZ_ASSERT_IF(bridge, browsingContext->IsOwnedByProcess(childId));
browsingContext->SetOwnerProcessId(childId);