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 | #include "SkPathEffect.h" |
michael@0 | 10 | #include "SkPath.h" |
michael@0 | 11 | #include "SkReadBuffer.h" |
michael@0 | 12 | #include "SkWriteBuffer.h" |
michael@0 | 13 | |
michael@0 | 14 | /////////////////////////////////////////////////////////////////////////////// |
michael@0 | 15 | |
michael@0 | 16 | void SkPathEffect::computeFastBounds(SkRect* dst, const SkRect& src) const { |
michael@0 | 17 | *dst = src; |
michael@0 | 18 | } |
michael@0 | 19 | |
michael@0 | 20 | bool SkPathEffect::asPoints(PointData* results, const SkPath& src, |
michael@0 | 21 | const SkStrokeRec&, const SkMatrix&, const SkRect*) const { |
michael@0 | 22 | return false; |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | /////////////////////////////////////////////////////////////////////////////// |
michael@0 | 26 | |
michael@0 | 27 | SkPairPathEffect::SkPairPathEffect(SkPathEffect* pe0, SkPathEffect* pe1) |
michael@0 | 28 | : fPE0(pe0), fPE1(pe1) { |
michael@0 | 29 | SkASSERT(pe0); |
michael@0 | 30 | SkASSERT(pe1); |
michael@0 | 31 | fPE0->ref(); |
michael@0 | 32 | fPE1->ref(); |
michael@0 | 33 | } |
michael@0 | 34 | |
michael@0 | 35 | SkPairPathEffect::~SkPairPathEffect() { |
michael@0 | 36 | SkSafeUnref(fPE0); |
michael@0 | 37 | SkSafeUnref(fPE1); |
michael@0 | 38 | } |
michael@0 | 39 | |
michael@0 | 40 | /* |
michael@0 | 41 | Format: [oe0-factory][pe1-factory][pe0-size][pe0-data][pe1-data] |
michael@0 | 42 | */ |
michael@0 | 43 | void SkPairPathEffect::flatten(SkWriteBuffer& buffer) const { |
michael@0 | 44 | this->INHERITED::flatten(buffer); |
michael@0 | 45 | buffer.writeFlattenable(fPE0); |
michael@0 | 46 | buffer.writeFlattenable(fPE1); |
michael@0 | 47 | } |
michael@0 | 48 | |
michael@0 | 49 | SkPairPathEffect::SkPairPathEffect(SkReadBuffer& buffer) { |
michael@0 | 50 | fPE0 = buffer.readPathEffect(); |
michael@0 | 51 | fPE1 = buffer.readPathEffect(); |
michael@0 | 52 | // either of these may fail, so we have to check for nulls later on |
michael@0 | 53 | } |
michael@0 | 54 | |
michael@0 | 55 | /////////////////////////////////////////////////////////////////////////////// |
michael@0 | 56 | |
michael@0 | 57 | bool SkComposePathEffect::filterPath(SkPath* dst, const SkPath& src, |
michael@0 | 58 | SkStrokeRec* rec, const SkRect* cullRect) const { |
michael@0 | 59 | // we may have failed to unflatten these, so we have to check |
michael@0 | 60 | if (!fPE0 || !fPE1) { |
michael@0 | 61 | return false; |
michael@0 | 62 | } |
michael@0 | 63 | |
michael@0 | 64 | SkPath tmp; |
michael@0 | 65 | const SkPath* ptr = &src; |
michael@0 | 66 | |
michael@0 | 67 | if (fPE1->filterPath(&tmp, src, rec, cullRect)) { |
michael@0 | 68 | ptr = &tmp; |
michael@0 | 69 | } |
michael@0 | 70 | return fPE0->filterPath(dst, *ptr, rec, cullRect); |
michael@0 | 71 | } |
michael@0 | 72 | |
michael@0 | 73 | /////////////////////////////////////////////////////////////////////////////// |
michael@0 | 74 | |
michael@0 | 75 | bool SkSumPathEffect::filterPath(SkPath* dst, const SkPath& src, |
michael@0 | 76 | SkStrokeRec* rec, const SkRect* cullRect) const { |
michael@0 | 77 | // use bit-or so that we always call both, even if the first one succeeds |
michael@0 | 78 | return fPE0->filterPath(dst, src, rec, cullRect) | |
michael@0 | 79 | fPE1->filterPath(dst, src, rec, cullRect); |
michael@0 | 80 | } |