Bug 980530 - [e10s] remote-browser.xml shouldn't send IPC messages in constructor (r=felipe)

This commit is contained in:
Bill McCloskey 2014-03-11 20:13:52 -07:00
Родитель 96f886f1cf
Коммит e4ba24146f
2 изменённых файлов: 16 добавлений и 14 удалений

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

@ -282,10 +282,6 @@ addEventListener("TextZoomChange", function (aEvent) {
RemoteAddonsChild.init(this);
addMessageListener("History:UseGlobalHistory", function (aMessage) {
docShell.useGlobalHistory = aMessage.data.enabled;
});
addMessageListener("NetworkPrioritizer:AdjustPriority", (msg) => {
let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
let loadGroup = webNav.QueryInterface(Ci.nsIDocumentLoader)
@ -352,6 +348,8 @@ let AutoCompletePopup = {
}
}
addMessageListener("FormAutoComplete:InitPopup", function (aMessage) {
let [initData] = sendSyncMessage("Browser:Init");
docShell.useGlobalHistory = initData.useGlobalHistory;
if (initData.initPopup) {
setTimeout(function() AutoCompletePopup.init(), 0);
});
}

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

@ -181,10 +181,16 @@
<constructor>
<![CDATA[
/*
* Don't try to send messages from this function. The message manager for
* the <browser> element may not be initialized yet.
*/
let jsm = "resource://gre/modules/RemoteWebNavigation.jsm";
let RemoteWebNavigation = Cu.import(jsm, {}).RemoteWebNavigation;
this._remoteWebNavigation = new RemoteWebNavigation(this);
this.messageManager.addMessageListener("Browser:Init", this);
this.messageManager.addMessageListener("DOMTitleChanged", this);
this.messageManager.addMessageListener("ImageDocumentLoaded", this);
this.messageManager.addMessageListener("SetSyncHandler", this);
@ -207,14 +213,6 @@
jsm = "resource://gre/modules/RemoteAddonsParent.jsm";
let RemoteAddonsParent = Components.utils.import(jsm, {}).RemoteAddonsParent;
RemoteAddonsParent.init();
if (!this.hasAttribute("disableglobalhistory")) {
this.messageManager.sendAsyncMessage("History:UseGlobalHistory", {enabled:true});
}
if (this.autoCompletePopup) {
this.messageManager.sendAsyncMessage("FormAutoComplete:InitPopup");
}
]]>
</constructor>
@ -223,6 +221,12 @@
<body><![CDATA[
let data = aMessage.data;
switch (aMessage.name) {
case "Browser:Init":
let result = {};
result.useGlobalHistory = !this.hasAttribute("disableglobalhistory");
result.initPopup = this.autoCompletePopup;
return result;
break;
case "DOMTitleChanged":
this._contentTitle = data.title;
break;