Bug 1334465 - Set mIPCClosed to true before calling SendDeleteSelf in order to avoid race r=bagder draft
authorValentin Gosu <valentin.gosu@gmail.com>
Sun, 11 Feb 2018 03:51:09 +0100
changeset 753618 609b9d111d97a8e4a60117dd79ecd741725ec611
parent 753617 a0f195a6c58367f2193b10bbaec62834d1567e86
push id98611
push uservalentin.gosu@gmail.com
push dateSun, 11 Feb 2018 02:52:03 +0000
reviewersbagder
bugs1334465
milestone60.0a1
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
netwerk/protocol/http/HttpChannelParent.cpp
--- 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()