Bug 1474296: Don't disconnect disconnected channels on IPC error. r?mixedpuppy
This is mostly a guess at the cause of the problem, but I can't see any other
way for us to multiply call OnDataAvailable in parallel during normal
disconnection.
MozReview-Commit-ID: KZyhbDCrLR4
--- a/toolkit/components/extensions/webrequest/StreamFilterParent.cpp
+++ b/toolkit/components/extensions/webrequest/StreamFilterParent.cpp
@@ -216,19 +216,31 @@ StreamFilterParent::CheckListenerChain()
* Error handling
*****************************************************************************/
void
StreamFilterParent::Broken()
{
AssertIsActorThread();
- mState = State::Disconnecting;
+ switch (mState) {
+ case State::Initialized:
+ case State::TransferringData:
+ case State::Suspended:
+ mState = State::Disconnecting;
+ if (mChannel) {
+ mChannel->Cancel(NS_ERROR_FAILURE);
+ }
- FinishDisconnect();
+ FinishDisconnect();
+ break;
+
+ default:
+ break;
+ }
}
/*****************************************************************************
* State change requests
*****************************************************************************/
IPCResult
StreamFilterParent::RecvClose()