Bug 1440815 - Add check to TextureClient::EnableReadLock() r=nical
authorsotaro <sotaro.ikeda.g@gmail.com>
Tue, 13 Mar 2018 15:39:56 +0900
changeset 407877 c65de777e53f2b5bd5ccfd337090f25b614ffa95
parent 407876 72fd699e5741cdaff9f4f688bf488dcef06260cc
child 407878 223c97459e96183eb616aed39147207bdb953ba8
push id33621
push userapavel@mozilla.com
push dateTue, 13 Mar 2018 17:12:05 +0000
treeherdermozilla-central@deb7714a7bcd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1440815
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1440815 - Add check to TextureClient::EnableReadLock() r=nical
gfx/layers/client/TextureClient.cpp
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -587,17 +587,22 @@ TextureClient::Unlock()
   UnlockActor();
   ReadUnlock();
 }
 
 void
 TextureClient::EnableReadLock()
 {
   if (!mReadLock) {
-    mReadLock = NonBlockingTextureReadLock::Create(mAllocator);
+    if (mAllocator->GetTileLockAllocator()) {
+      mReadLock = NonBlockingTextureReadLock::Create(mAllocator);
+    } else {
+      // IPC is down
+      gfxCriticalError() << "TextureClient::EnableReadLock IPC is down";
+    }
   }
 }
 
 bool
 TextureClient::OnForwardedToHost()
 {
   if (mData) {
     mData->OnForwardedToHost();
@@ -1674,16 +1679,17 @@ MemoryTextureReadLock::GetReadCount()
 }
 
 ShmemTextureReadLock::ShmemTextureReadLock(LayersIPCChannel* aAllocator)
   : mClientAllocator(aAllocator)
   , mAllocSuccess(false)
 {
   MOZ_COUNT_CTOR(ShmemTextureReadLock);
   MOZ_ASSERT(mClientAllocator);
+  MOZ_ASSERT(mClientAllocator->GetTileLockAllocator());
 #define MOZ_ALIGN_WORD(x) (((x) + 3) & ~3)
   if (mClientAllocator->GetTileLockAllocator()->AllocShmemSection(
       MOZ_ALIGN_WORD(sizeof(ShmReadLockInfo)), &mShmemSection)) {
     ShmReadLockInfo* info = GetShmReadLockInfoPtr();
     info->readCount = 1;
     mAllocSuccess = true;
   }
 }