Bug 1250418 - Remove the assertion check of mCanSend in CompositorChild::ActorDestroy, r=nical
authorpeter chang <pchang@mozilla.com>
Wed, 02 Mar 2016 09:31:44 +0800
changeset 338032 722fb8b4213bca2b78d8f50e0e397f7115022c2a
parent 338031 070e28f591b68baa2faf93c69b7f191ead4a6f02
child 338033 361af7c658e8bffb88c43b46190cd945f22671fc
push id12405
push usercku@mozilla.com
push dateTue, 08 Mar 2016 03:35:29 +0000
reviewersnical
bugs1250418
milestone47.0a1
Bug 1250418 - Remove the assertion check of mCanSend in CompositorChild::ActorDestroy, r=nical MozReview-Commit-ID: L0VSy4cYglh
gfx/layers/ipc/CompositorChild.cpp
--- a/gfx/layers/ipc/CompositorChild.cpp
+++ b/gfx/layers/ipc/CompositorChild.cpp
@@ -410,28 +410,32 @@ CompositorChild::RecvClearCachedResource
     child->ClearCachedResources();
   }
   return true;
 }
 
 void
 CompositorChild::ActorDestroy(ActorDestroyReason aWhy)
 {
-  MOZ_ASSERT(!mCanSend);
   MOZ_ASSERT(sCompositor == this);
 
+  if (aWhy == AbnormalShutdown) {
 #ifdef MOZ_B2G
   // Due to poor lifetime management of gralloc (and possibly shmems) we will
   // crash at some point in the future when we get destroyed due to abnormal
   // shutdown. Its better just to crash here. On desktop though, we have a chance
   // of recovering.
-  if (aWhy == AbnormalShutdown) {
     NS_RUNTIMEABORT("ActorDestroy by IPC channel failure at CompositorChild");
+#endif
+
+    // If the parent side runs into a problem then the actor will be destroyed.
+    // There is nothing we can do in the child side, here sets mCanSend as false.
+    mCanSend = false;
+    gfxCriticalNote << "Receive IPC close with reason=" << aWhy;
   }
-#endif
 
   MessageLoop::current()->PostTask(
     FROM_HERE,
     NewRunnableMethod(this, &CompositorChild::Release));
 }
 
 bool
 CompositorChild::RecvSharedCompositorFrameMetrics(