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 | #ifndef SkXfermode_proccoeff_DEFINED |
michael@0 | 2 | #define SkXfermode_proccoeff_DEFINED |
michael@0 | 3 | |
michael@0 | 4 | #include "SkXfermode.h" |
michael@0 | 5 | #include "SkReadBuffer.h" |
michael@0 | 6 | #include "SkWriteBuffer.h" |
michael@0 | 7 | |
michael@0 | 8 | struct ProcCoeff { |
michael@0 | 9 | SkXfermodeProc fProc; |
michael@0 | 10 | SkXfermode::Coeff fSC; |
michael@0 | 11 | SkXfermode::Coeff fDC; |
michael@0 | 12 | }; |
michael@0 | 13 | |
michael@0 | 14 | #define CANNOT_USE_COEFF SkXfermode::Coeff(-1) |
michael@0 | 15 | |
michael@0 | 16 | class SkProcCoeffXfermode : public SkProcXfermode { |
michael@0 | 17 | public: |
michael@0 | 18 | static SkProcCoeffXfermode* Create(const ProcCoeff& rec, Mode mode) { |
michael@0 | 19 | return SkNEW_ARGS(SkProcCoeffXfermode, (rec, mode)); |
michael@0 | 20 | } |
michael@0 | 21 | |
michael@0 | 22 | virtual bool asMode(Mode* mode) const SK_OVERRIDE; |
michael@0 | 23 | |
michael@0 | 24 | virtual bool asCoeff(Coeff* sc, Coeff* dc) const SK_OVERRIDE; |
michael@0 | 25 | |
michael@0 | 26 | #if SK_SUPPORT_GPU |
michael@0 | 27 | virtual bool asNewEffect(GrEffectRef** effect, |
michael@0 | 28 | GrTexture* background) const SK_OVERRIDE; |
michael@0 | 29 | #endif |
michael@0 | 30 | |
michael@0 | 31 | SK_TO_STRING_OVERRIDE() |
michael@0 | 32 | SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkProcCoeffXfermode) |
michael@0 | 33 | |
michael@0 | 34 | protected: |
michael@0 | 35 | SkProcCoeffXfermode(const ProcCoeff& rec, Mode mode) |
michael@0 | 36 | : INHERITED(rec.fProc) { |
michael@0 | 37 | fMode = mode; |
michael@0 | 38 | // these may be valid, or may be CANNOT_USE_COEFF |
michael@0 | 39 | fSrcCoeff = rec.fSC; |
michael@0 | 40 | fDstCoeff = rec.fDC; |
michael@0 | 41 | } |
michael@0 | 42 | |
michael@0 | 43 | SkProcCoeffXfermode(SkReadBuffer& buffer); |
michael@0 | 44 | |
michael@0 | 45 | virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE; |
michael@0 | 46 | |
michael@0 | 47 | Mode getMode() const { |
michael@0 | 48 | return fMode; |
michael@0 | 49 | } |
michael@0 | 50 | |
michael@0 | 51 | private: |
michael@0 | 52 | Mode fMode; |
michael@0 | 53 | Coeff fSrcCoeff, fDstCoeff; |
michael@0 | 54 | |
michael@0 | 55 | typedef SkProcXfermode INHERITED; |
michael@0 | 56 | }; |
michael@0 | 57 | |
michael@0 | 58 | #endif // #ifndef SkXfermode_proccoeff_DEFINED |