gfx/layers/ipc/ShadowLayerParent.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     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_ShadowLayerParent_h
     9 #define mozilla_layers_ShadowLayerParent_h
    11 #include "mozilla/Attributes.h"         // for MOZ_OVERRIDE
    12 #include "mozilla/ipc/ProtocolUtils.h"
    13 #include "mozilla/layers/PLayerParent.h"  // for PLayerParent
    14 #include "nsAutoPtr.h"                  // for nsRefPtr
    16 namespace mozilla {
    17 namespace layers {
    19 class ContainerLayer;
    20 class Layer;
    21 class LayerManager;
    23 class CanvasLayerComposite;
    24 class ColorLayerComposite;
    25 class ContainerLayerComposite;
    26 class ImageLayerComposite;
    27 class RefLayerComposite;
    28 class ThebesLayerComposite;
    30 class ShadowLayerParent : public PLayerParent
    31 {
    32 public:
    33   ShadowLayerParent();
    35   virtual ~ShadowLayerParent();
    37   void Bind(Layer* layer);
    38   void Destroy();
    40   Layer* AsLayer() const { return mLayer; }
    42   ContainerLayerComposite* AsContainerLayerComposite() const;
    43   CanvasLayerComposite* AsCanvasLayerComposite() const;
    44   ColorLayerComposite* AsColorLayerComposite() const;
    45   ImageLayerComposite* AsImageLayerComposite() const;
    46   RefLayerComposite* AsRefLayerComposite() const;
    47   ThebesLayerComposite* AsThebesLayerComposite() const;
    49 private:
    50   virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
    52   nsRefPtr<Layer> mLayer;
    53 };
    55 } // namespace layers
    56 } // namespace mozilla
    58 #endif // ifndef mozilla_layers_ShadowLayerParent_h

mercurial