commit 646f99465e4f Author: Valentin Gosu Date: Fri Feb 9 13:20:04 2018 +0100 Bug 1334465 - Make HttpChannelParent::mIPCClosed atomic r=bagder a=ritu MozReview-Commit-ID: 6irCJMAjzjW --HG-- extra : source : bd315ae86709c3459a3dbf0778022ff3b1908723 --- netwerk/protocol/http/HttpChannelParent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git netwerk/protocol/http/HttpChannelParent.h netwerk/protocol/http/HttpChannelParent.h index 572d7f177d7a..ef4dbd84f792 100644 --- netwerk/protocol/http/HttpChannelParent.h +++ netwerk/protocol/http/HttpChannelParent.h @@ -264,7 +264,7 @@ private: RefPtr mChannel; nsCOMPtr mCacheEntry; nsCOMPtr mAssociatedContentSecurity; - bool mIPCClosed; // PHttpChannel actor has been Closed() + Atomic mIPCClosed; // PHttpChannel actor has been Closed() nsCOMPtr mRedirectChannel; nsCOMPtr mRedirectCallback; commit a87603550115 Author: Valentin Gosu Date: Sun Feb 11 03:51:09 2018 +0100 Bug 1334465 - Set mIPCClosed to true before calling SendDeleteSelf in order to avoid race r=bagder a=ritu 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 --HG-- extra : source : 4ebdab0e332892378558817e30d0138c95199ce5 --- netwerk/protocol/http/HttpChannelParent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git netwerk/protocol/http/HttpChannelParent.cpp netwerk/protocol/http/HttpChannelParent.cpp index 064c5659e9ed..8ee13c2b5fbd 100644 --- netwerk/protocol/http/HttpChannelParent.cpp +++ netwerk/protocol/http/HttpChannelParent.cpp @@ -2262,8 +2262,8 @@ HttpChannelParent::UpdateAndSerializeSecurityInfo(nsACString& aSerializedSecurit bool HttpChannelParent::DoSendDeleteSelf() { - bool rv = SendDeleteSelf(); mIPCClosed = true; + bool rv = SendDeleteSelf(); CleanupBackgroundChannel();