Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * vim: sw=2 ts=8 et : |
michael@0 | 3 | */ |
michael@0 | 4 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef MOZILLA_LAYERS_LAYERTRANSACTIONCHILD_H |
michael@0 | 9 | #define MOZILLA_LAYERS_LAYERTRANSACTIONCHILD_H |
michael@0 | 10 | |
michael@0 | 11 | #include <stdint.h> // for uint32_t |
michael@0 | 12 | #include "mozilla/Attributes.h" // for MOZ_OVERRIDE |
michael@0 | 13 | #include "mozilla/ipc/ProtocolUtils.h" |
michael@0 | 14 | #include "mozilla/layers/PLayerTransactionChild.h" |
michael@0 | 15 | #include "mozilla/RefPtr.h" |
michael@0 | 16 | |
michael@0 | 17 | namespace mozilla { |
michael@0 | 18 | |
michael@0 | 19 | namespace layout { |
michael@0 | 20 | class RenderFrameChild; |
michael@0 | 21 | } |
michael@0 | 22 | |
michael@0 | 23 | namespace layers { |
michael@0 | 24 | |
michael@0 | 25 | class LayerTransactionChild : public PLayerTransactionChild |
michael@0 | 26 | { |
michael@0 | 27 | public: |
michael@0 | 28 | NS_INLINE_DECL_THREADSAFE_REFCOUNTING(LayerTransactionChild) |
michael@0 | 29 | /** |
michael@0 | 30 | * Clean this up, finishing with Send__delete__(). |
michael@0 | 31 | * |
michael@0 | 32 | * It is expected (checked with an assert) that all shadow layers |
michael@0 | 33 | * created by this have already been destroyed and |
michael@0 | 34 | * Send__delete__()d by the time this method is called. |
michael@0 | 35 | */ |
michael@0 | 36 | void Destroy(); |
michael@0 | 37 | |
michael@0 | 38 | bool IPCOpen() const { return mIPCOpen; } |
michael@0 | 39 | |
michael@0 | 40 | protected: |
michael@0 | 41 | LayerTransactionChild() |
michael@0 | 42 | : mIPCOpen(false) |
michael@0 | 43 | {} |
michael@0 | 44 | ~LayerTransactionChild() { } |
michael@0 | 45 | |
michael@0 | 46 | virtual PGrallocBufferChild* |
michael@0 | 47 | AllocPGrallocBufferChild(const IntSize&, |
michael@0 | 48 | const uint32_t&, const uint32_t&, |
michael@0 | 49 | MaybeMagicGrallocBufferHandle*) MOZ_OVERRIDE; |
michael@0 | 50 | virtual bool |
michael@0 | 51 | DeallocPGrallocBufferChild(PGrallocBufferChild* actor) MOZ_OVERRIDE; |
michael@0 | 52 | |
michael@0 | 53 | virtual PLayerChild* AllocPLayerChild() MOZ_OVERRIDE; |
michael@0 | 54 | virtual bool DeallocPLayerChild(PLayerChild* actor) MOZ_OVERRIDE; |
michael@0 | 55 | |
michael@0 | 56 | virtual PCompositableChild* AllocPCompositableChild(const TextureInfo& aInfo) MOZ_OVERRIDE; |
michael@0 | 57 | virtual bool DeallocPCompositableChild(PCompositableChild* actor) MOZ_OVERRIDE; |
michael@0 | 58 | |
michael@0 | 59 | virtual PTextureChild* AllocPTextureChild(const SurfaceDescriptor& aSharedData, |
michael@0 | 60 | const TextureFlags& aFlags) MOZ_OVERRIDE; |
michael@0 | 61 | virtual bool DeallocPTextureChild(PTextureChild* actor) MOZ_OVERRIDE; |
michael@0 | 62 | |
michael@0 | 63 | virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE; |
michael@0 | 64 | |
michael@0 | 65 | void AddIPDLReference() { |
michael@0 | 66 | MOZ_ASSERT(mIPCOpen == false); |
michael@0 | 67 | mIPCOpen = true; |
michael@0 | 68 | AddRef(); |
michael@0 | 69 | } |
michael@0 | 70 | void ReleaseIPDLReference() { |
michael@0 | 71 | MOZ_ASSERT(mIPCOpen == true); |
michael@0 | 72 | mIPCOpen = false; |
michael@0 | 73 | Release(); |
michael@0 | 74 | } |
michael@0 | 75 | friend class CompositorChild; |
michael@0 | 76 | friend class layout::RenderFrameChild; |
michael@0 | 77 | |
michael@0 | 78 | bool mIPCOpen; |
michael@0 | 79 | }; |
michael@0 | 80 | |
michael@0 | 81 | } // namespace layers |
michael@0 | 82 | } // namespace mozilla |
michael@0 | 83 | |
michael@0 | 84 | #endif // MOZILLA_LAYERS_LAYERTRANSACTIONCHILD_H |