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 | * |
michael@0 | 4 | * Copyright (C) 1998-2011, International Business Machines |
michael@0 | 5 | * Corporation and others. All Rights Reserved. |
michael@0 | 6 | * |
michael@0 | 7 | ******************************************************************************* |
michael@0 | 8 | * |
michael@0 | 9 | * File error.c |
michael@0 | 10 | * |
michael@0 | 11 | * Modification History: |
michael@0 | 12 | * |
michael@0 | 13 | * Date Name Description |
michael@0 | 14 | * 05/28/99 stephen Creation. |
michael@0 | 15 | ******************************************************************************* |
michael@0 | 16 | */ |
michael@0 | 17 | |
michael@0 | 18 | #include <stdarg.h> |
michael@0 | 19 | #include <stdio.h> |
michael@0 | 20 | #include "cstring.h" |
michael@0 | 21 | #include "errmsg.h" |
michael@0 | 22 | |
michael@0 | 23 | U_CFUNC void error(uint32_t linenumber, const char *msg, ...) |
michael@0 | 24 | { |
michael@0 | 25 | va_list va; |
michael@0 | 26 | |
michael@0 | 27 | va_start(va, msg); |
michael@0 | 28 | fprintf(stderr, "%s:%u: ", gCurrentFileName, (int)linenumber); |
michael@0 | 29 | vfprintf(stderr, msg, va); |
michael@0 | 30 | fprintf(stderr, "\n"); |
michael@0 | 31 | va_end(va); |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | static UBool gShowWarning = TRUE; |
michael@0 | 35 | |
michael@0 | 36 | U_CFUNC void setShowWarning(UBool val) |
michael@0 | 37 | { |
michael@0 | 38 | gShowWarning = val; |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | U_CFUNC UBool getShowWarning(){ |
michael@0 | 42 | return gShowWarning; |
michael@0 | 43 | } |
michael@0 | 44 | |
michael@0 | 45 | static UBool gStrict =FALSE; |
michael@0 | 46 | U_CFUNC UBool isStrict(){ |
michael@0 | 47 | return gStrict; |
michael@0 | 48 | } |
michael@0 | 49 | U_CFUNC void setStrict(UBool val){ |
michael@0 | 50 | gStrict = val; |
michael@0 | 51 | } |
michael@0 | 52 | static UBool gVerbose =FALSE; |
michael@0 | 53 | U_CFUNC UBool isVerbose(){ |
michael@0 | 54 | return gVerbose; |
michael@0 | 55 | } |
michael@0 | 56 | U_CFUNC void setVerbose(UBool val){ |
michael@0 | 57 | gVerbose = val; |
michael@0 | 58 | } |
michael@0 | 59 | U_CFUNC void warning(uint32_t linenumber, const char *msg, ...) |
michael@0 | 60 | { |
michael@0 | 61 | if (gShowWarning) |
michael@0 | 62 | { |
michael@0 | 63 | va_list va; |
michael@0 | 64 | |
michael@0 | 65 | va_start(va, msg); |
michael@0 | 66 | fprintf(stderr, "%s:%u: warning: ", gCurrentFileName, (int)linenumber); |
michael@0 | 67 | vfprintf(stderr, msg, va); |
michael@0 | 68 | fprintf(stderr, "\n"); |
michael@0 | 69 | va_end(va); |
michael@0 | 70 | } |
michael@0 | 71 | } |