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 globalinc = 0;
2 function testincops(n) {
3 var i = 0, o = {p:0}, a = [0];
4 n = 100;
6 for (i = 0; i < n; i++);
7 while (i-- > 0);
8 for (i = 0; i < n; ++i);
9 while (--i >= 0);
11 for (o.p = 0; o.p < n; o.p++) globalinc++;
12 while (o.p-- > 0) --globalinc;
13 for (o.p = 0; o.p < n; ++o.p) ++globalinc;
14 while (--o.p >= 0) globalinc--;
16 ++i; // set to 0
17 for (a[i] = 0; a[i] < n; a[i]++);
18 while (a[i]-- > 0);
19 for (a[i] = 0; a[i] < n; ++a[i]);
20 while (--a[i] >= 0);
22 return [++o.p, ++a[i], globalinc].toString();
23 }
24 assertEq(testincops(), "0,0,0");