Bug 1589749 Comment 24 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Before [this assert](https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/netwerk/protocol/http/HttpChannelParent.cpp#1402) there is no check/assert, if `mChannel` is nullptr (like happens in bug 1572553 without consequences). 

There are quite some places we set `mChannel` to nullptr. I found:
[HttpChannelParent::NotifyDiversionFailed](https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/netwerk/protocol/http/HttpChannelParent.cpp#2424)
[HttpChannelParent::AsyncOpenFailed](https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/netwerk/protocol/http/HttpChannelParent.cpp#351)
[HttpChannelParent::RecvDocumentChannelCleanu](https://searchfox.org/mozilla-central/source/netwerk/protocol/http/HttpChannelParent.cpp#1064)
[HttpChannelParent::NotifyDiversionFailed](https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/netwerk/protocol/http/HttpChannelParent.cpp#2424)

And there are even more places [we use it](https://searchfox.org/mozilla-central/search?q=symbol:F_%3CT_mozilla%3A%3Anet%3A%3AHttpChannelParent%3E_mChannel&redirect=false), some without checking. One is here.

As a first measure, I would suggest to add explicit `MOZ_ASSERT(mChannelChild);` to all uses of mChannel in order to be sure, if we are seeing a nullptr or really a wrong channel.

:asuth, are we able to say something about the consequences for the user if this happens?
Before [this assert](https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/netwerk/protocol/http/HttpChannelParent.cpp#1402) there is no check/assert, if `mChannel` is nullptr (like happens in bug 1572553 without consequences). 

There are quite some places we set `mChannel` to nullptr. I found:
[HttpChannelParent::NotifyDiversionFailed](https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/netwerk/protocol/http/HttpChannelParent.cpp#2424)
[HttpChannelParent::AsyncOpenFailed](https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/netwerk/protocol/http/HttpChannelParent.cpp#351)
[HttpChannelParent::RecvDocumentChannelCleanu](https://searchfox.org/mozilla-central/source/netwerk/protocol/http/HttpChannelParent.cpp#1064)
[HttpChannelParent::NotifyDiversionFailed](https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/netwerk/protocol/http/HttpChannelParent.cpp#2424)

And there are even more places [we use it](https://searchfox.org/mozilla-central/search?q=symbol:F_%3CT_mozilla%3A%3Anet%3A%3AHttpChannelParent%3E_mChannel&redirect=false), some without checking. One is here.

As a first measure, I would suggest to add explicit `MOZ_ASSERT(mChannel);` to all uses of mChannel in order to be sure, if we are seeing a nullptr or really a wrong channel.

:asuth, are we able to say something about the consequences for the user if this happens?
Before [this assert](https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/netwerk/protocol/http/HttpChannelParent.cpp#1402) there is no check/assert, if `mChannel` is nullptr (like happens in bug 1572553 without consequences). 

There are quite some places we set `mChannel` to nullptr. I found:
[HttpChannelParent::NotifyDiversionFailed](https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/netwerk/protocol/http/HttpChannelParent.cpp#2424)
[HttpChannelParent::AsyncOpenFailed](https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/netwerk/protocol/http/HttpChannelParent.cpp#351)
[HttpChannelParent::RecvDocumentChannelCleanup](https://searchfox.org/mozilla-central/source/netwerk/protocol/http/HttpChannelParent.cpp#1064)
[HttpChannelParent::NotifyDiversionFailed](https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/netwerk/protocol/http/HttpChannelParent.cpp#2424)

And there are even more places [we use it](https://searchfox.org/mozilla-central/search?q=symbol:F_%3CT_mozilla%3A%3Anet%3A%3AHttpChannelParent%3E_mChannel&redirect=false), some without checking. One is here.

As a first measure, I would suggest to add explicit `MOZ_ASSERT(mChannel);` to all uses of mChannel in order to be sure, if we are seeing a nullptr or really a wrong channel.

:asuth, are we able to say something about the consequences for the user if this happens?

Back to Bug 1589749 Comment 24