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.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsUnicodeToEUCTW.h"
7 #include "nsUCvTW2Dll.h"
8 #include "nsUCConstructors.h"
10 //----------------------------------------------------------------------
11 // Global functions and data [declaration]
13 //----------------------------------------------------------------------
14 // Class nsUnicodeToEUCTW [implementation]
16 nsresult
17 nsUnicodeToEUCTWConstructor(nsISupports *aOuter, REFNSIID aIID,
18 void **aResult)
19 {
20 static const uScanClassID g_EUCTWScanClassSet [] = {
21 u1ByteCharset,
22 u2BytesGRCharset,
23 u2BytesGRPrefix8EA2Charset,
24 u2BytesGRPrefix8EA3Charset,
25 u2BytesGRPrefix8EA4Charset,
26 u2BytesGRPrefix8EA5Charset,
27 u2BytesGRPrefix8EA6Charset,
28 u2BytesGRPrefix8EA7Charset
29 };
31 static const uint16_t *g_EUCTWMappingTableSet [] ={
32 g_ASCIIMappingTable,
33 g_ufCNS1MappingTable,
34 g_ufCNS2MappingTable,
35 g_ufCNS3MappingTable,
36 g_ufCNS4MappingTable,
37 g_ufCNS5MappingTable,
38 g_ufCNS6MappingTable,
39 g_ufCNS7MappingTable
40 };
42 return CreateMultiTableEncoder(8,
43 (uScanClassID*) &g_EUCTWScanClassSet,
44 (uMappingTable**) &g_EUCTWMappingTableSet,
45 4 /* max length = src * 4 */,
46 aOuter, aIID, aResult);
47 }