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 | #include "SkPathOpsBounds.h" |
michael@0 | 8 | #include "SkPathOpsCubic.h" |
michael@0 | 9 | #include "SkPathOpsLine.h" |
michael@0 | 10 | #include "SkPathOpsQuad.h" |
michael@0 | 11 | |
michael@0 | 12 | void SkPathOpsBounds::setCubicBounds(const SkPoint a[4]) { |
michael@0 | 13 | SkDCubic cubic; |
michael@0 | 14 | cubic.set(a); |
michael@0 | 15 | SkDRect dRect; |
michael@0 | 16 | dRect.setBounds(cubic); |
michael@0 | 17 | set(SkDoubleToScalar(dRect.fLeft), SkDoubleToScalar(dRect.fTop), |
michael@0 | 18 | SkDoubleToScalar(dRect.fRight), SkDoubleToScalar(dRect.fBottom)); |
michael@0 | 19 | } |
michael@0 | 20 | |
michael@0 | 21 | void SkPathOpsBounds::setLineBounds(const SkPoint a[2]) { |
michael@0 | 22 | setPointBounds(a[0]); |
michael@0 | 23 | add(a[1]); |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | void SkPathOpsBounds::setQuadBounds(const SkPoint a[3]) { |
michael@0 | 27 | SkDQuad quad; |
michael@0 | 28 | quad.set(a); |
michael@0 | 29 | SkDRect dRect; |
michael@0 | 30 | dRect.setBounds(quad); |
michael@0 | 31 | set(SkDoubleToScalar(dRect.fLeft), SkDoubleToScalar(dRect.fTop), |
michael@0 | 32 | SkDoubleToScalar(dRect.fRight), SkDoubleToScalar(dRect.fBottom)); |
michael@0 | 33 | } |
michael@0 | 34 | |
michael@0 | 35 | void (SkPathOpsBounds::*SetCurveBounds[])(const SkPoint[]) = { |
michael@0 | 36 | NULL, |
michael@0 | 37 | &SkPathOpsBounds::setLineBounds, |
michael@0 | 38 | &SkPathOpsBounds::setQuadBounds, |
michael@0 | 39 | &SkPathOpsBounds::setCubicBounds |
michael@0 | 40 | }; |