Bug 933082 - Part 2: propagate the mIPCOpen flag, avoid crashing in DestroySharedSurface on a dead channel - r=nical

This commit is contained in:
Benoit Jacob 2013-11-27 10:18:38 -05:00
Родитель 927f3a5008
Коммит a1decdf354
4 изменённых файлов: 13 добавлений и 0 удалений

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

@ -127,6 +127,9 @@ ISurfaceAllocator::DestroySharedSurface(SurfaceDescriptor* aSurface)
if (!aSurface) { if (!aSurface) {
return; return;
} }
if (!IPCOpen()) {
return;
}
if (PlatformDestroySharedSurface(aSurface)) { if (PlatformDestroySharedSurface(aSurface)) {
return; return;
} }

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

@ -124,6 +124,8 @@ ISurfaceAllocator() {}
return nullptr; return nullptr;
} }
virtual bool IPCOpen() const { return true; }
// Returns true if aSurface wraps a Shmem. // Returns true if aSurface wraps a Shmem.
static bool IsShmem(SurfaceDescriptor* aSurface); static bool IsShmem(SurfaceDescriptor* aSurface);

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

@ -617,6 +617,12 @@ ShadowLayerForwarder::DeallocShmem(ipc::Shmem& aShmem)
mShadowManager->DeallocShmem(aShmem); mShadowManager->DeallocShmem(aShmem);
} }
bool
ShadowLayerForwarder::IPCOpen() const
{
return mShadowManager->IPCOpen();
}
/*static*/ already_AddRefed<gfxASurface> /*static*/ already_AddRefed<gfxASurface>
ShadowLayerForwarder::OpenDescriptor(OpenMode aMode, ShadowLayerForwarder::OpenDescriptor(OpenMode aMode,
const SurfaceDescriptor& aSurface) const SurfaceDescriptor& aSurface)

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

@ -394,6 +394,8 @@ public:
mozilla::ipc::Shmem* aShmem) MOZ_OVERRIDE; mozilla::ipc::Shmem* aShmem) MOZ_OVERRIDE;
virtual void DeallocShmem(mozilla::ipc::Shmem& aShmem) MOZ_OVERRIDE; virtual void DeallocShmem(mozilla::ipc::Shmem& aShmem) MOZ_OVERRIDE;
virtual bool IPCOpen() const MOZ_OVERRIDE;
/** /**
* Construct a shadow of |aLayer| on the "other side", at the * Construct a shadow of |aLayer| on the "other side", at the
* LayerManagerComposite. * LayerManagerComposite.