Bug 1887783 - ensure we are not retargeting during OnDataAvailable. r=necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D221965
This commit is contained in:
smayya 2024-09-16 02:52:47 +00:00
parent da5068339b
commit 54204fe0b0

View File

@ -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);
}