Bug 1871048 Comment 5 Edit History

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

So, the problem here is that `nsHtml5StreamParser::OnDataAvailable` could be called from `nsIndexedToHTML::OnStopRequest` at [here](https://searchfox.org/mozilla-central/rev/05178ae3d8ed27d47b340094de52bd3f572a5e1d/netwerk/streamconv/converters/nsIndexedToHTML.cpp#611).
When [nsHtml5StreamListener::OnDataFinished](https://searchfox.org/mozilla-central/rev/05178ae3d8ed27d47b340094de52bd3f572a5e1d/parser/html/nsHtml5StreamListener.cpp#96), we call `nsHtml5StreamParser::OnStopRequest` and the state is set to `STREAM_ENDED` [here](https://searchfox.org/mozilla-central/rev/05178ae3d8ed27d47b340094de52bd3f572a5e1d/parser/html/nsHtml5StreamParser.cpp#1371).
After calling `OnDataFinished`, `HttpChannelChild` calls `nsIndexedToHTML::OnStopRequest` and it causes `nsHtml5StreamParser::OnDataAvailable` to be called again and we hit this assertion.
So, the problem here is that `nsHtml5StreamParser::OnDataAvailable` could be called from `nsIndexedToHTML::OnStopRequest` at [here](https://searchfox.org/mozilla-central/rev/05178ae3d8ed27d47b340094de52bd3f572a5e1d/netwerk/streamconv/converters/nsIndexedToHTML.cpp#611).
When [nsHtml5StreamListener::OnDataFinished](https://searchfox.org/mozilla-central/rev/05178ae3d8ed27d47b340094de52bd3f572a5e1d/parser/html/nsHtml5StreamListener.cpp#96) is called, we call `nsHtml5StreamParser::OnStopRequest` and the state is set to `STREAM_ENDED` [here](https://searchfox.org/mozilla-central/rev/05178ae3d8ed27d47b340094de52bd3f572a5e1d/parser/html/nsHtml5StreamParser.cpp#1371).
After calling `OnDataFinished`, `HttpChannelChild` calls `nsIndexedToHTML::OnStopRequest` and it causes `nsHtml5StreamParser::OnDataAvailable` to be called again and we hit this assertion.

Back to Bug 1871048 Comment 5