Bug 900221 - Part 1: Switch DOMRequestHelper over to using weak message listeners. rs=fabrice, a=leo+
authorJustin Lebar <justin.lebar@gmail.com>
Mon, 26 Aug 2013 15:22:33 -0700
changeset 119884 e85db8ff0a7c202879436073d2c746e502ea0c87
parent 119883 bcd70a871adebd24a9dfe195b48ffd044035874c
child 119885 328b3b8158ee50ef9b0fe895fde597dff8b4cb0a
push id1048
push userjlebar@mozilla.com
push dateMon, 26 Aug 2013 22:27:32 +0000
reviewersfabrice, leo
bugs900221
milestone18.1
Bug 900221 - Part 1: Switch DOMRequestHelper over to using weak message listeners. rs=fabrice, a=leo+
dom/base/DOMRequestHelper.jsm
--- a/dom/base/DOMRequestHelper.jsm
+++ b/dom/base/DOMRequestHelper.jsm
@@ -69,33 +69,33 @@ DOMRequestIpcHelper.prototype = {
 
   initRequests: function initRequests() {
     this._requests = [];
   },
 
   initMessageListener: function initMessageListener(aMessages) {
     this._messages = aMessages;
     this._messages.forEach(function(msgName) {
-      cpmm.addMessageListener(msgName, this);
+      cpmm.addWeakMessageListener(msgName, this);
     }, this);
   },
   
   initHelper: function(aWindow, aMessages) {
     this.initMessageListener(aMessages);
     this.initRequests();
     this._id = this._getRandomId();
     Services.obs.addObserver(this, "inner-window-destroyed", false);
     this._window = aWindow;
     let util = this._window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
     this.innerWindowID = util.currentInnerWindowID;
   },
 
   removeMessageListener: function removeMessageListener() {
     this._messages.forEach(function(msgName) {
-      cpmm.removeMessageListener(msgName, this);
+      cpmm.removeWeakMessageListener(msgName, this);
     }, this);
     this._messages = null;
   },
 
   createRequest: function() {
     return Services.DOMRequest.createRequest(this._window);
   }
 }