Bug 1445792 - Merge nsIWindowMediator_44 back into nsIWindowMediator. r=dbaron
authorCatalin Badea <catalin.badea392@gmail.com>
Tue, 20 Mar 2018 05:27:00 -0400
changeset 408980 5ec221865d3559c1e277ca1e8e422c389c74fb32
parent 408979 964191c031db7c9b50b6a4f5dad9da1eb63acb49
child 408981 9c7cd4a36f061042e00296edfc922a8691aa0600
push id33667
push userebalazs@mozilla.com
push dateTue, 20 Mar 2018 16:50:19 +0000
treeherdermozilla-central@3d4f4a6bb6ba [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1445792
milestone61.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 1445792 - Merge nsIWindowMediator_44 back into nsIWindowMediator. r=dbaron
dom/base/nsContentUtils.cpp
xpfe/appshell/nsIWindowMediator.idl
xpfe/appshell/nsWindowMediator.cpp
xpfe/appshell/nsWindowMediator.h
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -5795,19 +5795,17 @@ nsContentUtils::GetWindowProviderForCont
   MOZ_ASSERT(XRE_IsContentProcess());
   return ContentChild::GetSingleton();
 }
 
 /* static */
 already_AddRefed<nsPIDOMWindowOuter>
 nsContentUtils::GetMostRecentNonPBWindow()
 {
-  nsCOMPtr<nsIWindowMediator> windowMediator =
-    do_GetService(NS_WINDOWMEDIATOR_CONTRACTID);
-  nsCOMPtr<nsIWindowMediator_44> wm = do_QueryInterface(windowMediator);
+  nsCOMPtr<nsIWindowMediator> wm = do_GetService(NS_WINDOWMEDIATOR_CONTRACTID);
 
   nsCOMPtr<mozIDOMWindowProxy> window;
   wm->GetMostRecentNonPBWindow(u"navigator:browser",
                                getter_AddRefs(window));
   nsCOMPtr<nsPIDOMWindowOuter> pwindow;
   pwindow = do_QueryInterface(window);
 
   return pwindow.forget();
--- a/xpfe/appshell/nsIWindowMediator.idl
+++ b/xpfe/appshell/nsIWindowMediator.idl
@@ -68,16 +68,22 @@ interface nsIWindowMediator: nsISupports
     *                     ("type" is the |windowtype| attribute of
     *                     the XML <window> element.)
     *                     If null, return the topmost window of any type.
     * @return the topmost window
     */
   mozIDOMWindowProxy getMostRecentWindow(in wstring aWindowType);
 
   /**
+   * Same as getMostRecentWindow, but ignores private browsing
+   * windows.
+   */
+  mozIDOMWindowProxy getMostRecentNonPBWindow(in wstring aWindowType);
+
+  /**
    * Return the outer window with the given ID, if any.  Can return null.
    */
   mozIDOMWindowProxy getOuterWindowWithId(in unsigned long long aOuterWindowID);
 
   /**
     * Return the inner window with the given current window ID, if any.
     * Can return null if no inner window with the ID exists or if it's not
     * a current inner anymore.
@@ -179,20 +185,8 @@ interface nsIWindowMediator: nsISupports
     */
   void addListener(in nsIWindowMediatorListener aListener);
 
   /** Unregister a listener of window status changes.
     * @param aListener the listener to unregister
     */
   void removeListener(in nsIWindowMediatorListener aListener);
 };
-
-// XXXcatalinb: This should be merged to nsIWindowMediator. Using this
-// to avoid UUID change in aurora.
-[scriptable, uuid(b9ed4063-39a2-4302-8e5c-7287eef021fe)]
-interface nsIWindowMediator_44 : nsIWindowMediator
-{
-  /**
-   * Same as getMostRecentWindow, but ignores private browsing
-   * windows.
-   */
-  mozIDOMWindowProxy getMostRecentNonPBWindow(in wstring aWindowType);
-};
--- a/xpfe/appshell/nsWindowMediator.cpp
+++ b/xpfe/appshell/nsWindowMediator.cpp
@@ -752,17 +752,16 @@ nsWindowMediator::SortZOrderBackToFront(
       scan = scan->mHigher;
     }
   } while (!finished);
 
   mSortingZOrder = false;
 }
 
 NS_IMPL_ISUPPORTS(nsWindowMediator,
-  nsIWindowMediator_44,
   nsIWindowMediator,
   nsIObserver,
   nsISupportsWeakReference)
 
 NS_IMETHODIMP
 nsWindowMediator::AddListener(nsIWindowMediatorListener* aListener)
 {
   NS_ENSURE_ARG_POINTER(aListener);
--- a/xpfe/appshell/nsWindowMediator.h
+++ b/xpfe/appshell/nsWindowMediator.h
@@ -20,17 +20,17 @@ class nsASDOMWindowEarlyToLateEnumerator
 class nsASDOMWindowFrontToBackEnumerator;
 class nsASXULWindowFrontToBackEnumerator;
 class nsASDOMWindowBackToFrontEnumerator;
 class nsASXULWindowBackToFrontEnumerator;
 class nsIWindowMediatorListener;
 struct nsWindowInfo;
 
 class nsWindowMediator :
-  public nsIWindowMediator_44,
+  public nsIWindowMediator,
   public nsIObserver,
   public nsSupportsWeakReference
 {
 friend class nsAppShellWindowEnumerator;
 friend class nsASXULWindowEarlyToLateEnumerator;
 friend class nsASDOMWindowEarlyToLateEnumerator;
 friend class nsASDOMWindowFrontToBackEnumerator;
 friend class nsASXULWindowFrontToBackEnumerator;
@@ -42,17 +42,16 @@ protected:
 
 public:
   nsWindowMediator();
 
   nsresult Init();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIWINDOWMEDIATOR
-  NS_DECL_NSIWINDOWMEDIATOR_44
   NS_DECL_NSIOBSERVER
 
   static nsresult GetDOMWindow(nsIXULWindow* inWindow,
                                nsCOMPtr<nsPIDOMWindowOuter>& outDOMWindow);
 
 private:
   int32_t AddEnumerator(nsAppShellWindowEnumerator* inEnumerator);
   int32_t RemoveEnumerator(nsAppShellWindowEnumerator* inEnumerator);