Bug 1128219 - Re-check mListener while calling OnStopRequest after OnStartRequest in HttpBaseChannel::DoNotifyListener. r=michal

This commit is contained in:
Honza Bambas 2015-02-13 07:56:00 -05:00
parent f7f87f9165
commit 45c91c54f3

View File

@ -2011,16 +2011,19 @@ HttpBaseChannel::ReleaseListeners()
void
HttpBaseChannel::DoNotifyListener()
{
if (mListener) {
mListener->OnStartRequest(this, mListenerContext);
}
// Make sure mIsPending is set to false. At this moment we are done from
// the point of view of our consumer and we have to report our self
// as not-pending.
mIsPending = false;
if (mListener) {
mListener->OnStartRequest(this, mListenerContext);
mIsPending = false;
mListener->OnStopRequest(this, mListenerContext, mStatus);
} else {
mIsPending = false;
}
// We have to make sure to drop the references to listeners and callbacks
// no longer needed
ReleaseListeners();