mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
Bug 1325158: Part 3 - Don't create a reference cycle via HTTP channel property bag. r=mixedpuppy
MozReview-Commit-ID: 40Ox7BDlgwy --HG-- extra : rebase_source : 1ad1f43b7da1bb0be3b04814347396fc29fbb4f6
This commit is contained in:
parent
d823573e34
commit
9822075cb5
@ -813,14 +813,14 @@ HttpObserverManager = {
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user