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 var v = [ -0x80000003, -0x80000002, -0x80000001, -0x80000000, -0x7fffffff, -0x7ffffffe, -0x7ffffffd,
2 -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
3 10, 11, 20, 21, 100, 101, 110, 111, 500,
4 0x7ffffffd, 0x7ffffffe, 0x7fffffff, 0x80000000, 0x80000001, 0x80000002, 0x80000003];
6 function strcmp(x, y) {
7 return Number(String(x) > String(y))
8 }
10 for (var i = 0; i < v.length; ++i) {
11 for (var j = 0; j < v.length; ++j) {
12 var builtin = String([v[i], v[j]].sort());
13 var manual = String([v[i], v[j]].sort(strcmp));
14 assertEq(builtin, manual);
15 }
16 }