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 2010 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 | #ifndef SkJpegUtility_DEFINED |
michael@0 | 11 | #define SkJpegUtility_DEFINED |
michael@0 | 12 | |
michael@0 | 13 | #include "SkImageDecoder.h" |
michael@0 | 14 | #include "SkStream.h" |
michael@0 | 15 | |
michael@0 | 16 | extern "C" { |
michael@0 | 17 | #include "jpeglib.h" |
michael@0 | 18 | #include "jerror.h" |
michael@0 | 19 | } |
michael@0 | 20 | |
michael@0 | 21 | #include <setjmp.h> |
michael@0 | 22 | |
michael@0 | 23 | /* Our error-handling struct. |
michael@0 | 24 | * |
michael@0 | 25 | */ |
michael@0 | 26 | struct skjpeg_error_mgr : jpeg_error_mgr { |
michael@0 | 27 | jmp_buf fJmpBuf; |
michael@0 | 28 | }; |
michael@0 | 29 | |
michael@0 | 30 | |
michael@0 | 31 | void skjpeg_error_exit(j_common_ptr cinfo); |
michael@0 | 32 | |
michael@0 | 33 | /////////////////////////////////////////////////////////////////////////// |
michael@0 | 34 | /* Our source struct for directing jpeg to our stream object. |
michael@0 | 35 | */ |
michael@0 | 36 | struct skjpeg_source_mgr : jpeg_source_mgr { |
michael@0 | 37 | skjpeg_source_mgr(SkStream* stream, SkImageDecoder* decoder); |
michael@0 | 38 | ~skjpeg_source_mgr(); |
michael@0 | 39 | |
michael@0 | 40 | // fStream is ref'ed and unref'ed |
michael@0 | 41 | SkStream* fStream; |
michael@0 | 42 | // Unowned pointer to the decoder, used to check if the decoding process |
michael@0 | 43 | // has been cancelled. |
michael@0 | 44 | SkImageDecoder* fDecoder; |
michael@0 | 45 | enum { |
michael@0 | 46 | kBufferSize = 1024 |
michael@0 | 47 | }; |
michael@0 | 48 | char fBuffer[kBufferSize]; |
michael@0 | 49 | }; |
michael@0 | 50 | |
michael@0 | 51 | ///////////////////////////////////////////////////////////////////////////// |
michael@0 | 52 | /* Our destination struct for directing decompressed pixels to our stream |
michael@0 | 53 | * object. |
michael@0 | 54 | */ |
michael@0 | 55 | struct skjpeg_destination_mgr : jpeg_destination_mgr { |
michael@0 | 56 | skjpeg_destination_mgr(SkWStream* stream); |
michael@0 | 57 | |
michael@0 | 58 | SkWStream* fStream; |
michael@0 | 59 | |
michael@0 | 60 | enum { |
michael@0 | 61 | kBufferSize = 1024 |
michael@0 | 62 | }; |
michael@0 | 63 | uint8_t fBuffer[kBufferSize]; |
michael@0 | 64 | }; |
michael@0 | 65 | |
michael@0 | 66 | #endif |