Bug 924565: Part 2: Use weak observer reference for DOMRequestHelper. r=fabrice

This commit is contained in:
Ben Kelly 2013-11-20 13:33:18 +08:00
parent 6cbcf4947b
commit f0de40df93

View File

@ -141,6 +141,11 @@ DOMRequestIpcHelper.prototype = {
* will be added as a weak referred one by default.
*/
initDOMRequestHelper: function(aWindow, aMessages) {
// Query our required interfaces to force a fast fail if they are not
// provided. These calls will throw if the interface is not available.
this.QueryInterface(Ci.nsISupportsWeakReference);
this.QueryInterface(Ci.nsIObserver);
if (aMessages) {
this.addMessageListeners(aMessages);
}
@ -157,7 +162,8 @@ DOMRequestIpcHelper.prototype = {
this._destroyed = false;
Services.obs.addObserver(this, "inner-window-destroyed", false);
Services.obs.addObserver(this, "inner-window-destroyed",
/* weak-ref */ true);
},
destroyDOMRequestHelper: function() {