mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1035074 - Fix DOMRequestHelper::destroyDOMRequestHelper logic error. r=gene, fabrice, ferjm.
This commit is contained in:
parent
7dd4463125
commit
8fca54a785
@ -186,8 +186,8 @@ DOMRequestIpcHelper.prototype = {
|
||||
|
||||
if (this._listeners) {
|
||||
Object.keys(this._listeners).forEach((aName) => {
|
||||
this._listeners[aName] ? cpmm.removeWeakMessageListener(aName, this)
|
||||
: cpmm.removeMessageListener(aName, this);
|
||||
this._listeners[aName].weakRef ? cpmm.removeWeakMessageListener(aName, this)
|
||||
: cpmm.removeMessageListener(aName, this);
|
||||
delete this._listeners[aName];
|
||||
});
|
||||
}
|
||||
|
@ -21,6 +21,8 @@
|
||||
Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
|
||||
let obs = Cc["@mozilla.org/observer-service;1"].
|
||||
getService(Ci.nsIObserverService);
|
||||
let ppmm = Cc["@mozilla.org/parentprocessmessagemanager;1"].
|
||||
getService(Ci.nsIMessageBroadcaster);
|
||||
|
||||
function DummyHelperSubclass() {
|
||||
this.onuninit = null;
|
||||
@ -143,7 +145,21 @@
|
||||
let cwdDummy = new DummyHelperSubclass();
|
||||
cwdDummy.onuninit = function() {
|
||||
uninitCalled = true;
|
||||
|
||||
if (!aOptions.messages || !aOptions.messages.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If all message listeners are removed, cwdDummy.receiveMessage
|
||||
// should never be called.
|
||||
ppmm.broadcastAsyncMessage(aOptions.messages[0].name);
|
||||
};
|
||||
|
||||
// Test if we still receive messages from ppmm.
|
||||
cwdDummy.receiveMessage = function(aMessage) {
|
||||
ok(false, "cwdDummy.receiveMessage should NOT be called: " + aMessage.name);
|
||||
};
|
||||
|
||||
cwdDummy.initDOMRequestHelper(frame.contentWindow, aOptions.messages);
|
||||
// Make sure to clear our strong ref here so that we can test our
|
||||
// weak reference listeners and observer.
|
||||
|
Loading…
Reference in New Issue
Block a user