Bug 1088300: Diagnosting patch - MOZ_CRASH if we can't get an actor, instead of a nullptr crash. r?nical draft
authorMilan Sreckovic <milan@mozilla.com>
Wed, 24 Aug 2016 12:59:28 -0400
changeset 405061 b9a88396e9b6eba6a5766bdf5f3dad085e7e4d1e
parent 404063 3345f0e8ed3bd33d8af6e2b9bf1fd8bf397a45bc
child 529342 864576dca3a9fcf20611371ac821a597d132bd88
push id27379
push usermsreckovic@mozilla.com
push dateWed, 24 Aug 2016 16:59:57 +0000
reviewersnical
bugs1088300
milestone51.0a1
Bug 1088300: Diagnosting patch - MOZ_CRASH if we can't get an actor, instead of a nullptr crash. r?nical MozReview-Commit-ID: GooHFBvbcTA
gfx/layers/client/TextureClient.cpp
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -899,17 +899,23 @@ TextureClient::InitIPDLActor(Compositabl
   if (!ToSurfaceDescriptor(desc)) {
     return false;
   }
 
   mActor = static_cast<TextureChild*>(aForwarder->CreateTexture(desc,
                                                                 aForwarder->GetCompositorBackendType(),
                                                                 GetFlags(),
                                                                 mSerial));
-  MOZ_ASSERT(mActor);
+  if (!mActor) {
+    gfxCriticalError() << static_cast<int32_t>(desc.type()) << ", "
+                       << static_cast<int32_t>(aForwarder->GetCompositorBackendType()) << ", "
+                       << static_cast<uint32_t>(GetFlags())
+                       << ", " << mSerial;
+    MOZ_CRASH("GFX: Invalid actor");
+  }
   mActor->mCompositableForwarder = aForwarder;
   mActor->mTextureForwarder = aForwarder->AsTextureForwarder();
   mActor->mTextureClient = this;
   mActor->mMainThreadOnly = !!(mFlags & TextureFlags::DEALLOCATE_MAIN_THREAD);
 
   // If the TextureClient is already locked, we have to lock TextureChild's mutex
   // since it will be unlocked in TextureClient::Unlock.
   if (mIsLocked) {