Bug 1444143 part 10. Remove unnecessary QIs to Ci.nsIFrameLoader in JS. r=mystor
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 21 Mar 2018 22:43:17 -0400
changeset 409424 e7387120e7a155e4a0c1c52e6f3bae7f1ae73ab9
parent 409423 d5a965739c17d562d1ea79b967f329a59bc98938
child 409425 f550087a772e43bfb889dee29081eeae37756097
push id33687
push userapavel@mozilla.com
push dateThu, 22 Mar 2018 09:31:48 +0000
treeherdermozilla-central@7771df14ea18 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmystor
bugs1444143
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 1444143 part 10. Remove unnecessary QIs to Ci.nsIFrameLoader in JS. r=mystor nsFrameLoader is on WebIDL bindings, so those QIs are no-ops anyway, unless the given object is no a frameloader to start with. MozReview-Commit-ID: IPiW70H5NPc
accessible/jsat/AccessFu.jsm
browser/components/sessionstore/SessionStore.jsm
browser/modules/ContentCrashHandlers.jsm
browser/modules/webrtcUI.jsm
dom/browser-element/BrowserElementParent.js
testing/specialpowers/content/specialpowers.js
toolkit/components/extensions/ExtensionParent.jsm
toolkit/components/extensions/ext-tabs-base.js
--- a/accessible/jsat/AccessFu.jsm
+++ b/accessible/jsat/AccessFu.jsm
@@ -336,17 +336,17 @@ var AccessFu = {
   },
 
   observe: function observe(aSubject, aTopic, aData) {
     switch (aTopic) {
       case "remote-browser-shown":
       case "inprocess-browser-shown":
       {
         // Ignore notifications that aren't from a Browser
-        let frameLoader = aSubject.QueryInterface(Ci.nsIFrameLoader);
+        let frameLoader = aSubject;
         if (!frameLoader.ownerIsMozBrowserFrame) {
           return;
         }
         this._handleMessageManager(frameLoader.messageManager);
         break;
       }
     }
   },
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -446,17 +446,17 @@ var SessionStoreInternal = {
   // For each <browser> element, records the current epoch.
   _browserEpochs: new WeakMap(),
 
   // Any browsers that fires the oop-browser-crashed event gets stored in
   // here - that way we know which browsers to ignore messages from (until
   // they get restored).
   _crashedBrowsers: new WeakSet(),
 
-  // A map (xul:browser -> nsIFrameLoader) that maps a browser to the last
+  // A map (xul:browser -> FrameLoader) that maps a browser to the last
   // associated frameLoader we heard about.
   _lastKnownFrameLoader: new WeakMap(),
 
   // A map (xul:browser -> object) that maps a browser associated with a
   // recently closed tab to all its necessary state information we need to
   // properly handle final update message.
   _closedTabs: new WeakMap(),
 
--- a/browser/modules/ContentCrashHandlers.jsm
+++ b/browser/modules/ContentCrashHandlers.jsm
@@ -155,18 +155,16 @@ var TabCrashHandler = {
           dump("A content process crashed and MOZ_CRASHREPORTER_SHUTDOWN is " +
                "set, shutting down\n");
           Services.startup.quit(Ci.nsIAppStartup.eForceQuit);
         }
 
         break;
       }
       case "oop-frameloader-crashed": {
-        aSubject.QueryInterface(Ci.nsIFrameLoader);
-
         let browser = aSubject.ownerElement;
         if (!browser) {
           return;
         }
 
         this.browserMap.set(browser, aSubject.childID);
         break;
       }
