Bug 1607984 - P10. Wait until OnStopRequest has been called to clear mRequest. r=valentin

The code assumed that nsJARChannel::RetargetDeliveryTo would have been called synchronously from nsJARChannel::OnStartRequest, which would be true if we weren't using a DocumentChannel.

The DocumentLoadListener queue the calls to OnStartRequest until the final redirect.
nsJARChannel::RetargetDelivery mRequest member is be set to forward the call.
So we need to only reset it once OnStopRequest has been received.

Differential Revision: https://phabricator.services.mozilla.com/D70007
This commit is contained in:
Jean-Yves Avenard 2020-04-24 01:45:09 +00:00
Родитель 80eaecc238
Коммит 11eba58643
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -997,7 +997,6 @@ nsJARChannel::OnStartRequest(nsIRequest* req) {
mRequest = req;
nsresult rv = mListener->OnStartRequest(this);
mRequest = nullptr;
if (NS_FAILED(rv)) {
return rv;
}
@ -1038,6 +1037,7 @@ nsJARChannel::OnStopRequest(nsIRequest* req, nsresult status) {
if (mLoadGroup) mLoadGroup->RemoveRequest(this, nullptr, status);
mRequest = nullptr;
mPump = nullptr;
mIsPending = false;