Tue, 06 Jan 2015 21:39:09 +0100
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: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef GFX_ImageLayerComposite_H
7 #define GFX_ImageLayerComposite_H
9 #include "GLTextureImage.h" // for TextureImage
10 #include "ImageLayers.h" // for ImageLayer
11 #include "mozilla/Attributes.h" // for MOZ_OVERRIDE
12 #include "mozilla/RefPtr.h" // for RefPtr
13 #include "mozilla/layers/LayerManagerComposite.h" // for LayerComposite, etc
14 #include "mozilla/layers/LayersTypes.h" // for LayerRenderState, etc
15 #include "nsISupportsImpl.h" // for TextureImage::AddRef, etc
16 #include "nscore.h" // for nsACString
18 struct nsIntPoint;
19 struct nsIntRect;
21 namespace mozilla {
22 namespace layers {
24 class CompositableHost;
25 class ImageHost;
26 class Layer;
28 class ImageLayerComposite : public ImageLayer,
29 public LayerComposite
30 {
31 typedef gl::TextureImage TextureImage;
33 public:
34 ImageLayerComposite(LayerManagerComposite* aManager);
36 virtual ~ImageLayerComposite();
38 virtual LayerRenderState GetRenderState() MOZ_OVERRIDE;
40 virtual void Disconnect() MOZ_OVERRIDE;
42 virtual bool SetCompositableHost(CompositableHost* aHost) MOZ_OVERRIDE;
44 virtual Layer* GetLayer() MOZ_OVERRIDE;
46 virtual void RenderLayer(const nsIntRect& aClipRect);
48 virtual void ComputeEffectiveTransforms(const mozilla::gfx::Matrix4x4& aTransformToSurface) MOZ_OVERRIDE;
50 virtual void CleanupResources() MOZ_OVERRIDE;
52 CompositableHost* GetCompositableHost() MOZ_OVERRIDE;
54 virtual LayerComposite* AsLayerComposite() MOZ_OVERRIDE { return this; }
56 virtual const char* Name() const { return "ImageLayerComposite"; }
58 protected:
59 virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix) MOZ_OVERRIDE;
61 private:
62 RefPtr<CompositableHost> mImageHost;
63 };
65 } /* layers */
66 } /* mozilla */
68 #endif /* GFX_ImageLayerComposite_H */