--- a/browser/modules/webrtcUI.jsm
+++ b/browser/modules/webrtcUI.jsm
@@ -257,17 +257,16 @@ var webrtcUI = {
       case "webrtc:UpdatingIndicators":
         webrtcUI.forgetStreamsFromProcess(aMessage.target);
         break;
       case "webrtc:UpdateGlobalIndicators":
         updateIndicators(aMessage.data, aMessage.target);
         break;
       case "webrtc:UpdateBrowserIndicators":
         let id = aMessage.data.windowId;
-        aMessage.targetFrameLoader.QueryInterface(Ci.nsIFrameLoader);
         let processMM =
           aMessage.targetFrameLoader.messageManager.processMessageManager;
         let index;
         for (index = 0; index < webrtcUI._streams.length; ++index) {
           let stream = webrtcUI._streams[index];
           if (stream.state.windowId == id && stream.processMM == processMM)
             break;
         }
--- a/dom/browser-element/BrowserElementParent.js
+++ b/dom/browser-element/BrowserElementParent.js
@@ -76,17 +76,17 @@ BrowserElementParent.prototype = {
   contractID: "@mozilla.org/dom/browser-element-api;1",
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIBrowserElementAPI,
                                          Ci.nsIObserver,
                                          Ci.nsISupportsWeakReference]),
 
   setFrameLoader: function(frameLoader) {
     debug("Setting frameLoader");
     this._frameLoader = frameLoader;
-    this._frameElement = frameLoader.QueryInterface(Ci.nsIFrameLoader).ownerElement;
+    this._frameElement = frameLoader.ownerElement;
     if (!this._frameElement) {
       debug("No frame element?");
       return;
     }
     // Listen to visibilitychange on the iframe's owner window, and forward
     // changes down to the child.  We want to do this while registering as few
     // visibilitychange listeners on _window as possible, because such a listener
     // may live longer than this BrowserElementParent object.
--- a/testing/specialpowers/content/specialpowers.js
+++ b/testing/specialpowers/content/specialpowers.js
@@ -192,17 +192,16 @@ SpecialPowers.prototype.executeAfterFlus
   sendAsyncMessage("SPPingService", { op: "ping" });
 };
 
 SpecialPowers.prototype.nestedFrameSetup = function() {
   let self = this;
   Services.obs.addObserver(function onRemoteBrowserShown(subject, topic, data) {
     let frameLoader = subject;
     // get a ref to the app <iframe>
-    frameLoader.QueryInterface(Ci.nsIFrameLoader);
     let frame = frameLoader.ownerElement;
     let frameId = frame.getAttribute("id");
     if (frameId === "nested-parent-frame") {
       Services.obs.removeObserver(onRemoteBrowserShown, "remote-browser-shown");
 
       let mm = frame.frameLoader.messageManager;
       self._grandChildFrameMM = mm;
 
--- a/toolkit/components/extensions/ExtensionParent.jsm
+++ b/toolkit/components/extensions/ExtensionParent.jsm
@@ -990,17 +990,17 @@ class HiddenXULWindow {
   }
 
   /**
    * Creates the browser XUL element that will contain the WebExtension Page.
    *
    * @param {Object} xulAttributes
    *        An object that contains the xul attributes to set of the newly
    *        created browser XUL element.
-   * @param {nsIFrameLoader} [groupFrameLoader]
+   * @param {FrameLoader} [groupFrameLoader]
    *        The frame loader to load this browser into the same process
    *        and tab group as.
    *
    * @returns {Promise<XULElement>}
    *          A Promise which resolves to the newly created browser XUL element.
    */
   async createBrowserElement(xulAttributes, groupFrameLoader = null) {
     if (!xulAttributes || Object.keys(xulAttributes).length === 0) {
--- a/toolkit/components/extensions/ext-tabs-base.js
+++ b/toolkit/components/extensions/ext-tabs-base.js
@@ -285,17 +285,17 @@ class TabBase {
    *        @readonly
    *        @abstract
    */
   get browser() {
     throw new Error("Not implemented");
   }
 
   /**
-   * @property {nsIFrameLoader} browser
+   * @property {FrameLoader} frameLoader
    *        Returns the frameloader for the given tab.
    *        @readonly
    */
   get frameLoader() {
     return this.browser.frameLoader;
   }
 
   /**