Bug 1479544. Remove nsIXULChromeRegistry::ReloadChrome. r=mossop
☠☠ backed out by 6fceaaf81c7e ☠ ☠
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 03 Aug 2018 15:14:43 +0000
changeset 826531 85fd8d212397597441ffa7ad13e0c910f8fb856c
parent 826530 5240a6344b28a1d9d8b9df08c17b63bb54926122
child 826532 786d4f45669071091ab246f12265b3ab87aab6ff
push id118355
push userwisniewskit@gmail.com
push dateSat, 04 Aug 2018 00:24:59 +0000
reviewersmossop
bugs1479544
milestone63.0a1
Bug 1479544. Remove nsIXULChromeRegistry::ReloadChrome. r=mossop This was the only consumer of GetLocation() on outer windows. Differential Revision: https://phabricator.services.mozilla.com/D2699
chrome/nsChromeRegistry.cpp
chrome/nsChromeRegistry.h
chrome/nsIChromeRegistry.idl
dom/base/nsGlobalWindowOuter.cpp
dom/base/nsGlobalWindowOuter.h
dom/base/nsPIDOMWindow.h
--- a/chrome/nsChromeRegistry.cpp
+++ b/chrome/nsChromeRegistry.cpp
@@ -467,57 +467,16 @@ nsChromeRegistry::FlushAllCaches()
   nsCOMPtr<nsIObserverService> obsSvc =
     mozilla::services::GetObserverService();
   NS_ASSERTION(obsSvc, "Couldn't get observer service.");
 
   obsSvc->NotifyObservers((nsIChromeRegistry*) this,
                           NS_CHROME_FLUSH_TOPIC, nullptr);
 }
 
-// xxxbsmedberg Move me to nsIWindowMediator
-NS_IMETHODIMP
-nsChromeRegistry::ReloadChrome()
-{
-  FlushAllCaches();
-  // Do a reload of all top level windows.
-  nsresult rv = NS_OK;
-
-  // Get the window mediator
-  nsCOMPtr<nsIWindowMediator> windowMediator
-    (do_GetService(NS_WINDOWMEDIATOR_CONTRACTID));
-  if (windowMediator) {
-    nsCOMPtr<nsISimpleEnumerator> windowEnumerator;
-
-    rv = windowMediator->GetEnumerator(nullptr, getter_AddRefs(windowEnumerator));
-    if (NS_SUCCEEDED(rv)) {
-      // Get each dom window
-      bool more;
-      rv = windowEnumerator->HasMoreElements(&more);
-      if (NS_FAILED(rv)) return rv;
-      while (more) {
-        nsCOMPtr<nsISupports> protoWindow;
-        rv = windowEnumerator->GetNext(getter_AddRefs(protoWindow));
-        if (NS_SUCCEEDED(rv)) {
-          nsCOMPtr<nsPIDOMWindowOuter> domWindow = do_QueryInterface(protoWindow);
-          if (domWindow) {
-            Location* location = domWindow->GetLocation();
-            if (location) {
-              rv = location->Reload(false);
-              if (NS_FAILED(rv)) return rv;
-            }
-          }
-        }
-        rv = windowEnumerator->HasMoreElements(&more);
-        if (NS_FAILED(rv)) return rv;
-      }
-    }
-  }
-  return rv;
-}
-
 NS_IMETHODIMP
 nsChromeRegistry::AllowScriptsForPackage(nsIURI* aChromeURI, bool *aResult)
 {
   nsresult rv;
   *aResult = false;
 
 #ifdef DEBUG
   bool isChrome;
--- a/chrome/nsChromeRegistry.h
+++ b/chrome/nsChromeRegistry.h
@@ -34,17 +34,16 @@ class nsIURL;
 class nsChromeRegistry : public nsIToolkitChromeRegistry,
                          public nsIObserver,
                          public nsSupportsWeakReference
 {
 public:
   NS_DECL_ISUPPORTS
 
   // nsIXULChromeRegistry methods:
-  NS_IMETHOD ReloadChrome() override;
   NS_IMETHOD RefreshSkins() override;
   NS_IMETHOD AllowScriptsForPackage(nsIURI* url,
                                     bool* _retval) override;
   NS_IMETHOD AllowContentToAccess(nsIURI* url,
                                   bool* _retval) override;
   NS_IMETHOD CanLoadURLRemotely(nsIURI* url,
                                 bool* _retval) override;
   NS_IMETHOD MustLoadURLRemotely(nsIURI* url,
--- a/chrome/nsIChromeRegistry.idl
+++ b/chrome/nsIChromeRegistry.idl
@@ -43,19 +43,16 @@ interface nsIChromeRegistry : nsISupport
    * returns whether XPCNativeWrappers are enabled for aURI.
    */
   [notxpcom] boolean wrappersEnabled(in nsIURI aURI);
 };
 
 [scriptable, uuid(93251ddf-5e85-4172-ac2a-31780562974f)]
 interface nsIXULChromeRegistry : nsIChromeRegistry
 {
-  /* Should be called when locales change to reload all chrome (including XUL). */
-  void reloadChrome();
-
   // If the optional asBCP47 parameter is true, the locale code will be
   // converted to a BCP47 language tag; in particular, this means that
   // "ja-JP-mac" will be returned as "ja-JP-x-lvariant-mac", which can be
   // passed to ECMA402 Intl API methods without throwing a RangeError.
   ACString getSelectedLocale(in ACString packageName,
                              [optional] in boolean asBCP47);
   
   // Get whether the default writing direction of the locale is RTL
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -6425,23 +6425,16 @@ nsGlobalWindowOuter::GetPrivateRoot()
         top = parent->GetTop();
       }
     }
   }
 
   return top;
 }
 
