Bug 1476142 part 3. Remove some unnecessary QIs in mobile. r=snorp
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 02 Aug 2018 15:26:48 -0400
changeset 826124 95a8a26a5a8600413f2390d476ec3fa13634c79b
parent 826123 9b9e736a24d33d8782535a0c913e5aa4ef78f6f5
child 826125 b5b69cf20e9625bcdb85f02409f84aabffda41a6
push id118244
push usernnethercote@mozilla.com
push dateFri, 03 Aug 2018 00:00:34 +0000
reviewerssnorp
bugs1476142
milestone63.0a1
Bug 1476142 part 3. Remove some unnecessary QIs in mobile. r=snorp
mobile/android/chrome/content/PrintHelper.js
mobile/android/chrome/content/browser.js
mobile/android/modules/geckoview/GeckoViewNavigation.jsm
--- a/mobile/android/chrome/content/PrintHelper.js
+++ b/mobile/android/chrome/content/PrintHelper.js
@@ -32,17 +32,17 @@ var PrintHelper = {
     printSettings.showPrintProgress = false;
     printSettings.printBGImages = false;
     printSettings.printBGColors = false;
     printSettings.printToFile = true;
     printSettings.toFileName = file.path;
     printSettings.printFrameType = Ci.nsIPrintSettings.kFramesAsIs;
     printSettings.outputFormat = Ci.nsIPrintSettings.kOutputFormatPDF;
 
-    let webBrowserPrint = aBrowser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebBrowserPrint);
+    let webBrowserPrint = aBrowser.contentWindow.getInterface(Ci.nsIWebBrowserPrint);
 
     return new Promise((resolve, reject) => {
       webBrowserPrint.print(printSettings, {
         onStateChange: function(webProgress, request, stateFlags, status) {
           // We get two STATE_START calls, one for STATE_IS_DOCUMENT and one for STATE_IS_NETWORK
           if (stateFlags & Ci.nsIWebProgressListener.STATE_START && stateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK) {
             // Let the user know something is happening. Generating the PDF can take some time.
             Snackbars.show(Strings.browser.GetStringFromName("alertPrintjobToast"), Snackbars.LENGTH_LONG);
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -345,17 +345,17 @@ var BrowserApp = {
   },
 
   // Note that the deck list order does not necessarily reflect the user visible tab order (see
   // bug 1331154 for the reason), so deck.selectedIndex should not be used (though
   // deck.selectedPanel is still valid) - use selectedTabIndex instead.
   deck: null,
 
   startup: function startup() {
-    window.QueryInterface(Ci.nsIDOMChromeWindow).browserDOMWindow = new nsBrowserAccess();
+    window.browserDOMWindow = new nsBrowserAccess();
     Services.obs.notifyObservers(this.browser, "BrowserChrome:Ready");
 
     this.deck = document.getElementById("browsers");
 
     BrowserEventHandler.init();
 
     Services.androidBridge.browserApp = this;
 
--- a/mobile/android/modules/geckoview/GeckoViewNavigation.jsm
+++ b/mobile/android/modules/geckoview/GeckoViewNavigation.jsm
@@ -17,17 +17,17 @@ XPCOMUtils.defineLazyModuleGetters(this,
 // Handles navigation requests between Gecko and a GeckoView.
 // Handles GeckoView:GoBack and :GoForward requests dispatched by
 // GeckoView.goBack and .goForward.
 // Dispatches GeckoView:LocationChange to the GeckoView on location change when
 // active.
 // Implements nsIBrowserDOMWindow.
 class GeckoViewNavigation extends GeckoViewModule {
   onInitBrowser() {
-    this.window.QueryInterface(Ci.nsIDOMChromeWindow).browserDOMWindow = this;
+    this.window.browserDOMWindow = this;
 
     // There may be a GeckoViewNavigation module in another window waiting for
     // us to create a browser so it can call presetOpenerWindow(), so allow them
     // to do that now.
     Services.obs.notifyObservers(this.window, "geckoview-window-created");
   }
 
   onInit() {