Bug 1440815 - Add check to TextureClient::EnableReadLock() r=nical

This commit is contained in:
sotaro 2018-03-13 15:39:56 +09:00
Родитель 3272bfe2fb
Коммит faeeb9d479
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -592,7 +592,12 @@ void
TextureClient::EnableReadLock() TextureClient::EnableReadLock()
{ {
if (!mReadLock) { if (!mReadLock) {
if (mAllocator->GetTileLockAllocator()) {
mReadLock = NonBlockingTextureReadLock::Create(mAllocator); mReadLock = NonBlockingTextureReadLock::Create(mAllocator);
} else {
// IPC is down
gfxCriticalError() << "TextureClient::EnableReadLock IPC is down";
}
} }
} }
@ -1679,6 +1684,7 @@ ShmemTextureReadLock::ShmemTextureReadLock(LayersIPCChannel* aAllocator)
{ {
MOZ_COUNT_CTOR(ShmemTextureReadLock); MOZ_COUNT_CTOR(ShmemTextureReadLock);
MOZ_ASSERT(mClientAllocator); MOZ_ASSERT(mClientAllocator);
MOZ_ASSERT(mClientAllocator->GetTileLockAllocator());
#define MOZ_ALIGN_WORD(x) (((x) + 3) & ~3) #define MOZ_ALIGN_WORD(x) (((x) + 3) & ~3)
if (mClientAllocator->GetTileLockAllocator()->AllocShmemSection( if (mClientAllocator->GetTileLockAllocator()->AllocShmemSection(
MOZ_ALIGN_WORD(sizeof(ShmReadLockInfo)), &mShmemSection)) { MOZ_ALIGN_WORD(sizeof(ShmReadLockInfo)), &mShmemSection)) {