Bug 1522546 - Make remoteType property on browsers forward to the message manager if applicable. r=bgrins

Differential Revision: https://phabricator.services.mozilla.com/D18224

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Conley 2019-01-31 20:31:45 +00:00
Родитель 1b6897dcc1
Коммит 89bfe39629
1 изменённых файлов: 13 добавлений и 7 удалений

Просмотреть файл

@ -450,21 +450,27 @@ class MozBrowser extends MozElementMixin(XULFrameElement) {
}
get remoteType() {
if (!this.isRemoteBrowser) {
if (!this.isRemoteBrowser || !this.messageManager) {
return null;
}
let remoteType = this.getAttribute("remoteType");
if (remoteType) {
return remoteType;
return this.messageManager.remoteType;
}
get isCrashed() {
if (!this.isRemoteBrowser || !this.frameLoader) {
return false;
}
let E10SUtils = ChromeUtils.import("resource://gre/modules/E10SUtils.jsm", {}).E10SUtils;
return E10SUtils.DEFAULT_REMOTE_TYPE;
return !this.frameLoader.tabParent;
}
get messageManager() {
if (this.frameLoader) {
// Bug 1524084 - Trying to get at the message manager while in the crashed state will
// create a new message manager that won't shut down properly when the crashed browser
// is removed from the DOM. We work around that right now by returning null if we're
// in the crashed state.
if (this.frameLoader && !this.isCrashed) {
return this.frameLoader.messageManager;
}
return null;