gfx/layers/ipc/ShadowLayerChild.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/layers/ipc/ShadowLayerChild.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,39 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + * vim: sw=2 ts=8 et :
     1.6 + */
     1.7 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    1.10 +
    1.11 +#include "ShadowLayerChild.h"
    1.12 +#include "Layers.h"                     // for Layer
    1.13 +#include "ShadowLayers.h"               // for ShadowableLayer
    1.14 +#include "nsDebug.h"                    // for NS_ABORT_IF_FALSE
    1.15 +
    1.16 +namespace mozilla {
    1.17 +namespace layers {
    1.18 +
    1.19 +ShadowLayerChild::ShadowLayerChild(ShadowableLayer* aLayer)
    1.20 +  : mLayer(aLayer)
    1.21 +{ }
    1.22 +
    1.23 +ShadowLayerChild::~ShadowLayerChild()
    1.24 +{ }
    1.25 +
    1.26 +void
    1.27 +ShadowLayerChild::ActorDestroy(ActorDestroyReason why)
    1.28 +{
    1.29 +  NS_ABORT_IF_FALSE(AncestorDeletion != why,
    1.30 +                    "shadowable layer should have been cleaned up by now");
    1.31 +
    1.32 +  if (AbnormalShutdown == why) {
    1.33 +    // This is last-ditch emergency shutdown.  Just have the layer
    1.34 +    // forget its IPDL resources; IPDL-generated code will clean up
    1.35 +    // automatically in this case.
    1.36 +    mLayer->AsLayer()->Disconnect();
    1.37 +    mLayer = nullptr;
    1.38 +  }
    1.39 +}
    1.40 +
    1.41 +}  // namespace layers
    1.42 +}  // namespace mozilla

mercurial