Bug 1279208, r=mak

MozReview-Commit-ID: KOuTjwn9MSx
This commit is contained in:
Gijs Kruitbosch
2016-06-09 13:25:07 +01:00
parent 961b5571f2
commit 6178c6b816
2 changed files with 17 additions and 7 deletions

View File

@@ -441,7 +441,11 @@ AsyncFetchAndSetIconForPage::FetchFromNetwork() {
priorityChannel->AdjustPriority(nsISupportsPriority::PRIORITY_LOWEST);
}
return channel->AsyncOpen2(this);
rv = channel->AsyncOpen2(this);
if (NS_SUCCEEDED(rv)) {
mRequest = channel;
}
return rv;
}
NS_IMETHODIMP
@@ -462,6 +466,9 @@ NS_IMETHODIMP
AsyncFetchAndSetIconForPage::OnStartRequest(nsIRequest* aRequest,
nsISupports* aContext)
{
// mRequest should already be set from ::FetchFromNetwork, but in the case of
// a redirect we might get a new request, and we should make sure we keep a
// reference to the most current request.
mRequest = aRequest;
if (mCanceled) {
mRequest->Cancel(NS_BINDING_ABORTED);