gfx/layers/SharedTextureImage.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_SHAREDTEXTUREIMAGE_H
     7 #define GFX_SHAREDTEXTUREIMAGE_H
     9 #include "GLContextProvider.h"          // for GLContextProvider
    10 #include "ImageContainer.h"             // for Image
    11 #include "ImageTypes.h"                 // for ImageFormat::SHARED_TEXTURE
    12 #include "nsCOMPtr.h"                   // for already_AddRefed
    13 #include "mozilla/gfx/Point.h"          // for IntSize
    15 // Split into a separate header from ImageLayers.h due to GLContext.h dependence
    16 // Implementation remains in ImageLayers.cpp
    18 namespace mozilla {
    20 namespace layers {
    22 class SharedTextureImage : public Image {
    23 public:
    24   struct Data {
    25     gl::SharedTextureHandle mHandle;
    26     gl::SharedTextureShareType mShareType;
    27     gfx::IntSize mSize;
    28     bool mInverted;
    29   };
    31   void SetData(const Data& aData) { mData = aData; }
    32   const Data* GetData() { return &mData; }
    34   gfx::IntSize GetSize() { return mData.mSize; }
    36   virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface() MOZ_OVERRIDE
    37   {
    38     return nullptr;
    39   }
    41   SharedTextureImage() : Image(nullptr, ImageFormat::SHARED_TEXTURE) {}
    43 private:
    44   Data mData;
    45 };
    47 } // layers
    48 } // mozilla
    50 #endif // GFX_SHAREDTEXTUREIMAGE_H

mercurial