Bug 1541038 - Part 1: Sync a BrowsingContext to it's groups. r=nika a=pascalc
authorAndreas Farre <farre@mozilla.com>
Sun, 21 Apr 2019 03:13:27 +0300
changeset 526264 b476772da6b0bcb6331b98cedfbdc3faae72388f
parent 526263 2d12891a1a5493bac5886af3ede2db14b30a1ee6
child 526265 05d12183776b26907ebacbc9b0bbf282e148cc1a
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika, pascalc
bugs1541038
milestone67.0
Bug 1541038 - Part 1: Sync a BrowsingContext to it's groups. r=nika a=pascalc Reviewers: nika Reviewed By: nika Subscribers: reviewbot Bug #: 1541038 Differential Revision: https://phabricator.services.mozilla.com/D27317
dom/ipc/ContentParent.cpp
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -5739,16 +5739,27 @@ mozilla::ipc::IPCResult ContentParent::R
   if (!child) {
     RefPtr<BrowsingContextGroup> group =
         BrowsingContextGroup::Select(aInit.mParentId, aInit.mOpenerId);
     child = BrowsingContext::CreateFromIPC(std::move(aInit), group, this);
   }
 
   child->Attach(/* aFromIPC */ true);
 
+  for (auto iter = child->Group()->ContentParentsIter(); !iter.Done();
+       iter.Next()) {
+    nsRefPtrHashKey<ContentParent>* entry = iter.Get();
+    if (entry->GetKey() == this) {
+      continue;
+    }
+
+    Unused << entry->GetKey()->SendAttachBrowsingContext(
+      child->GetIPCInitializer());
+  }
+
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvDetachBrowsingContext(
     BrowsingContext* aContext, bool aMoveToBFCache) {
   if (!aContext) {
     MOZ_LOG(BrowsingContext::GetLog(), LogLevel::Debug,
             ("ParentIPC: Trying to detach already detached"));