Bug 1325158: Part 3 - Don't create a reference cycle via HTTP channel property bag. r=mixedpuppy
MozReview-Commit-ID: 40Ox7BDlgwy
--- a/toolkit/modules/addons/WebRequest.jsm
+++ b/toolkit/modules/addons/WebRequest.jsm
@@ -808,24 +808,24 @@ HttpObserverManager = {
examine(channel, topic, data) {
let loadContext = this.getLoadContext(channel);
if (this.needTracing) {
// Check whether we've already added a listener to this channel,
// so we don't wind up chaining multiple listeners.
let channelData = getData(channel);
- if (!channelData.listener && channel instanceof Ci.nsITraceableChannel) {
+ if (!channelData.hasListener && channel instanceof Ci.nsITraceableChannel) {
let responseStatus = channel.responseStatus;
// skip redirections, https://bugzilla.mozilla.org/show_bug.cgi?id=728901#c8
if (responseStatus < 300 || responseStatus >= 400) {
let listener = new StartStopListener(this, loadContext);
let orig = channel.setNewListener(listener);
listener.orig = orig;
- channelData.listener = listener;
+ channelData.hasListener = true;
}
}
}
this.runChannelListener(channel, loadContext, "headersReceived");
},
onChannelReplaced(oldChannel, newChannel) {