From 54204fe0b09bb0f63b2156d86585b9d92748bd95 Mon Sep 17 00:00:00 2001 From: smayya Date: Mon, 16 Sep 2024 02:52:47 +0000 Subject: [PATCH] Bug 1887783 - ensure we are not retargeting during OnDataAvailable. r=necko-reviewers,valentin Differential Revision: https://phabricator.services.mozilla.com/D221965 --- netwerk/protocol/http/HttpChannelChild.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp index fd57b3beed51..3a4feccc5ae3 100644 --- a/netwerk/protocol/http/HttpChannelChild.cpp +++ b/netwerk/protocol/http/HttpChannelChild.cpp @@ -3042,9 +3042,12 @@ HttpChannelChild::RetargetDeliveryTo(nsISerialEventTarget* aNewTarget) { return rv; } + // We allow multiple retargeting. However all such modification must happen + // before we have have received the first OnDataAvailable. + // See Bug 1887783 + MOZ_ASSERT(mOnDataAvailableStartTime.IsNull()); { MutexAutoLock lock(mEventTargetMutex); - MOZ_ASSERT(!mODATarget); RetargetDeliveryToImpl(aNewTarget, lock); }