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 | |
michael@0 | 10 | #include "SkTypes.h" |
michael@0 | 11 | |
michael@0 | 12 | #ifdef SK_DEBUG |
michael@0 | 13 | |
michael@0 | 14 | int8_t SkToS8(intmax_t x) { |
michael@0 | 15 | SkASSERT((int8_t)x == x); |
michael@0 | 16 | return (int8_t)x; |
michael@0 | 17 | } |
michael@0 | 18 | |
michael@0 | 19 | uint8_t SkToU8(uintmax_t x) { |
michael@0 | 20 | SkASSERT((uint8_t)x == x); |
michael@0 | 21 | return (uint8_t)x; |
michael@0 | 22 | } |
michael@0 | 23 | |
michael@0 | 24 | int16_t SkToS16(intmax_t x) { |
michael@0 | 25 | SkASSERT((int16_t)x == x); |
michael@0 | 26 | return (int16_t)x; |
michael@0 | 27 | } |
michael@0 | 28 | |
michael@0 | 29 | uint16_t SkToU16(uintmax_t x) { |
michael@0 | 30 | SkASSERT((uint16_t)x == x); |
michael@0 | 31 | return (uint16_t)x; |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | int32_t SkToS32(intmax_t x) { |
michael@0 | 35 | SkASSERT((int32_t)x == x); |
michael@0 | 36 | return (int32_t)x; |
michael@0 | 37 | } |
michael@0 | 38 | |
michael@0 | 39 | uint32_t SkToU32(uintmax_t x) { |
michael@0 | 40 | SkASSERT((uint32_t)x == x); |
michael@0 | 41 | return (uint32_t)x; |
michael@0 | 42 | } |
michael@0 | 43 | |
michael@0 | 44 | int SkToInt(intmax_t x) { |
michael@0 | 45 | SkASSERT((int)x == x); |
michael@0 | 46 | return (int)x; |
michael@0 | 47 | } |
michael@0 | 48 | |
michael@0 | 49 | unsigned SkToUInt(uintmax_t x) { |
michael@0 | 50 | SkASSERT((unsigned)x == x); |
michael@0 | 51 | return (unsigned)x; |
michael@0 | 52 | } |
michael@0 | 53 | |
michael@0 | 54 | size_t SkToSizeT(uintmax_t x) { |
michael@0 | 55 | SkASSERT((size_t)x == x); |
michael@0 | 56 | return (size_t)x; |
michael@0 | 57 | } |
michael@0 | 58 | |
michael@0 | 59 | #endif |