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