Bug 1334465 - Set mIPCClosed to true before calling SendDeleteSelf in order to avoid race r=bagder
In the previous code, a race condition could cause us to call SendSetPriority() after calling SendDeleteSelf.
For example:
T1: SendDeleteSelf()
T2: if (!mIPCClosed) SendSetPriority()
T1: mIPCClosed = true
MozReview-Commit-ID: 3XOwCaphb2o
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -2289,18 +2289,18 @@ HttpChannelParent::UpdateAndSerializeSec
NS_SerializeToString(secInfoSer, aSerializedSecurityInfoOut);
}
}
}
bool
HttpChannelParent::DoSendDeleteSelf()
{
+ mIPCClosed = true;
bool rv = SendDeleteSelf();
- mIPCClosed = true;
CleanupBackgroundChannel();
return rv;
}
mozilla::ipc::IPCResult
HttpChannelParent::RecvDeletingChannel()