gfx/layers/composite/X11TextureHost.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: 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 MOZILLA_GFX_X11TEXTUREHOST__H
     7 #define MOZILLA_GFX_X11TEXTUREHOST__H
     9 #include "mozilla/layers/TextureHost.h"
    10 #include "mozilla/layers/LayersSurfaces.h"
    11 #include "mozilla/gfx/Types.h"
    13 class gfxXlibSurface;
    15 namespace mozilla {
    16 namespace layers {
    18 // TextureHost for Xlib-backed TextureSources.
    19 class X11TextureHost : public TextureHost
    20 {
    21 public:
    22   X11TextureHost(TextureFlags aFlags,
    23                  const SurfaceDescriptorX11& aDescriptor);
    25   virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
    27   virtual bool Lock() MOZ_OVERRIDE;
    29   virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE;
    31   virtual gfx::IntSize GetSize() const MOZ_OVERRIDE;
    33   virtual NewTextureSource* GetTextureSources() MOZ_OVERRIDE
    34   {
    35     return mTextureSource;
    36   }
    38   virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() MOZ_OVERRIDE
    39   {
    40     return nullptr; // XXX - implement this (for MOZ_DUMP_PAINTING)
    41   }
    43 #ifdef MOZ_LAYERS_HAVE_LOG
    44   virtual const char* Name() { return "X11TextureHost"; }
    45 #endif
    47 protected:
    48   Compositor* mCompositor;
    49   RefPtr<NewTextureSource> mTextureSource;
    50   RefPtr<gfxXlibSurface> mSurface;
    51 };
    53 } // namespace layers
    54 } // namespace mozilla
    56 #endif // MOZILLA_GFX_X11TEXTUREHOST__H

mercurial