Bug 1250418 - Remove the assertion check of mCanSend in CompositorChild::ActorDestroy, r?nical draft
authorpeter chang <pchang@mozilla.com>
Wed, 02 Mar 2016 09:31:44 +0800
changeset 335995 ad98437ef4a700855b9c51082f8b9ba1c2ccb151
parent 335409 9da51cb4974e03cdd8fa45a34086fe1033abfeaf
child 515266 1ad4e7b88e344c7df44dfc4d9a96ad39b45118a2
push id11932
push userpchang@mozilla.com
push dateWed, 02 Mar 2016 01:34:19 +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
@@ -390,28 +390,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(