gfx/layers/MacIOSurfaceImage.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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_MACIOSURFACEIMAGE_H
     7 #define GFX_MACIOSURFACEIMAGE_H
     9 #include "ImageContainer.h"
    10 #include "mozilla/gfx/MacIOSurface.h"
    11 #include "mozilla/gfx/Point.h"
    12 #include "mozilla/layers/TextureClient.h"
    14 namespace mozilla {
    16 namespace layers {
    18 class MacIOSurfaceImage : public Image,
    19                           public ISharedImage {
    20 public:
    21   void SetSurface(MacIOSurface* aSurface) { mSurface = aSurface; }
    22   MacIOSurface* GetSurface() { return mSurface; }
    24   gfx::IntSize GetSize() {
    25     return gfx::IntSize(mSurface->GetDevicePixelWidth(), mSurface->GetDevicePixelHeight());
    26   }
    28   virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; }
    30   virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface();
    32   virtual TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE;
    33   virtual uint8_t* GetBuffer() MOZ_OVERRIDE { return nullptr; }
    35   MacIOSurfaceImage() : Image(nullptr, ImageFormat::MAC_IOSURFACE) {}
    37 private:
    38   RefPtr<MacIOSurface> mSurface;
    39   RefPtr<TextureClient> mTextureClient;
    40 };
    42 } // layers
    43 } // mozilla
    45 #endif // GFX_SHAREDTEXTUREIMAGE_H

mercurial