Bug 1794766 - Use CancelWithReason in imgRequest and nsLoadGroup, r=necko-reviewers,dragana

Differential Revision: https://phabricator.services.mozilla.com/D159148
This commit is contained in:
Kershaw Chang 2022-10-13 08:54:12 +00:00
Родитель 3127a3d3f3
Коммит 278e75d974
3 изменённых файлов: 5 добавлений и 5 удалений

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

@ -350,7 +350,7 @@ void imgRequest::ContinueCancel(nsresult aStatus) {
RemoveFromCache();
if (mRequest && !(progressTracker->GetProgress() & FLAG_LAST_PART_COMPLETE)) {
mRequest->Cancel(aStatus);
mRequest->CancelWithReason(aStatus, "imgRequest::ContinueCancel"_ns);
}
}

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

@ -232,7 +232,7 @@ nsLoadGroup::Cancel(nsresult status) {
}
// Cancel the request...
rv = request->Cancel(status);
rv = request->CancelWithReason(status, mCanceledReason);
// Remember the first failure and return it...
if (NS_FAILED(rv) && NS_SUCCEEDED(firstError)) firstError = rv;

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

@ -425,16 +425,16 @@ NullHttpChannel::GetStatus(nsresult* aStatus) {
}
NS_IMETHODIMP NullHttpChannel::SetCanceledReason(const nsACString& aReason) {
return SetCanceledReasonImpl(aReason);
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP NullHttpChannel::GetCanceledReason(nsACString& aReason) {
return GetCanceledReasonImpl(aReason);
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP NullHttpChannel::CancelWithReason(nsresult aStatus,
const nsACString& aReason) {
return CancelWithReasonImpl(aStatus, aReason);
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP