gfx/gl/TextureGarbageBin.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: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     2 /* vim: set ts=8 sts=4 et sw=4 tw=80: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef TEXTUREGARBAGEBIN_H_
     8 #define TEXTUREGARBAGEBIN_H_
    10 #include <stack>
    12 #include "mozilla/Mutex.h"
    13 #include "nsISupportsImpl.h"
    15 #include "GLContextTypes.h"
    17 namespace mozilla {
    18 namespace gl {
    20 class TextureGarbageBin MOZ_FINAL {
    21     NS_INLINE_DECL_THREADSAFE_REFCOUNTING(TextureGarbageBin)
    23 private:
    24     // Private destructor, to discourage deletion outside of Release():
    25     ~TextureGarbageBin()
    26     {
    27     }
    29     GLContext* mGL;
    30     Mutex mMutex;
    31     std::stack<GLuint> mGarbageTextures;
    33 public:
    34     TextureGarbageBin(GLContext* gl)
    35         : mGL(gl)
    36         , mMutex("TextureGarbageBin mutex")
    37     {}
    39     void GLContextTeardown();
    40     void Trash(GLuint tex);
    41     void EmptyGarbage();
    42 };
    44 }
    45 }
    47 #endif // TEXTUREGARBAGEBIN_H_

mercurial