Sat, 03 Jan 2015 20:18:00 +0100
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.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* vim: set ts=8 sts=4 et sw=4 tw=80: */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef GLCONTEXTGLX_H_ |
michael@0 | 8 | #define GLCONTEXTGLX_H_ |
michael@0 | 9 | |
michael@0 | 10 | #include "GLContext.h" |
michael@0 | 11 | #include "GLXLibrary.h" |
michael@0 | 12 | |
michael@0 | 13 | namespace mozilla { |
michael@0 | 14 | namespace gl { |
michael@0 | 15 | |
michael@0 | 16 | class GLContextGLX : public GLContext |
michael@0 | 17 | { |
michael@0 | 18 | public: |
michael@0 | 19 | MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GLContextGLX) |
michael@0 | 20 | static already_AddRefed<GLContextGLX> |
michael@0 | 21 | CreateGLContext(const SurfaceCaps& caps, |
michael@0 | 22 | GLContextGLX* shareContext, |
michael@0 | 23 | bool isOffscreen, |
michael@0 | 24 | Display* display, |
michael@0 | 25 | GLXDrawable drawable, |
michael@0 | 26 | GLXFBConfig cfg, |
michael@0 | 27 | bool deleteDrawable, |
michael@0 | 28 | gfxXlibSurface* pixmap = nullptr); |
michael@0 | 29 | |
michael@0 | 30 | ~GLContextGLX(); |
michael@0 | 31 | |
michael@0 | 32 | virtual GLContextType GetContextType() const MOZ_OVERRIDE { return GLContextType::GLX; } |
michael@0 | 33 | |
michael@0 | 34 | static GLContextGLX* Cast(GLContext* gl) { |
michael@0 | 35 | MOZ_ASSERT(gl->GetContextType() == GLContextType::GLX); |
michael@0 | 36 | return static_cast<GLContextGLX*>(gl); |
michael@0 | 37 | } |
michael@0 | 38 | |
michael@0 | 39 | bool Init() MOZ_OVERRIDE; |
michael@0 | 40 | |
michael@0 | 41 | virtual bool MakeCurrentImpl(bool aForce) MOZ_OVERRIDE; |
michael@0 | 42 | |
michael@0 | 43 | virtual bool IsCurrent() MOZ_OVERRIDE; |
michael@0 | 44 | |
michael@0 | 45 | virtual bool SetupLookupFunction() MOZ_OVERRIDE; |
michael@0 | 46 | |
michael@0 | 47 | virtual bool IsDoubleBuffered() const MOZ_OVERRIDE; |
michael@0 | 48 | |
michael@0 | 49 | virtual bool SupportsRobustness() const MOZ_OVERRIDE; |
michael@0 | 50 | |
michael@0 | 51 | virtual bool SwapBuffers() MOZ_OVERRIDE; |
michael@0 | 52 | |
michael@0 | 53 | private: |
michael@0 | 54 | friend class GLContextProviderGLX; |
michael@0 | 55 | |
michael@0 | 56 | GLContextGLX(const SurfaceCaps& caps, |
michael@0 | 57 | GLContext* shareContext, |
michael@0 | 58 | bool isOffscreen, |
michael@0 | 59 | Display *aDisplay, |
michael@0 | 60 | GLXDrawable aDrawable, |
michael@0 | 61 | GLXContext aContext, |
michael@0 | 62 | bool aDeleteDrawable, |
michael@0 | 63 | bool aDoubleBuffered, |
michael@0 | 64 | gfxXlibSurface *aPixmap); |
michael@0 | 65 | |
michael@0 | 66 | GLXContext mContext; |
michael@0 | 67 | Display *mDisplay; |
michael@0 | 68 | GLXDrawable mDrawable; |
michael@0 | 69 | bool mDeleteDrawable; |
michael@0 | 70 | bool mDoubleBuffered; |
michael@0 | 71 | |
michael@0 | 72 | GLXLibrary* mGLX; |
michael@0 | 73 | |
michael@0 | 74 | nsRefPtr<gfxXlibSurface> mPixmap; |
michael@0 | 75 | bool mOwnsContext; |
michael@0 | 76 | }; |
michael@0 | 77 | |
michael@0 | 78 | } |
michael@0 | 79 | } |
michael@0 | 80 | |
michael@0 | 81 | #endif // GLCONTEXTGLX_H_ |