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 | * Copyright 2010 Google Inc. |
michael@0 | 3 | * |
michael@0 | 4 | * Use of this source code is governed by a BSD-style license that can be |
michael@0 | 5 | * found in the LICENSE file. |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef GrClip_DEFINED |
michael@0 | 9 | #define GrClip_DEFINED |
michael@0 | 10 | |
michael@0 | 11 | #include "SkClipStack.h" |
michael@0 | 12 | |
michael@0 | 13 | class GrSurface; |
michael@0 | 14 | struct SkIRect; |
michael@0 | 15 | |
michael@0 | 16 | /** |
michael@0 | 17 | * GrClipData encapsulates the information required to construct the clip |
michael@0 | 18 | * masks. 'fOrigin' is only non-zero when saveLayer has been called |
michael@0 | 19 | * with an offset bounding box. The clips in 'fClipStack' are in |
michael@0 | 20 | * device coordinates (i.e., they have been translated by -fOrigin w.r.t. |
michael@0 | 21 | * the canvas' device coordinates). |
michael@0 | 22 | */ |
michael@0 | 23 | class GrClipData : public SkNoncopyable { |
michael@0 | 24 | public: |
michael@0 | 25 | const SkClipStack* fClipStack; |
michael@0 | 26 | SkIPoint fOrigin; |
michael@0 | 27 | |
michael@0 | 28 | GrClipData() |
michael@0 | 29 | : fClipStack(NULL) { |
michael@0 | 30 | fOrigin.setZero(); |
michael@0 | 31 | } |
michael@0 | 32 | |
michael@0 | 33 | bool operator==(const GrClipData& other) const { |
michael@0 | 34 | if (fOrigin != other.fOrigin) { |
michael@0 | 35 | return false; |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | if (NULL != fClipStack && NULL != other.fClipStack) { |
michael@0 | 39 | return *fClipStack == *other.fClipStack; |
michael@0 | 40 | } |
michael@0 | 41 | |
michael@0 | 42 | return fClipStack == other.fClipStack; |
michael@0 | 43 | } |
michael@0 | 44 | |
michael@0 | 45 | bool operator!=(const GrClipData& other) const { |
michael@0 | 46 | return !(*this == other); |
michael@0 | 47 | } |
michael@0 | 48 | |
michael@0 | 49 | void getConservativeBounds(const GrSurface* surface, |
michael@0 | 50 | SkIRect* devResult, |
michael@0 | 51 | bool* isIntersectionOfRects = NULL) const; |
michael@0 | 52 | }; |
michael@0 | 53 | |
michael@0 | 54 | #endif |