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 2012 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 | #ifndef SkPathOpsLine_DEFINED |
michael@0 | 8 | #define SkPathOpsLine_DEFINED |
michael@0 | 9 | |
michael@0 | 10 | #include "SkPathOpsPoint.h" |
michael@0 | 11 | |
michael@0 | 12 | struct SkDLine { |
michael@0 | 13 | SkDPoint fPts[2]; |
michael@0 | 14 | |
michael@0 | 15 | const SkDPoint& operator[](int n) const { SkASSERT(n >= 0 && n < 2); return fPts[n]; } |
michael@0 | 16 | SkDPoint& operator[](int n) { SkASSERT(n >= 0 && n < 2); return fPts[n]; } |
michael@0 | 17 | |
michael@0 | 18 | void set(const SkPoint pts[2]) { |
michael@0 | 19 | fPts[0] = pts[0]; |
michael@0 | 20 | fPts[1] = pts[1]; |
michael@0 | 21 | } |
michael@0 | 22 | |
michael@0 | 23 | static SkDLine SubDivide(const SkPoint a[2], double t1, double t2) { |
michael@0 | 24 | SkDLine line; |
michael@0 | 25 | line.set(a); |
michael@0 | 26 | return line.subDivide(t1, t2); |
michael@0 | 27 | } |
michael@0 | 28 | |
michael@0 | 29 | double exactPoint(const SkDPoint& xy) const; |
michael@0 | 30 | static double ExactPointH(const SkDPoint& xy, double left, double right, double y); |
michael@0 | 31 | static double ExactPointV(const SkDPoint& xy, double top, double bottom, double x); |
michael@0 | 32 | double isLeft(const SkDPoint& pt) const; |
michael@0 | 33 | double nearPoint(const SkDPoint& xy) const; |
michael@0 | 34 | bool nearRay(const SkDPoint& xy) const; |
michael@0 | 35 | static double NearPointH(const SkDPoint& xy, double left, double right, double y); |
michael@0 | 36 | static double NearPointV(const SkDPoint& xy, double top, double bottom, double x); |
michael@0 | 37 | static bool NearRay(double dx1, double dy1, double dx2, double dy2); |
michael@0 | 38 | SkDPoint ptAtT(double t) const; |
michael@0 | 39 | SkDLine subDivide(double t1, double t2) const; |
michael@0 | 40 | |
michael@0 | 41 | #ifdef SK_DEBUG |
michael@0 | 42 | void dump(); |
michael@0 | 43 | #endif |
michael@0 | 44 | private: |
michael@0 | 45 | SkDVector tangent() const { return fPts[0] - fPts[1]; } |
michael@0 | 46 | }; |
michael@0 | 47 | |
michael@0 | 48 | #endif |