From e04595bab680eb5032522fb6e38bafc2e7ba6279 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 24 Jul 2019 15:44:34 +0000 Subject: [PATCH] Bug 1568510. Pass an nsIInterfaceRequestor, not nsISupports, as context to helper app dialog methods. r=mossop Differential Revision: https://phabricator.services.mozilla.com/D39181 --HG-- extra : moz-landing-system : lando --- toolkit/mozapps/downloads/HelperAppDlg.jsm | 11 +++-------- uriloader/exthandler/nsIHelperAppLauncherDialog.idl | 5 +++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/toolkit/mozapps/downloads/HelperAppDlg.jsm b/toolkit/mozapps/downloads/HelperAppDlg.jsm index 6b385170200d..0232f4937ba0 100644 --- a/toolkit/mozapps/downloads/HelperAppDlg.jsm +++ b/toolkit/mozapps/downloads/HelperAppDlg.jsm @@ -150,9 +150,7 @@ nsUnknownContentTypeDialog.prototype = { // Cache some information in case this context goes away: try { - let parent = aContext - .QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindow); + let parent = aContext.getInterface(Ci.nsIDOMWindow); this._mDownloadDir = new downloadModule.DownloadLastDir(parent); } catch (ex) { Cu.reportError( @@ -172,8 +170,7 @@ nsUnknownContentTypeDialog.prototype = { // activate the OK button. So we wait a bit before doing opening it. reallyShow() { try { - let ir = this.mContext.QueryInterface(Ci.nsIInterfaceRequestor); - let docShell = ir.getInterface(Ci.nsIDocShell); + let docShell = this.mContext.getInterface(Ci.nsIDocShell); let rootWin = docShell.rootTreeItem.domWindow; this.mDialog = Services.ww.openWindow( rootWin, @@ -235,9 +232,7 @@ nsUnknownContentTypeDialog.prototype = { let parent; let gDownloadLastDir; try { - parent = aContext - .QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindow); + parent = aContext.getInterface(Ci.nsIDOMWindow); } catch (ex) {} if (parent) { diff --git a/uriloader/exthandler/nsIHelperAppLauncherDialog.idl b/uriloader/exthandler/nsIHelperAppLauncherDialog.idl index f8190e744bdf..9a7f76b7da0c 100644 --- a/uriloader/exthandler/nsIHelperAppLauncherDialog.idl +++ b/uriloader/exthandler/nsIHelperAppLauncherDialog.idl @@ -7,6 +7,7 @@ interface nsIHelperAppLauncher; interface nsIFile; +interface nsIInterfaceRequestor; /** * This interface is used to display a confirmation dialog before @@ -54,7 +55,7 @@ interface nsIHelperAppLauncherDialog : nsISupports { * REASON_CANTHANDLE. */ void show(in nsIHelperAppLauncher aLauncher, - in nsISupports aWindowContext, + in nsIInterfaceRequestor aWindowContext, in unsigned long aReason); /** @@ -77,7 +78,7 @@ interface nsIHelperAppLauncherDialog : nsISupports { * prompted. */ void promptForSaveToFileAsync(in nsIHelperAppLauncher aLauncher, - in nsISupports aWindowContext, + in nsIInterfaceRequestor aWindowContext, in wstring aDefaultFileName, in wstring aSuggestedFileExtension, in boolean aForcePrompt);