Bug 1616991 - Rename WindowGlobalChild::WindowGlobal getter to reflect nullability, r=kmag
authorNika Layzell <nika@thelayzells.com>
Mon, 23 Mar 2020 23:03:50 +0000
changeset 520421 59b5013d907ea710b07fb409a24d34fbac7eb060
parent 520420 d2cd2c812a9559058ed5c66e966856c1dd1562d7
child 520422 25e29e4e41364fe532eec70e53bf139fb0751b21
push id37249
push userdvarga@mozilla.com
push dateWed, 25 Mar 2020 21:39:06 +0000
treeherdermozilla-central@b3c3f7d0f044 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1616991
milestone76.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 1616991 - Rename WindowGlobalChild::WindowGlobal getter to reflect nullability, r=kmag Differential Revision: https://phabricator.services.mozilla.com/D64660
docshell/base/nsDocShell.cpp
dom/ipc/JSWindowActorChild.cpp
dom/ipc/WindowGlobalChild.cpp
dom/ipc/WindowGlobalChild.h
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -6625,17 +6625,17 @@ nsresult nsDocShell::CreateContentViewer
       /* aBaseURI */ nullptr,
       /* aTryToSaveOldPresentation */ true,
       /* aCheckPermitUnload */ true, aWindowActor);
   if (NS_SUCCEEDED(rv)) {
     RefPtr<Document> doc(GetDocument());
     MOZ_ASSERT(
         doc,
         "Should have a document if CreateAboutBlankContentViewer succeeded");
-    MOZ_ASSERT(doc->GetOwnerGlobal() == aWindowActor->WindowGlobal(),
+    MOZ_ASSERT(doc->GetOwnerGlobal() == aWindowActor->GetWindowGlobal(),
                "New document should be in the same global as our actor");
 
     // FIXME: We may want to support non-initial documents here.
     doc->SetIsInitialDocument(true);
   }
 
   return rv;
 }
--- a/dom/ipc/JSWindowActorChild.cpp
+++ b/dom/ipc/JSWindowActorChild.cpp
@@ -110,17 +110,17 @@ void JSWindowActorChild::SendRawMessage(
 }
 
 Document* JSWindowActorChild::GetDocument(ErrorResult& aRv) {
   if (!mManager) {
     aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
     return nullptr;
   }
 
-  nsGlobalWindowInner* window = mManager->WindowGlobal();
+  nsGlobalWindowInner* window = mManager->GetWindowGlobal();
   return window ? window->GetDocument() : nullptr;
 }
 
 BrowsingContext* JSWindowActorChild::GetBrowsingContext(ErrorResult& aRv) {
   if (!mManager) {
     aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
     return nullptr;
   }
--- a/dom/ipc/WindowGlobalChild.cpp
+++ b/dom/ipc/WindowGlobalChild.cpp
@@ -265,17 +265,17 @@ mozilla::ipc::IPCResult WindowGlobalChil
   }
   dom::BrowsingContext* frameContext = aFrameContext.get();
 
   RefPtr<Element> embedderElt = frameContext->GetEmbedderElement();
   if (NS_WARN_IF(!embedderElt)) {
     return IPC_OK();
   }
 
-  if (NS_WARN_IF(embedderElt->GetOwnerGlobal() != WindowGlobal())) {
+  if (NS_WARN_IF(embedderElt->GetOwnerGlobal() != GetWindowGlobal())) {
     return IPC_OK();
   }
 
   RefPtr<nsFrameLoaderOwner> flo = do_QueryObject(embedderElt);
   MOZ_DIAGNOSTIC_ASSERT(flo, "Embedder must be a nsFrameLoaderOwner");
 
   // Trigger a process switch into the current process.
   RemotenessOptions options;
@@ -322,17 +322,17 @@ mozilla::ipc::IPCResult WindowGlobalChil
   }
 
   RefPtr<Element> embedderElt = frameContext->GetEmbedderElement();
   if (NS_WARN_IF(!embedderElt)) {
     BrowserBridgeChild::Send__delete__(bridge);
     return IPC_OK();
   }
 
-  if (NS_WARN_IF(embedderElt->GetOwnerGlobal() != WindowGlobal())) {
+  if (NS_WARN_IF(embedderElt->GetOwnerGlobal() != GetWindowGlobal())) {
     BrowserBridgeChild::Send__delete__(bridge);
     return IPC_OK();
   }
 
   RefPtr<nsFrameLoaderOwner> flo = do_QueryObject(embedderElt);
   MOZ_DIAGNOSTIC_ASSERT(flo, "Embedder must be a nsFrameLoaderOwner");
 
   // Trgger a process switch into the specified process.
--- a/dom/ipc/WindowGlobalChild.h
+++ b/dom/ipc/WindowGlobalChild.h
@@ -44,17 +44,17 @@ class WindowGlobalChild final : public W
 
   static already_AddRefed<WindowGlobalChild> GetByInnerWindowId(
       const GlobalObject& aGlobal, uint64_t aInnerWindowId) {
     return GetByInnerWindowId(aInnerWindowId);
   }
 
   dom::BrowsingContext* BrowsingContext() override { return mBrowsingContext; }
   dom::WindowContext* WindowContext() { return mWindowContext; }
-  nsGlobalWindowInner* WindowGlobal() { return mWindowGlobal; }
+  nsGlobalWindowInner* GetWindowGlobal() { return mWindowGlobal; }
 
   // Has this actor been shut down
   bool IsClosed() { return !CanSend(); }
   void Destroy();
 
   // Check if this actor is managed by PInProcess, as-in the document is loaded
   // in the chrome process.
   bool IsInProcess() { return XRE_IsParentProcess(); }