michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * vim: sw=2 ts=8 et : michael@0: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "RenderFrameChild.h" michael@0: #include "mozilla/layers/LayerTransactionChild.h" michael@0: michael@0: using mozilla::layers::PLayerTransactionChild; michael@0: using mozilla::layers::LayerTransactionChild; michael@0: michael@0: namespace mozilla { michael@0: namespace layout { michael@0: michael@0: void michael@0: RenderFrameChild::Destroy() michael@0: { michael@0: size_t numChildren = ManagedPLayerTransactionChild().Length(); michael@0: NS_ABORT_IF_FALSE(0 == numChildren || 1 == numChildren, michael@0: "render frame must only have 0 or 1 layer forwarder"); michael@0: michael@0: if (numChildren) { michael@0: LayerTransactionChild* layers = michael@0: static_cast(ManagedPLayerTransactionChild()[0]); michael@0: layers->Destroy(); michael@0: // |layers| was just deleted, take care michael@0: } michael@0: michael@0: Send__delete__(this); michael@0: // WARNING: |this| is dead, hands off michael@0: } michael@0: michael@0: PLayerTransactionChild* michael@0: RenderFrameChild::AllocPLayerTransactionChild() michael@0: { michael@0: LayerTransactionChild* c = new LayerTransactionChild(); michael@0: c->AddIPDLReference(); michael@0: return c; michael@0: } michael@0: michael@0: bool michael@0: RenderFrameChild::DeallocPLayerTransactionChild(PLayerTransactionChild* aLayers) michael@0: { michael@0: static_cast(aLayers)->ReleaseIPDLReference(); michael@0: return true; michael@0: } michael@0: michael@0: } // namespace layout michael@0: } // namespace mozilla