Bug 1523982 - Part 4: When WindowGlobalChild creating, update WindowGlobalParent document's URI; r=nika
authorJohn Dai <jdai@mozilla.com>
Tue, 26 Mar 2019 15:19:58 +0000
changeset 466120 54f0ce4913e043c1eddbb18704a2f0d1d4d1c4d5
parent 466119 06a189e6b675149d77a254e6e4678c9c898d3158
child 466121 7fa7d6e6dedc32fbc59e3dcae4c58cc38bb86921
push id1
push userpvanderbeken@mozilla.com
push dateThu, 28 Mar 2019 13:34:35 +0000
reviewersnika
bugs1523982
milestone68.0a1
Bug 1523982 - Part 4: When WindowGlobalChild creating, update WindowGlobalParent document's URI; r=nika Depends on D24205 Differential Revision: https://phabricator.services.mozilla.com/D24547
dom/ipc/WindowGlobalChild.cpp
--- a/dom/ipc/WindowGlobalChild.cpp
+++ b/dom/ipc/WindowGlobalChild.cpp
@@ -65,16 +65,18 @@ already_AddRefed<WindowGlobalChild> Wind
   if (!gWindowGlobalChildById) {
     gWindowGlobalChildById = new WGCByIdMap();
     ClearOnShutdown(&gWindowGlobalChildById);
   }
   auto entry = gWindowGlobalChildById->LookupForAdd(wgc->mInnerWindowId);
   MOZ_RELEASE_ASSERT(!entry, "Duplicate WindowGlobalChild entry for ID!");
   entry.OrInsert([&] { return wgc; });
 
+  // Send down our initial document URI.
+  wgc->SendUpdateDocumentURI(aWindow->GetDocumentURI());
   return wgc.forget();
 }
 
 /* static */
 already_AddRefed<WindowGlobalChild> WindowGlobalChild::GetByInnerWindowId(
     uint64_t aInnerWindowId) {
   if (!gWindowGlobalChildById) {
     return nullptr;