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 obj = {firstAttr: 'value', secondAttr: 'another value', thirdAttr: 'the last value'};
3 (function() {
4 for (var i = 0; i < 64; ++i) {
5 var name;
6 switch (~~(i / 4) % 3) {
7 case 0: name = 'firstAttr'; break;
8 case 1: name = 'secondAttr'; break;
9 case 2: name = 'thirdAttr'; break;
10 }
12 var result = obj[name];
14 switch (name) {
15 case 'firstAttr': assertEq(result, 'value'); break;
16 case 'secondAttr': assertEq(result, 'another value'); break;
17 case 'thirdAttr': assertEq(result, 'the last value'); break;
18 }
19 }
20 })();
22 /* Rotate lookup between three ids. */