зеркало из https://github.com/mozilla/gecko-dev.git
Don't attach shadowable layers if IPDL fails to construct an actor. (bug 1314349, r=mattwoodrow)
This commit is contained in:
Родитель
4558802c65
Коммит
718c1c97fe
|
@ -12,20 +12,27 @@
|
|||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
ShadowLayerChild::ShadowLayerChild(ShadowableLayer* aLayer)
|
||||
: mLayer(aLayer)
|
||||
ShadowLayerChild::ShadowLayerChild()
|
||||
: mLayer(nullptr)
|
||||
{ }
|
||||
|
||||
ShadowLayerChild::~ShadowLayerChild()
|
||||
{ }
|
||||
|
||||
void
|
||||
ShadowLayerChild::SetShadowableLayer(ShadowableLayer* aLayer)
|
||||
{
|
||||
MOZ_ASSERT(!mLayer);
|
||||
mLayer = aLayer;
|
||||
}
|
||||
|
||||
void
|
||||
ShadowLayerChild::ActorDestroy(ActorDestroyReason why)
|
||||
{
|
||||
MOZ_ASSERT(AncestorDeletion != why,
|
||||
"shadowable layer should have been cleaned up by now");
|
||||
|
||||
if (AbnormalShutdown == why) {
|
||||
if (AbnormalShutdown == why && mLayer) {
|
||||
// This is last-ditch emergency shutdown. Just have the layer
|
||||
// forget its IPDL resources; IPDL-generated code will clean up
|
||||
// automatically in this case.
|
||||
|
|
|
@ -20,9 +20,10 @@ class ShadowableLayer;
|
|||
class ShadowLayerChild : public PLayerChild
|
||||
{
|
||||
public:
|
||||
explicit ShadowLayerChild(ShadowableLayer* aLayer);
|
||||
ShadowLayerChild();
|
||||
virtual ~ShadowLayerChild();
|
||||
|
||||
void SetShadowableLayer(ShadowableLayer* aLayer);
|
||||
ShadowableLayer* layer() const { return mLayer; }
|
||||
|
||||
protected:
|
||||
|
|
|
@ -749,7 +749,14 @@ ShadowLayerForwarder::ConstructShadowFor(ShadowableLayer* aLayer)
|
|||
if (!IPCOpen()) {
|
||||
return nullptr;
|
||||
}
|
||||
return mShadowManager->SendPLayerConstructor(new ShadowLayerChild(aLayer));
|
||||
|
||||
ShadowLayerChild* child = new ShadowLayerChild();
|
||||
if (!mShadowManager->SendPLayerConstructor(child)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
child->SetShadowableLayer(aLayer);
|
||||
return child;
|
||||
}
|
||||
|
||||
#if !defined(MOZ_HAVE_PLATFORM_SPECIFIC_LAYER_BUFFERS)
|
||||
|
|
Загрузка…
Ссылка в новой задаче