Backed out changeset 77f53f9d3099 (bug 935784) on suspicion of causing shutdown hangs on OS X

This commit is contained in:
Ed Morley 2013-11-20 12:34:04 +00:00
parent 7de91970da
commit db7e2dea98
3 changed files with 6 additions and 34 deletions

View File

@ -10,22 +10,6 @@ Cu.import("resource://gre/modules/Services.jsm");
Cu.import('resource://gre/modules/XPCOMUtils.jsm'); Cu.import('resource://gre/modules/XPCOMUtils.jsm');
Cu.import("resource://gre/modules/RemoteAddonsChild.jsm"); Cu.import("resource://gre/modules/RemoteAddonsChild.jsm");
let SyncHandler = {
init: function() {
sendAsyncMessage("SetSyncHandler", {}, {handler: this});
},
getFocusedElementAndWindow: function() {
let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
let focusedWindow = {};
let elt = fm.getFocusedElementForWindow(content, true, focusedWindow);
return [elt, focusedWindow.value];
},
};
SyncHandler.init();
let WebProgressListener = { let WebProgressListener = {
init: function() { init: function() {
let webProgress = docShell.QueryInterface(Ci.nsIInterfaceRequestor) let webProgress = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
@ -49,8 +33,10 @@ let WebProgressListener = {
}, },
_setupObjects: function setupObjects(aWebProgress) { _setupObjects: function setupObjects(aWebProgress) {
let win = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
return { return {
contentWindow: content, contentWindow: win,
// DOMWindow is not necessarily the content-window with subframes. // DOMWindow is not necessarily the content-window with subframes.
DOMWindow: aWebProgress.DOMWindow DOMWindow: aWebProgress.DOMWindow
}; };

View File

@ -679,15 +679,11 @@
return false; return false;
let elt = document.commandDispatcher.focusedElement; let elt = document.commandDispatcher.focusedElement;
let win = document.commandDispatcher.focusedWindow;
// Temporary fix for e10s. // Temporary fix for e10s.
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; if (elt instanceof XULElement && elt.tagName == "xul:browser" &&
if (elt instanceof XULElement &&
elt.localName == "browser" &&
elt.namespaceURI == XUL_NS &&
elt.getAttribute("remote")) { elt.getAttribute("remote")) {
[elt, win] = elt.syncHandler.getFocusedElementAndWindow(); elt = elt.contentDocument.activeElement;
} }
if (elt) { if (elt) {
@ -701,6 +697,7 @@
return false; return false;
} }
let win = document.commandDispatcher.focusedWindow;
if (win && !this._mimeTypeIsTextBased(win.document.contentType)) if (win && !this._mimeTypeIsTextBased(win.document.contentType))
return false; return false;

View File

@ -107,12 +107,6 @@
onget="return this.contentWindow ? this.contentWindow.document : null" onget="return this.contentWindow ? this.contentWindow.document : null"
readonly="true"/> readonly="true"/>
<field name="_syncHandler">null</field>
<property name="syncHandler"
onget="return this._syncHandler"
readonly="true"/>
<field name="_imageDocument">null</field> <field name="_imageDocument">null</field>
<property name="imageDocument" <property name="imageDocument"
@ -127,7 +121,6 @@
this.messageManager.addMessageListener("DOMTitleChanged", this); this.messageManager.addMessageListener("DOMTitleChanged", this);
this.messageManager.addMessageListener("ImageDocumentLoaded", this); this.messageManager.addMessageListener("ImageDocumentLoaded", this);
this.messageManager.addMessageListener("SetSyncHandler", this);
this.messageManager.loadFrameScript("chrome://global/content/browser-child.js", true); this.messageManager.loadFrameScript("chrome://global/content/browser-child.js", true);
if (this.hasAttribute("selectpopup")) { if (this.hasAttribute("selectpopup")) {
@ -166,10 +159,6 @@
}; };
break; break;
case "SetSyncHandler":
this._syncHandler = aMessage.objects.handler;
break;
case "Forms:ShowDropDown": { case "Forms:ShowDropDown": {
Cu.import("resource://gre/modules/SelectParentHelper.jsm"); Cu.import("resource://gre/modules/SelectParentHelper.jsm");
let dropdown = document.getElementById(this.getAttribute("selectpopup")); let dropdown = document.getElementById(this.getAttribute("selectpopup"));