Bug 1328106 - check IPC state before sending event; r=jdm a=jcristau
authorLiang-Heng Chen <xeonchen@gmail.com>
Mon, 23 Jan 2017 16:23:34 +0800
changeset 378224 5039612d015c2a5c2473237bc880a99835cea710
parent 378223 14147cb471a102f9ecc4a30cbb13efaf5c5607f1
child 378225 65e5f8c2d8160bb7a078726ccad358f647418959
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm, jcristau
bugs1328106
milestone53.0a2
Bug 1328106 - check IPC state before sending event; r=jdm a=jcristau MozReview-Commit-ID: CeWCIG0dyKS
dom/network/TCPSocketParent.cpp
--- a/dom/network/TCPSocketParent.cpp
+++ b/dom/network/TCPSocketParent.cpp
@@ -355,18 +355,21 @@ TCPSocketParent::FireStringDataEvent(con
   MOZ_ASSERT(!mFilter, "Socket filtering doesn't support nsCString");
 
   SendEvent(NS_LITERAL_STRING("data"), data, aReadyState);
 }
 
 void
 TCPSocketParent::SendEvent(const nsAString& aType, CallbackData aData, TCPReadyState aReadyState)
 {
-  mozilla::Unused << PTCPSocketParent::SendCallback(nsString(aType), aData,
-                                                    static_cast<uint32_t>(aReadyState));
+  if (mIPCOpen) {
+    mozilla::Unused << PTCPSocketParent::SendCallback(nsString(aType),
+                                                      aData,
+                                                      static_cast<uint32_t>(aReadyState));
+  }
 }
 
 void
 TCPSocketParent::SetSocket(TCPSocket *socket)
 {
   mSocket = socket;
 }