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 function g(n) {
3 var s;
4 switch (n) {
5 case 0:
6 s = "c"+n;
7 break;
9 default:
10 s = "d"+n;
11 break;
12 }
13 return s;
14 }
16 // Do it twice with different initial values for 'i' to allow for 8
17 // being even or odd.
19 var s = "";
20 for (let i = 0; i != 30; i+=2) {
21 s += g(i%4/2);
22 }
23 assertEq(s, "c0d1c0d1c0d1c0d1c0d1c0d1c0d1c0");
25 var s = "";
26 for (let i = 2; i != 30; i+=2) {
27 s += g(i%4/2);
28 }
29 assertEq(s, "d1c0d1c0d1c0d1c0d1c0d1c0d1c0");