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 | |
michael@0 | 2 | /* |
michael@0 | 3 | * Copyright 2006 The Android Open Source Project |
michael@0 | 4 | * |
michael@0 | 5 | * Use of this source code is governed by a BSD-style license that can be |
michael@0 | 6 | * found in the LICENSE file. |
michael@0 | 7 | */ |
michael@0 | 8 | |
michael@0 | 9 | |
michael@0 | 10 | #ifndef SkOSWindow_Win_DEFINED |
michael@0 | 11 | #define SkOSWindow_Win_DEFINED |
michael@0 | 12 | |
michael@0 | 13 | #include "SkWindow.h" |
michael@0 | 14 | |
michael@0 | 15 | #if SK_ANGLE |
michael@0 | 16 | #include "EGL/egl.h" |
michael@0 | 17 | #endif |
michael@0 | 18 | |
michael@0 | 19 | class SkOSWindow : public SkWindow { |
michael@0 | 20 | public: |
michael@0 | 21 | SkOSWindow(void* hwnd); |
michael@0 | 22 | virtual ~SkOSWindow(); |
michael@0 | 23 | |
michael@0 | 24 | void* getHWND() const { return fHWND; } |
michael@0 | 25 | void setSize(int width, int height); |
michael@0 | 26 | void updateSize(); |
michael@0 | 27 | |
michael@0 | 28 | static bool PostEvent(SkEvent* evt, SkEventSinkID, SkMSec delay); |
michael@0 | 29 | |
michael@0 | 30 | enum SkBackEndTypes { |
michael@0 | 31 | kNone_BackEndType, |
michael@0 | 32 | #if SK_SUPPORT_GPU |
michael@0 | 33 | kNativeGL_BackEndType, |
michael@0 | 34 | #if SK_ANGLE |
michael@0 | 35 | kANGLE_BackEndType, |
michael@0 | 36 | #endif // SK_ANGLE |
michael@0 | 37 | #endif // SK_SUPPORT_GPU |
michael@0 | 38 | }; |
michael@0 | 39 | |
michael@0 | 40 | struct AttachmentInfo { |
michael@0 | 41 | int fSampleCount; |
michael@0 | 42 | int fStencilBits; |
michael@0 | 43 | }; |
michael@0 | 44 | |
michael@0 | 45 | bool attach(SkBackEndTypes attachType, int msaaSampleCount, AttachmentInfo*); |
michael@0 | 46 | void detach(); |
michael@0 | 47 | void present(); |
michael@0 | 48 | |
michael@0 | 49 | bool wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); |
michael@0 | 50 | static bool QuitOnDeactivate(HWND hWnd); |
michael@0 | 51 | |
michael@0 | 52 | enum { |
michael@0 | 53 | SK_WM_SkEvent = WM_APP + 1000, |
michael@0 | 54 | SK_WM_SkTimerID = 0xFFFF // just need a non-zero value |
michael@0 | 55 | }; |
michael@0 | 56 | |
michael@0 | 57 | protected: |
michael@0 | 58 | virtual bool quitOnDeactivate() { return true; } |
michael@0 | 59 | |
michael@0 | 60 | // overrides from SkWindow |
michael@0 | 61 | virtual void onHandleInval(const SkIRect&); |
michael@0 | 62 | // overrides from SkView |
michael@0 | 63 | virtual void onAddMenu(const SkOSMenu*); |
michael@0 | 64 | |
michael@0 | 65 | virtual void onSetTitle(const char title[]); |
michael@0 | 66 | |
michael@0 | 67 | private: |
michael@0 | 68 | void* fHWND; |
michael@0 | 69 | |
michael@0 | 70 | void doPaint(void* ctx); |
michael@0 | 71 | |
michael@0 | 72 | #if SK_SUPPORT_GPU |
michael@0 | 73 | void* fHGLRC; |
michael@0 | 74 | #if SK_ANGLE |
michael@0 | 75 | EGLDisplay fDisplay; |
michael@0 | 76 | EGLContext fContext; |
michael@0 | 77 | EGLSurface fSurface; |
michael@0 | 78 | EGLConfig fConfig; |
michael@0 | 79 | #endif // SK_ANGLE |
michael@0 | 80 | #endif // SK_SUPPORT_GPU |
michael@0 | 81 | |
michael@0 | 82 | HMENU fMBar; |
michael@0 | 83 | |
michael@0 | 84 | SkBackEndTypes fAttached; |
michael@0 | 85 | |
michael@0 | 86 | #if SK_SUPPORT_GPU |
michael@0 | 87 | bool attachGL(int msaaSampleCount, AttachmentInfo* info); |
michael@0 | 88 | void detachGL(); |
michael@0 | 89 | void presentGL(); |
michael@0 | 90 | |
michael@0 | 91 | #if SK_ANGLE |
michael@0 | 92 | bool attachANGLE(int msaaSampleCount, AttachmentInfo* info); |
michael@0 | 93 | void detachANGLE(); |
michael@0 | 94 | void presentANGLE(); |
michael@0 | 95 | #endif // SK_ANGLE |
michael@0 | 96 | #endif // SK_SUPPORT_GPU |
michael@0 | 97 | |
michael@0 | 98 | typedef SkWindow INHERITED; |
michael@0 | 99 | }; |
michael@0 | 100 | |
michael@0 | 101 | #endif |