gfx/gl/GLContextProvider.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: 4 -*-
     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 GLCONTEXTPROVIDER_H_
     7 #define GLCONTEXTPROVIDER_H_
     9 #include "GLContextTypes.h"
    10 #include "nsAutoPtr.h"
    11 #include "SurfaceTypes.h"
    13 #include "nsSize.h" // for gfxIntSize (needed by GLContextProviderImpl.h below)
    15 class nsIWidget;
    17 namespace mozilla {
    18 namespace gl {
    20 #define IN_GL_CONTEXT_PROVIDER_H
    22 // Null is always there
    23 #define GL_CONTEXT_PROVIDER_NAME GLContextProviderNull
    24 #include "GLContextProviderImpl.h"
    25 #undef GL_CONTEXT_PROVIDER_NAME
    27 #ifdef XP_WIN
    28 #define GL_CONTEXT_PROVIDER_NAME GLContextProviderWGL
    29 #include "GLContextProviderImpl.h"
    30 #undef GL_CONTEXT_PROVIDER_NAME
    31 #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderWGL
    32 #define DEFAULT_IMPL WGL
    33 #endif
    35 #ifdef XP_MACOSX
    36 #define GL_CONTEXT_PROVIDER_NAME GLContextProviderCGL
    37 #include "GLContextProviderImpl.h"
    38 #undef GL_CONTEXT_PROVIDER_NAME
    39 #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderCGL
    40 #endif
    42 #if defined(ANDROID) || defined(XP_WIN)
    43 #define GL_CONTEXT_PROVIDER_NAME GLContextProviderEGL
    44 #include "GLContextProviderImpl.h"
    45 #undef GL_CONTEXT_PROVIDER_NAME
    46 #ifndef GL_CONTEXT_PROVIDER_DEFAULT
    47 #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEGL
    48 #endif
    49 #endif
    51 #ifdef MOZ_GL_PROVIDER
    52 #define GL_CONTEXT_PROVIDER_NAME MOZ_GL_PROVIDER
    53 #include "GLContextProviderImpl.h"
    54 #undef GL_CONTEXT_PROVIDER_NAME
    55 #define GL_CONTEXT_PROVIDER_DEFAULT MOZ_GL_PROVIDER
    56 #endif
    58 #if defined(MOZ_X11) && !defined(GL_CONTEXT_PROVIDER_DEFAULT)
    59 #define GL_CONTEXT_PROVIDER_NAME GLContextProviderGLX
    60 #include "GLContextProviderImpl.h"
    61 #undef GL_CONTEXT_PROVIDER_NAME
    62 #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderGLX
    63 #endif
    65 #ifdef GL_CONTEXT_PROVIDER_DEFAULT
    66 typedef GL_CONTEXT_PROVIDER_DEFAULT GLContextProvider;
    67 #else
    68 typedef GLContextProviderNull GLContextProvider;
    69 #endif
    71 #undef IN_GL_CONTEXT_PROVIDER_H
    73 }
    74 }
    76 #endif

mercurial