diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index 9a7de3ef0683ede59d46bbb190e941a960f7fc19..aef1db7ea1421fd241790bb451b0e9b21f52b365 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -392,9 +392,9 @@ SheetLoadData::SheetLoadData( } SheetLoadData::~SheetLoadData() { - MOZ_DIAGNOSTIC_ASSERT(mSheetCompleteCalled || mIntentionallyDropped, - "Should always call SheetComplete, except when " - "dropping the load"); + MOZ_RELEASE_ASSERT(mSheetCompleteCalled || mIntentionallyDropped, + "Should always call SheetComplete, except when " + "dropping the load"); } NS_IMETHODIMP diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index 58459904b47a0831b53fc8c153936cff51518462..c668d1b1451edbf42fa3d3edc765fb587e550f02 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -5653,6 +5653,10 @@ nsresult nsHttpChannel::CancelInternal(nsresult status) { &mTransactionTimings, std::move(mSource)); } + // If we don't have mTransactionPump and mCachePump, we need to call + // AsyncAbort to make sure this channel's listener got notified. + bool needAsyncAbort = !mTransactionPump && !mCachePump; + if (mProxyRequest) mProxyRequest->Cancel(status); CancelNetworkRequest(status); mCacheInputStream.CloseAndRelease(); @@ -5663,10 +5667,19 @@ nsresult nsHttpChannel::CancelInternal(nsresult status) { mOnTailUnblock = nullptr; mRequestContext->CancelTailedRequest(this); CloseCacheEntry(false); + needAsyncAbort = false; Unused << AsyncAbort(status); } else if (channelClassifierCancellationPending) { // If we're coming from an asynchronous path when canceling a channel due // to safe-browsing protection, we need to AsyncAbort the channel now. + needAsyncAbort = false; + Unused << AsyncAbort(status); + } + + // If we already have mCallOnResume, AsyncAbort will be called in + // ResumeInternal. + if (needAsyncAbort && !mCallOnResume) { + CloseCacheEntry(false); Unused << AsyncAbort(status); } return NS_OK;