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.
2 /*
3 * Copyright 2010 The Android Open Source Project
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
10 #ifndef SkJpegUtility_DEFINED
11 #define SkJpegUtility_DEFINED
13 #include "SkImageDecoder.h"
14 #include "SkStream.h"
16 extern "C" {
17 #include "jpeglib.h"
18 #include "jerror.h"
19 }
21 #include <setjmp.h>
23 /* Our error-handling struct.
24 *
25 */
26 struct skjpeg_error_mgr : jpeg_error_mgr {
27 jmp_buf fJmpBuf;
28 };
31 void skjpeg_error_exit(j_common_ptr cinfo);
33 ///////////////////////////////////////////////////////////////////////////
34 /* Our source struct for directing jpeg to our stream object.
35 */
36 struct skjpeg_source_mgr : jpeg_source_mgr {
37 skjpeg_source_mgr(SkStream* stream, SkImageDecoder* decoder);
38 ~skjpeg_source_mgr();
40 // fStream is ref'ed and unref'ed
41 SkStream* fStream;
42 // Unowned pointer to the decoder, used to check if the decoding process
43 // has been cancelled.
44 SkImageDecoder* fDecoder;
45 enum {
46 kBufferSize = 1024
47 };
48 char fBuffer[kBufferSize];
49 };
51 /////////////////////////////////////////////////////////////////////////////
52 /* Our destination struct for directing decompressed pixels to our stream
53 * object.
54 */
55 struct skjpeg_destination_mgr : jpeg_destination_mgr {
56 skjpeg_destination_mgr(SkWStream* stream);
58 SkWStream* fStream;
60 enum {
61 kBufferSize = 1024
62 };
63 uint8_t fBuffer[kBufferSize];
64 };
66 #endif