Bug 1000161 - No more crashy asserts in LayerTransactionParent - r=nical

This commit is contained in:
Benoit Jacob 2014-04-23 10:46:50 -04:00
parent 7346c965d5
commit c0825d404f

View File

@ -15,7 +15,6 @@
#include "gfxPoint3D.h" // for gfxPoint3D
#include "CompositableTransactionParent.h" // for EditReplyVector
#include "ShadowLayersManager.h" // for ShadowLayersManager
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/gfx/BasePoint3D.h" // for BasePoint3D
#include "mozilla/layers/CanvasLayerComposite.h"
#include "mozilla/layers/ColorLayerComposite.h"
@ -519,7 +518,10 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
case Edit::TOpAttachAsyncCompositable: {
const OpAttachAsyncCompositable& op = edit.get_OpAttachAsyncCompositable();
CompositableParent* compositableParent = CompositableMap::Get(op.containerID());
MOZ_ASSERT(compositableParent, "CompositableParent not found in the map");
if (!compositableParent) {
NS_ERROR("CompositableParent not found in the map");
return false;
}
if (!Attach(cast(op.layerParent()), compositableParent, true)) {
return false;
}
@ -708,7 +710,9 @@ LayerTransactionParent::Attach(ShadowLayerParent* aLayerParent,
= static_cast<LayerManagerComposite*>(aLayerParent->AsLayer()->Manager())->GetCompositor();
CompositableHost* compositable = aCompositable->GetCompositableHost();
MOZ_ASSERT(compositable);
if (!compositable) {
return false;
}
if (!layer->SetCompositableHost(compositable)) {
// not all layer types accept a compositable, see bug 967824
return false;