Merge mozilla-central to autoland. a=merge CLOSED TREE

This commit is contained in:
Sandor Molnar 2024-10-15 19:23:34 +03:00
commit b3ff16cd7b
5 changed files with 4 additions and 15 deletions

View File

@ -741,7 +741,7 @@ imgRequest::OnStopRequest(nsIRequest* aRequest, nsresult status) {
newPartPending = mNewPartPending;
}
if (isMultipart && newPartPending) {
Unused << OnDataAvailable(aRequest, nullptr, 0, 0);
OnDataAvailable(aRequest, nullptr, 0, 0);
}
// Get this after OnDataAvailable because that might have created the image.

View File

@ -32,7 +32,7 @@ interface nsIStreamListener : nsIRequestObserver
* An exception thrown from onDataAvailable has the side-effect of
* causing the request to be canceled.
*/
[must_use] void onDataAvailable(in nsIRequest aRequest,
void onDataAvailable(in nsIRequest aRequest,
in nsIInputStream aInputStream,
in unsigned long long aOffset,
in unsigned long aCount);

View File

@ -810,8 +810,6 @@ void HttpChannelChild::DoOnDataAvailable(nsIRequest* aRequest,
LOG(("HttpChannelChild::DoOnDataAvailable [this=%p]\n", this));
if (mCanceled) return;
mGotDataAvailable = true;
if (mListener) {
nsCOMPtr<nsIStreamListener> listener(mListener);
nsresult rv = listener->OnDataAvailable(aRequest, aStream, aOffset, aCount);
@ -3057,15 +3055,7 @@ HttpChannelChild::RetargetDeliveryTo(nsISerialEventTarget* aNewTarget) {
MOZ_ASSERT(mOnDataAvailableStartTime.IsNull());
{
MutexAutoLock lock(mEventTargetMutex);
// Don't assert if the target hasn't changed, or if we haven't gotten
// OnDataAvailable
MOZ_DIAGNOSTIC_ASSERT(!mODATarget || (mODATarget == aNewTarget) ||
!mGotDataAvailable);
if (!mODATarget || (mODATarget == aNewTarget) || !mGotDataAvailable) {
RetargetDeliveryToImpl(aNewTarget, lock);
} else {
return NS_ERROR_FAILURE;
}
RetargetDeliveryToImpl(aNewTarget, lock);
}
return NS_OK;

View File

@ -317,7 +317,6 @@ class HttpChannelChild final : public PHttpChannelChild,
// Target thread for delivering ODA.
nsCOMPtr<nsISerialEventTarget> mODATarget MOZ_GUARDED_BY(mEventTargetMutex);
Atomic<bool, mozilla::Relaxed> mGotDataAvailable{false};
// Used to ensure atomicity of mNeckoTarget / mODATarget;
Mutex mEventTargetMutex{"HttpChannelChild::EventTargetMutex"};

View File

@ -662,7 +662,7 @@ void OpaqueResponseBlocker::ResolveAndProcessData(
// When this line reaches, the state is either State::Allowed or
// State::Blocked. The OnDataAvailable call will either call
// the next listener or reject the request.
Unused << OnDataAvailable(aChannel, input, 0, mem.Size<char>());
OnDataAvailable(aChannel, input, 0, mem.Size<char>());
MaybeRunOnStopRequest(aChannel);
}