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: #ifndef MOZILLA_LAYERS_LAYERTRANSACTIONCHILD_H michael@0: #define MOZILLA_LAYERS_LAYERTRANSACTIONCHILD_H michael@0: michael@0: #include // for uint32_t michael@0: #include "mozilla/Attributes.h" // for MOZ_OVERRIDE michael@0: #include "mozilla/ipc/ProtocolUtils.h" michael@0: #include "mozilla/layers/PLayerTransactionChild.h" michael@0: #include "mozilla/RefPtr.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: namespace layout { michael@0: class RenderFrameChild; michael@0: } michael@0: michael@0: namespace layers { michael@0: michael@0: class LayerTransactionChild : public PLayerTransactionChild michael@0: { michael@0: public: michael@0: NS_INLINE_DECL_THREADSAFE_REFCOUNTING(LayerTransactionChild) michael@0: /** michael@0: * Clean this up, finishing with Send__delete__(). michael@0: * michael@0: * It is expected (checked with an assert) that all shadow layers michael@0: * created by this have already been destroyed and michael@0: * Send__delete__()d by the time this method is called. michael@0: */ michael@0: void Destroy(); michael@0: michael@0: bool IPCOpen() const { return mIPCOpen; } michael@0: michael@0: protected: michael@0: LayerTransactionChild() michael@0: : mIPCOpen(false) michael@0: {} michael@0: ~LayerTransactionChild() { } michael@0: michael@0: virtual PGrallocBufferChild* michael@0: AllocPGrallocBufferChild(const IntSize&, michael@0: const uint32_t&, const uint32_t&, michael@0: MaybeMagicGrallocBufferHandle*) MOZ_OVERRIDE; michael@0: virtual bool michael@0: DeallocPGrallocBufferChild(PGrallocBufferChild* actor) MOZ_OVERRIDE; michael@0: michael@0: virtual PLayerChild* AllocPLayerChild() MOZ_OVERRIDE; michael@0: virtual bool DeallocPLayerChild(PLayerChild* actor) MOZ_OVERRIDE; michael@0: michael@0: virtual PCompositableChild* AllocPCompositableChild(const TextureInfo& aInfo) MOZ_OVERRIDE; michael@0: virtual bool DeallocPCompositableChild(PCompositableChild* actor) MOZ_OVERRIDE; michael@0: michael@0: virtual PTextureChild* AllocPTextureChild(const SurfaceDescriptor& aSharedData, michael@0: const TextureFlags& aFlags) MOZ_OVERRIDE; michael@0: virtual bool DeallocPTextureChild(PTextureChild* actor) MOZ_OVERRIDE; michael@0: michael@0: virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE; michael@0: michael@0: void AddIPDLReference() { michael@0: MOZ_ASSERT(mIPCOpen == false); michael@0: mIPCOpen = true; michael@0: AddRef(); michael@0: } michael@0: void ReleaseIPDLReference() { michael@0: MOZ_ASSERT(mIPCOpen == true); michael@0: mIPCOpen = false; michael@0: Release(); michael@0: } michael@0: friend class CompositorChild; michael@0: friend class layout::RenderFrameChild; michael@0: michael@0: bool mIPCOpen; michael@0: }; michael@0: michael@0: } // namespace layers michael@0: } // namespace mozilla michael@0: michael@0: #endif // MOZILLA_LAYERS_LAYERTRANSACTIONCHILD_H