gfx/layers/ipc/LayerTransactionChild.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial