mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 373701. Make sure to properly cancel multipart image loads when they need canceling. r=joedrew, sr=biesi
This commit is contained in:
parent
2facb3c7ab
commit
d1d37978a3
@ -609,6 +609,21 @@ NS_IMETHODIMP imgRequest::OnStartRequest(nsIRequest *aRequest, nsISupports *ctxt
|
||||
if (mpchan)
|
||||
mIsMultiPartChannel = PR_TRUE;
|
||||
|
||||
/*
|
||||
* If mRequest is null here, then we need to set it so that we'll be able to
|
||||
* cancel it if our Cancel() method is called. Note that this can only
|
||||
* happen for multipart channels. We could simply not null out mRequest for
|
||||
* non-last parts, if GetIsLastPart() were reliable, but it's not. See
|
||||
* https://bugzilla.mozilla.org/show_bug.cgi?id=339610
|
||||
*/
|
||||
if (!mRequest) {
|
||||
NS_ASSERTION(mpchan,
|
||||
"We should have an mRequest here unless we're multipart");
|
||||
nsCOMPtr<nsIChannel> chan;
|
||||
mpchan->GetBaseChannel(getter_AddRefs(chan));
|
||||
mRequest = chan;
|
||||
}
|
||||
|
||||
/* set our state variables to their initial values, but advance mState
|
||||
to onStartRequest. */
|
||||
mImageStatus = imgIRequest::STATUS_NONE;
|
||||
|
Loading…
Reference in New Issue
Block a user