Bug 1463015: Part 4 - Remove mozIDOMWindow/mozIDOMWindowProxy interfaces. r?nika draft
authorKris Maglione <maglione.k@gmail.com>
Sun, 20 May 2018 14:49:11 -0700
changeset 797548 f5edcee36403291354f5f4c3d0e71649e795218b
parent 797547 c0b936e8ce0ecbf34244255ced8762c38f545924
child 797625 cc786d89b47072e5bc30f0128e1e74f25b38b0aa
push id110512
push usermaglione.k@gmail.com
push dateSun, 20 May 2018 22:52:08 +0000
reviewersnika
bugs1463015
milestone62.0a1
Bug 1463015: Part 4 - Remove mozIDOMWindow/mozIDOMWindowProxy interfaces. r?nika MozReview-Commit-ID: 82ZAyJU0shK
docshell/base/nsDocShell.cpp
dom/base/moz.build
dom/base/mozIDOMWindow.idl
dom/base/nsGlobalWindowInner.cpp
dom/base/nsGlobalWindowInner.h
dom/base/nsGlobalWindowOuter.cpp
dom/base/nsGlobalWindowOuter.h
dom/base/nsPIDOMWindow.h
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -543,17 +543,16 @@ nsDocShell::GetInterface(const nsIID& aI
   if (aIID.Equals(NS_GET_IID(nsICommandManager))) {
     NS_ENSURE_SUCCESS(EnsureCommandHandler(), NS_ERROR_FAILURE);
     *aSink = mCommandManager;
   } else if (aIID.Equals(NS_GET_IID(nsIURIContentListener))) {
     *aSink = mContentListener;
   } else if ((aIID.Equals(NS_GET_IID(nsIScriptGlobalObject)) ||
               aIID.Equals(NS_GET_IID(nsIGlobalObject)) ||
               aIID.Equals(NS_GET_IID(nsPIDOMWindowOuter)) ||
-              aIID.Equals(NS_GET_IID(mozIDOMWindowProxy)) ||
               aIID.Equals(NS_GET_IID(nsIDOMWindow))) &&
              NS_SUCCEEDED(EnsureScriptEnvironment())) {
     return mScriptGlobal->QueryInterface(aIID, aSink);
   } else if (aIID.Equals(NS_GET_IID(nsIDOMDocument)) &&
              NS_SUCCEEDED(EnsureContentViewer())) {
     nsCOMPtr<nsIDOMDocument> doc =
       do_QueryInterface(mContentViewer->GetDocument());
     doc.forget(aSink);
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -8,17 +8,16 @@ with Files('*Selection*'):
     BUG_COMPONENT = ('Core', 'Selection')
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "DOM")
 
 TEST_DIRS += ['test']
 
 XPIDL_SOURCES += [
-    'mozIDOMWindow.idl',
     'nsIContentPolicy.idl',
     'nsIDocumentEncoder.idl',
     'nsIDOMRequestService.idl',
     'nsIDroppedLinkHandler.idl',
     'nsIFrameLoaderOwner.idl',
     'nsIImageLoadingContent.idl',
     'nsIMessageManager.idl',
     'nsIObjectLoadingContent.idl',
deleted file mode 100644
--- a/dom/base/mozIDOMWindow.idl
+++ /dev/null
@@ -1,16 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-/*
- * Placeholder interfaces to allow passing inner/outer windows through XPIDL.
- */
-[scriptable, builtinclass, uuid(75fbabd6-7a2e-4787-aa33-449a33512135)]
-interface mozIDOMWindow : nsISupports
-{};
-
-[scriptable, builtinclass, uuid(53ca090c-e739-48b9-8911-208c72f9191e)]
-interface mozIDOMWindowProxy : nsISupports
-{};
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -1332,19 +1332,16 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_INTERFACE_MAP_ENTRY(nsIDOMWindow)
   NS_INTERFACE_MAP_ENTRY(nsIGlobalObject)
   NS_INTERFACE_MAP_ENTRY(nsIScriptGlobalObject)
   NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal)
   NS_INTERFACE_MAP_ENTRY(mozilla::dom::EventTarget)
   if (aIID.Equals(NS_GET_IID(nsPIDOMWindowInner))) {
     foundInterface = static_cast<nsPIDOMWindowInner*>(this);
   } else
-  if (aIID.Equals(NS_GET_IID(mozIDOMWindow))) {
-    foundInterface = static_cast<mozIDOMWindow*>(this);
-  } else
   if (aIID.Equals(NS_GET_IID(nsIDOMChromeWindow)) && IsChromeWindow()) {
     foundInterface = static_cast<nsIDOMChromeWindow*>(this);
   } else
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
   NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
 NS_INTERFACE_MAP_END
 
 
--- a/dom/base/nsGlobalWindowInner.h
+++ b/dom/base/nsGlobalWindowInner.h
@@ -67,17 +67,16 @@ class nsIDOMOfflineResourceList;
 class nsIScrollableFrame;
 class nsIControllers;
 class nsIJSID;
 class nsIScriptContext;
 class nsIScriptTimeoutHandler;
 class nsITabChild;
 class nsITimeoutHandler;
 class nsIWebBrowserChrome;
-class mozIDOMWindowProxy;
 
 class nsDOMWindowList;
 class nsScreen;
 class nsHistory;
 class nsGlobalWindowObserver;
 class nsGlobalWindowOuter;
 class nsDOMWindowUtils;
 class nsIIdleService;
@@ -233,19 +232,16 @@ public:
 #endif
 
   static nsGlobalWindowInner* Cast(nsPIDOMWindowInner* aPIWin) {
     return static_cast<nsGlobalWindowInner*>(aPIWin);
   }
   static const nsGlobalWindowInner* Cast(const nsPIDOMWindowInner* aPIWin) {
     return static_cast<const nsGlobalWindowInner*>(aPIWin);
   }
-  static nsGlobalWindowInner* Cast(mozIDOMWindow* aWin) {
-    return Cast(nsPIDOMWindowInner::From(aWin));
-  }
 
   static nsGlobalWindowInner*
   GetInnerWindowWithId(uint64_t aInnerWindowID)
   {
     AssertIsOnMainThread();
 
     if (!sInnerWindowsById) {
       return nullptr;
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -1086,19 +1086,16 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_INTERFACE_MAP_ENTRY(nsIDOMWindow)
   NS_INTERFACE_MAP_ENTRY(nsIGlobalObject)
   NS_INTERFACE_MAP_ENTRY(nsIScriptGlobalObject)
   NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal)
   NS_INTERFACE_MAP_ENTRY(mozilla::dom::EventTarget)
   if (aIID.Equals(NS_GET_IID(nsPIDOMWindowOuter))) {
     foundInterface = static_cast<nsPIDOMWindowOuter*>(this);
   } else
-  if (aIID.Equals(NS_GET_IID(mozIDOMWindowProxy))) {
-    foundInterface = static_cast<mozIDOMWindowProxy*>(this);
-  } else
   if (aIID.Equals(NS_GET_IID(nsIDOMChromeWindow)) && IsChromeWindow()) {
     foundInterface = static_cast<nsIDOMChromeWindow*>(this);
   } else
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
   NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
 NS_INTERFACE_MAP_END
 
 
--- a/dom/base/nsGlobalWindowOuter.h
+++ b/dom/base/nsGlobalWindowOuter.h
@@ -65,17 +65,16 @@ class nsIDOMOfflineResourceList;
 class nsIScrollableFrame;
 class nsIControllers;
 class nsIJSID;
 class nsIScriptContext;
 class nsIScriptTimeoutHandler;
 class nsITabChild;
 class nsITimeoutHandler;
 class nsIWebBrowserChrome;
-class mozIDOMWindowProxy;
 
 class nsDOMWindowList;
 class nsScreen;
 class nsHistory;
 class nsGlobalWindowObserver;
 class nsGlobalWindowInner;
 class nsDOMWindowUtils;
 class nsIIdleService;
@@ -185,19 +184,16 @@ public:
 #endif
 
   static nsGlobalWindowOuter* Cast(nsPIDOMWindowOuter* aPIWin) {
     return static_cast<nsGlobalWindowOuter*>(aPIWin);
   }
   static const nsGlobalWindowOuter* Cast(const nsPIDOMWindowOuter* aPIWin) {
     return static_cast<const nsGlobalWindowOuter*>(aPIWin);
   }
-  static nsGlobalWindowOuter* Cast(mozIDOMWindowProxy* aWin) {
-    return Cast(nsPIDOMWindowOuter::From(aWin));
-  }
 
   static nsGlobalWindowOuter*
   GetOuterWindowWithId(uint64_t aWindowID)
   {
     AssertIsOnMainThread();
 
     if (!sOuterWindowsById) {
       return nullptr;
--- a/dom/base/nsPIDOMWindow.h
+++ b/dom/base/nsPIDOMWindow.h
@@ -3,17 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsPIDOMWindow_h__
 #define nsPIDOMWindow_h__
 
 #include "nsIDOMWindow.h"
-#include "mozIDOMWindow.h"
 
 #include "nsCOMPtr.h"
 #include "nsTArray.h"
 #include "mozilla/dom/EventTarget.h"
 #include "mozilla/TaskCategory.h"
 #include "js/TypeDecls.h"
 #include "nsRefPtrHashtable.h"
 
@@ -129,17 +128,17 @@ enum class LargeAllocStatus : uint8_t
 { 0x775dabc9, 0x8f43, 0x4277, \
   { 0x9a, 0xdb, 0xf1, 0x99, 0x0d, 0x77, 0xcf, 0xfb } }
 
 // Must be kept in sync with xpcom/rust/xpcom/src/interfaces/nonidl.rs
 #define NS_PIDOMWINDOWOUTER_IID \
   { 0x769693d4, 0xb009, 0x4fe2, \
   { 0xaf, 0x18, 0x7d, 0xc8, 0xdf, 0x74, 0x96, 0xdf } }
 
-class nsPIDOMWindowInner : public mozIDOMWindow
+class nsPIDOMWindowInner : public nsISupports
 {
 protected:
   friend nsGlobalWindowInner;
   friend nsGlobalWindowOuter;
 
   explicit nsPIDOMWindowInner(nsPIDOMWindowOuter* aOuterWindow);
 
   ~nsPIDOMWindowInner();
@@ -156,20 +155,16 @@ public:
 
   nsIGlobalObject* AsGlobal();
   const nsIGlobalObject* AsGlobal() const;
 
   nsPIDOMWindowOuter* GetOuterWindow() const {
     return mOuterWindow;
   }
 
-  static nsPIDOMWindowInner* From(mozIDOMWindow* aFrom) {
-    return static_cast<nsPIDOMWindowInner*>(aFrom);
-  }
-
   // Returns true if this object has an outer window and it is the current inner
   // window of that outer.
   inline bool IsCurrentInnerWindow() const;
 
   // Returns true if the document of this window is the active document.  This
   // is not identical to IsCurrentInnerWindow() because document.open() will
   // keep the same document active but create a new window.
   inline bool HasActiveDocument();
@@ -691,17 +686,17 @@ protected:
   uint32_t mNumOfIndexedDBDatabases;
 
   // The number of open WebSockets.
   uint32_t mNumOfOpenWebSockets;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsPIDOMWindowInner, NS_PIDOMWINDOWINNER_IID)
 
-class nsPIDOMWindowOuter : public mozIDOMWindowProxy
+class nsPIDOMWindowOuter : public nsISupports
 {
 protected:
   explicit nsPIDOMWindowOuter();
 
   ~nsPIDOMWindowOuter();
 
   void RefreshMediaElementsVolume();
   void RefreshMediaElementsSuspend(SuspendTypes aSuspend);
@@ -717,20 +712,16 @@ public:
   const nsPIDOMWindowOuter* AsOuter() const {
     return this;
   }
 
   nsPIDOMWindowOuter* GetOuterWindow() const {
     return const_cast<nsPIDOMWindowOuter*>(this);
   }
 
-  static nsPIDOMWindowOuter* From(mozIDOMWindowProxy* aFrom) {
-    return static_cast<nsPIDOMWindowOuter*>(aFrom);
-  }
-
   // Given an inner window, return its outer if the inner is the current inner.
   // Otherwise (argument null or not an inner or not current) return null.
   static nsPIDOMWindowOuter* GetFromCurrentInner(nsPIDOMWindowInner* aInner);
 
   // Check whether a document is currently loading
   inline bool IsLoading() const;
   inline bool IsHandlingResizeEvent() const;