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 /*
3 * Any copyright is dedicated to the Public Domain.
4 * http://creativecommons.org/licenses/publicdomain/
5 * Contributor: Robert Sayre
6 */
8 //-----------------------------------------------------------------------------
9 var BUGNUMBER = 455380;
10 var summary = 'Do not assert with JIT: !lhs->isQuad() && !rhs->isQuad()';
11 var actual = 'No Crash';
12 var expect = 'No Crash';
14 printBugNumber(BUGNUMBER);
15 printStatus (summary);
17 jit(true);
19 const IS_TOKEN_ARRAY =
20 [0, 0, 0, 0, 0, 0, 0, 0, // 0
21 0, 0, 0, 0, 0, 0, 0, 0, // 8
22 0, 0, 0, 0, 0, 0, 0, 0, // 16
23 0, 0, 0, 0, 0, 0, 0, 0, // 24
25 0, 1, 0, 1, 1, 1, 1, 1, // 32
26 0, 0, 1, 1, 0, 1, 1, 0, // 40
27 1, 1, 1, 1, 1, 1, 1, 1, // 48
28 1, 1, 0, 0, 0, 0, 0, 0, // 56
30 0, 1, 1, 1, 1, 1, 1, 1, // 64
31 1, 1, 1, 1, 1, 1, 1, 1, // 72
32 1, 1, 1, 1, 1, 1, 1, 1, // 80
33 1, 1, 1, 0, 0, 0, 1, 1, // 88
35 1, 1, 1, 1, 1, 1, 1, 1, // 96
36 1, 1, 1, 1, 1, 1, 1, 1, // 104
37 1, 1, 1, 1, 1, 1, 1, 1, // 112
38 1, 1, 1, 0, 1, 0, 1]; // 120
40 const headerUtils = {
41 normalizeFieldName: function(fieldName)
42 {
43 if (fieldName == "")
44 throw "error: empty string";
46 for (var i = 0, sz = fieldName.length; i < sz; i++)
47 {
48 if (!IS_TOKEN_ARRAY[fieldName.charCodeAt(i)])
49 {
50 throw (fieldName + " is not a valid header field name!");
51 }
52 }
54 return fieldName.toLowerCase();
55 }
56 };
58 headerUtils.normalizeFieldName("Host");
60 jit(false);
62 reportCompare(expect, actual, summary);