gfx/gl/SkiaGLGlue.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
-rwxr-xr-x

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++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */
     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 #include "mozilla/RefPtr.h"
     8 #ifdef USE_SKIA_GPU
    10 #include "GLContext.h"
    11 #include "skia/GrGLInterface.h"
    12 #include "skia/GrContext.h"
    14 namespace mozilla {
    15 namespace gl {
    17 class SkiaGLGlue : public GenericAtomicRefCounted
    18 {
    19 public:
    20   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SkiaGLGlue)
    21   SkiaGLGlue(GLContext* context);
    22   GLContext* GetGLContext() const { return mGLContext.get(); }
    23   GrContext* GetGrContext() const { return mGrContext.get(); }
    25 protected:
    26   virtual ~SkiaGLGlue() {
    27     /*
    28      * These members have inter-dependencies, but do not keep each other alive, so
    29      * destruction order is very important here: mGrContext uses mGrGLInterface, and
    30      * through it, uses mGLContext
    31      */
    32     mGrContext = nullptr;
    33     mGrGLInterface = nullptr;
    34     mGLContext = nullptr;
    35   }
    37 private:
    38   RefPtr<GLContext> mGLContext;
    39   SkRefPtr<GrGLInterface> mGrGLInterface;
    40   SkRefPtr<GrContext> mGrContext;
    41 };
    43 }
    44 }
    46 #else
    48 class GrContext;
    50 namespace mozilla {
    51 namespace gl {
    53 class GLContext;
    55 class SkiaGLGlue : public GenericAtomicRefCounted
    56 {
    57 public:
    58   SkiaGLGlue(GLContext* context);
    59   GLContext* GetGLContext() const { return nullptr; }
    60   GrContext* GetGrContext() const { return nullptr; }
    61 };
    62 }
    63 }
    65 #endif

mercurial