Bug 1479544. Remove nsIXULChromeRegistry::ReloadChrome. r=mossop
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 03 Aug 2018 15:14:43 +0000
changeset 430022 3c690914f782526816c8b66731cf2ccdcb93d3b9
parent 430021 69bd5eb50a32db40cf7637158a7b1d4dda8bb58e
child 430023 127bff24bfc8fa5d0e619ea727ab4a0c522c4497
push id106044
push userbzbarsky@mozilla.com
push dateFri, 03 Aug 2018 16:35:15 +0000
treeherdermozilla-inbound@3c690914f782 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1479544
milestone63.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 1479544. Remove nsIXULChromeRegistry::ReloadChrome. r=mossop Differential Revision: https://phabricator.services.mozilla.com/D2699
chrome/nsChromeRegistry.cpp
chrome/nsChromeRegistry.h
chrome/nsIChromeRegistry.idl
dom/base/nsGlobalWindowOuter.cpp
--- 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
@@ -6430,16 +6430,17 @@ nsGlobalWindowOuter::GetPrivateRoot()
         top = parent->GetTop();
       }
     }
   }
 
   return top;
 }
 
+// This has a caller in Windows-only code (nsNativeAppSupportWin).
 Location*
 nsGlobalWindowOuter::GetLocation()
 {
   // This method can be called on the outer window as well.
   FORWARD_TO_INNER(GetLocation, (), nullptr);
 }
 
 void