Bug 1563409: Inherit RemoteSubframes and RemoteTabs flags from parent docshells. r=nika
authorKris Maglione <maglione.k@gmail.com>
Wed, 03 Jul 2019 16:09:20 -0700
changeset 483301 3ee10692d6a2766c0cd4bbf1960c0df282e8e3fd
parent 483300 af94f72eeb78831bceb05d1f6f133fc863801029
child 483374 543d2c7bc8cacf24c15a949e586b7f75ce4c530f
push id113716
push usermaglione.k@gmail.com
push dateThu, 18 Jul 2019 18:38:51 +0000
treeherdermozilla-inbound@3ee10692d6a2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1563409
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
docshell/base/nsDocShell.cpp
dom/ipc/WindowGlobalParent.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -3339,16 +3339,19 @@ nsDocShell::AddChild(nsIDocShellTreeItem
   }
   childDocShell->SetChildOffset(dynamic ? -1 : mChildList.Length() - 1);
 
   /* Set the child's global history if the parent has one */
   if (mUseGlobalHistory) {
     childDocShell->SetUseGlobalHistory(true);
   }
 
+  Cast(childDocShell)->SetRemoteTabs(mUseRemoteTabs);
+  Cast(childDocShell)->SetRemoteSubframes(mUseRemoteSubframes);
+
   if (aChild->ItemType() != mItemType) {
     return NS_OK;
   }
 
   aChild->SetTreeOwner(mTreeOwner);
 
   nsCOMPtr<nsIDocShell> childAsDocShell(do_QueryInterface(aChild));
   if (!childAsDocShell) {
--- a/dom/ipc/WindowGlobalParent.cpp
+++ b/dom/ipc/WindowGlobalParent.cpp
@@ -328,16 +328,17 @@ already_AddRefed<Promise> WindowGlobalPa
           return;
         }
 
         // Update our BrowsingContext to its new owner, if it hasn't been
         // updated yet. This can happen when switching from a out-of-process to
         // 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);
 
         promise->MaybeResolve(childId);
       };
 
   auto reject = [=](ResponseRejectReason aReason) {
     promise->MaybeReject(NS_ERROR_FAILURE);