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 GLCONTEXTWGL_H_ |
michael@0 | 8 | #define GLCONTEXTWGL_H_ |
michael@0 | 9 | |
michael@0 | 10 | #include "GLContext.h" |
michael@0 | 11 | #include "WGLLibrary.h" |
michael@0 | 12 | |
michael@0 | 13 | namespace mozilla { |
michael@0 | 14 | namespace gl { |
michael@0 | 15 | |
michael@0 | 16 | class GLContextWGL : public GLContext |
michael@0 | 17 | { |
michael@0 | 18 | public: |
michael@0 | 19 | MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GLContextWGL) |
michael@0 | 20 | // From Window: (possibly for offscreen!) |
michael@0 | 21 | GLContextWGL(const SurfaceCaps& caps, |
michael@0 | 22 | GLContext* sharedContext, |
michael@0 | 23 | bool isOffscreen, |
michael@0 | 24 | HDC aDC, |
michael@0 | 25 | HGLRC aContext, |
michael@0 | 26 | HWND aWindow = nullptr); |
michael@0 | 27 | |
michael@0 | 28 | // From PBuffer |
michael@0 | 29 | GLContextWGL(const SurfaceCaps& caps, |
michael@0 | 30 | GLContext* sharedContext, |
michael@0 | 31 | bool isOffscreen, |
michael@0 | 32 | HANDLE aPbuffer, |
michael@0 | 33 | HDC aDC, |
michael@0 | 34 | HGLRC aContext, |
michael@0 | 35 | int aPixelFormat); |
michael@0 | 36 | |
michael@0 | 37 | ~GLContextWGL(); |
michael@0 | 38 | |
michael@0 | 39 | virtual GLContextType GetContextType() const MOZ_OVERRIDE { return GLContextType::WGL; } |
michael@0 | 40 | |
michael@0 | 41 | static GLContextWGL* Cast(GLContext* gl) { |
michael@0 | 42 | MOZ_ASSERT(gl->GetContextType() == GLContextType::WGL); |
michael@0 | 43 | return static_cast<GLContextWGL*>(gl); |
michael@0 | 44 | } |
michael@0 | 45 | |
michael@0 | 46 | bool Init() MOZ_OVERRIDE; |
michael@0 | 47 | |
michael@0 | 48 | virtual bool MakeCurrentImpl(bool aForce) MOZ_OVERRIDE; |
michael@0 | 49 | |
michael@0 | 50 | virtual bool IsCurrent() MOZ_OVERRIDE; |
michael@0 | 51 | |
michael@0 | 52 | void SetIsDoubleBuffered(bool aIsDB); |
michael@0 | 53 | |
michael@0 | 54 | virtual bool IsDoubleBuffered() const MOZ_OVERRIDE; |
michael@0 | 55 | |
michael@0 | 56 | virtual bool SupportsRobustness() const MOZ_OVERRIDE; |
michael@0 | 57 | |
michael@0 | 58 | virtual bool SwapBuffers() MOZ_OVERRIDE; |
michael@0 | 59 | |
michael@0 | 60 | virtual bool SetupLookupFunction() MOZ_OVERRIDE; |
michael@0 | 61 | |
michael@0 | 62 | HGLRC Context() { return mContext; } |
michael@0 | 63 | |
michael@0 | 64 | protected: |
michael@0 | 65 | friend class GLContextProviderWGL; |
michael@0 | 66 | |
michael@0 | 67 | HDC mDC; |
michael@0 | 68 | HGLRC mContext; |
michael@0 | 69 | HWND mWnd; |
michael@0 | 70 | HANDLE mPBuffer; |
michael@0 | 71 | int mPixelFormat; |
michael@0 | 72 | bool mIsDoubleBuffered; |
michael@0 | 73 | }; |
michael@0 | 74 | |
michael@0 | 75 | } |
michael@0 | 76 | } |
michael@0 | 77 | |
michael@0 | 78 | #endif // GLCONTEXTWGL_H_ |