Bug 1181595 - MessagePortChild should check if the MessagePort is still alive before dispatching messages. r=smaug, a=ritu
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 19 Aug 2015 15:30:21 +0100
changeset 288849 d43981e7c3ab4c49ddc9601156cb4ece7c23ab1d
parent 288848 1761a4d01a77dd36205c449acb292ccc3263a6f1
child 288850 9603c34d323749b9947d17fa54cd6c937999623d
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, ritu
bugs1181595
milestone42.0a2
Bug 1181595 - MessagePortChild should check if the MessagePort is still alive before dispatching messages. r=smaug, a=ritu
dom/messagechannel/MessagePortChild.cpp
--- a/dom/messagechannel/MessagePortChild.cpp
+++ b/dom/messagechannel/MessagePortChild.cpp
@@ -18,26 +18,28 @@ MessagePortChild::RecvStopSendingDataCon
   mPort->StopSendingDataConfirmed();
   MOZ_ASSERT(!mPort);
   return true;
 }
 
 bool
 MessagePortChild::RecvEntangled(nsTArray<MessagePortMessage>&& aMessages)
 {
-  MOZ_ASSERT(mPort);
-  mPort->Entangled(aMessages);
+  if (mPort) {
+    mPort->Entangled(aMessages);
+  }
   return true;
 }
 
 bool
 MessagePortChild::RecvReceiveData(nsTArray<MessagePortMessage>&& aMessages)
 {
-  MOZ_ASSERT(mPort);
-  mPort->MessagesReceived(aMessages);
+  if (mPort) {
+    mPort->MessagesReceived(aMessages);
+  }
   return true;
 }
 
 void
 MessagePortChild::ActorDestroy(ActorDestroyReason aWhy)
 {
   if (mPort) {
     mPort->Closed();