From fd55cf96950863721bbabf27bfadc6550f9f2245 Mon Sep 17 00:00:00 2001 From: Eugen Sawin Date: Thu, 24 Aug 2017 15:48:00 +0200 Subject: [PATCH] Bug 1394520 - [2.1] Add support for external URI loading with e10s in GeckoView. r=snorp --- .../modules/geckoview/GeckoViewNavigation.jsm | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/mobile/android/modules/geckoview/GeckoViewNavigation.jsm b/mobile/android/modules/geckoview/GeckoViewNavigation.jsm index d4c99721bd02..dda986069a93 100644 --- a/mobile/android/modules/geckoview/GeckoViewNavigation.jsm +++ b/mobile/android/modules/geckoview/GeckoViewNavigation.jsm @@ -129,35 +129,45 @@ class GeckoViewNavigation extends GeckoViewModule { throw Cr.NS_ERROR_ABORT; } - // nsIBrowserDOMWindow::openURI implementation. - openURI(aUri, aOpener, aWhere, aFlags, aTriggeringPrincipal) { - return this.createContentWindow(aUri, aOpener, aWhere, aFlags, - aTriggeringPrincipal); - } - - // nsIBrowserDOMWindow::openURIInFrame implementation. - openURIInFrame(aUri, aParams, aWhere, aFlags, aNextTabParentId, aName) { - debug("openURIInFrame: aUri=" + (aUri && aUri.spec) + + // nsIBrowserDOMWindow. + createContentWindowInFrame(aUri, aParams, aWhere, aFlags, aNextTabParentId, + aName) { + debug("createContentWindowInFrame: aUri=" + (aUri && aUri.spec) + " aParams=" + aParams + " aWhere=" + aWhere + " aFlags=" + aFlags + " aNextTabParentId=" + aNextTabParentId + " aName=" + aName); - if (aWhere === Ci.nsIBrowserDOMWindow.OPEN_DEFAULTWINDOW || - aWhere === Ci.nsIBrowserDOMWindow.OPEN_CURRENTWINDOW) { + let handled = this.handleLoadUri(aUri, null, aWhere, aFlags, null); + if (!handled && + (aWhere === Ci.nsIBrowserDOMWindow.OPEN_DEFAULTWINDOW || + aWhere === Ci.nsIBrowserDOMWindow.OPEN_CURRENTWINDOW)) { return this.browser; } throw Cr.NS_ERROR_ABORT; } + // nsIBrowserDOMWindow. + openURI(aUri, aOpener, aWhere, aFlags, aTriggeringPrincipal) { + return this.createContentWindow(aUri, aOpener, aWhere, aFlags, + aTriggeringPrincipal); + } + + // nsIBrowserDOMWindow. + openURIInFrame(aUri, aParams, aWhere, aFlags, aNextTabParentId, aName) { + return this.createContentWindowInFrame(aUri, aParams, aWhere, aFlags, + aNextTabParentId, aName); + } + + // nsIBrowserDOMWindow. isTabContentWindow(aWindow) { debug("isTabContentWindow " + this.browser.contentWindow === aWindow); return this.browser.contentWindow === aWindow; } - // nsIBrowserDOMWindow::canClose implementation. + // nsIBrowserDOMWindow. canClose() { debug("canClose"); return false;