-Location*
-nsGlobalWindowOuter::GetLocation()
-{
-  // This method can be called on the outer window as well.
-  FORWARD_TO_INNER(GetLocation, (), nullptr);
-}
-
 void
 nsGlobalWindowOuter::ActivateOrDeactivate(bool aActivate)
 {
   if (!mDoc) {
     return;
   }
 
   // Set / unset mIsActive on the top level window, which is used for the
--- a/dom/base/nsGlobalWindowOuter.h
+++ b/dom/base/nsGlobalWindowOuter.h
@@ -556,17 +556,16 @@ public:
   }
 
   nsIDocument* GetDocument()
   {
     return GetDoc();
   }
   void GetNameOuter(nsAString& aName);
   void SetNameOuter(const nsAString& aName, mozilla::ErrorResult& aError);
-  mozilla::dom::Location* GetLocation() override;
   void GetStatusOuter(nsAString& aStatus);
   void SetStatusOuter(const nsAString& aStatus);
   void CloseOuter(bool aTrustedCaller);
   nsresult Close() override;
   bool GetClosedOuter();
   bool Closed() override;
   void StopOuter(mozilla::ErrorResult& aError);
   void FocusOuter(mozilla::ErrorResult& aError);
--- a/dom/base/nsPIDOMWindow.h
+++ b/dom/base/nsPIDOMWindow.h
@@ -1093,17 +1093,16 @@ public:
   uint32_t GetMarkedCCGeneration()
   {
     return mMarkedCCGeneration;
   }
 
   // XXX(nika): These feel like they should be inner window only, but they're
   // called on the outer window.
   virtual mozilla::dom::Navigator* GetNavigator() = 0;
-  virtual mozilla::dom::Location* GetLocation() = 0;
 
   virtual nsresult GetPrompter(nsIPrompt** aPrompt) = 0;
   virtual nsresult GetControllers(nsIControllers** aControllers) = 0;
   virtual already_AddRefed<mozilla::dom::Selection> GetSelection() = 0;
   virtual already_AddRefed<nsPIDOMWindowOuter> GetOpener() = 0;
 
   virtual nsDOMWindowList* GetFrames() = 0;