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.
michael@0 | 1 | assertEq( |
michael@0 | 2 | (function () { |
michael@0 | 3 | var arr = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, |
michael@0 | 4 | 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 ]; |
michael@0 | 5 | |
michael@0 | 6 | for (var i = 0; i < 4; ++i) { |
michael@0 | 7 | var src = i * 8; |
michael@0 | 8 | var dst = i * 8 + 7; |
michael@0 | 9 | for (var j = 0; j < 4; ++j) { |
michael@0 | 10 | [arr[dst--], arr[src++]] = [arr[src], arr[dst]]; |
michael@0 | 11 | } |
michael@0 | 12 | } |
michael@0 | 13 | return arr; |
michael@0 | 14 | })().toSource(), |
michael@0 | 15 | "[7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8, 23, 22, 21, 20, 19, 18, 17, 16, 31, 30, 29, 28, 27, 26, 25, 24, 32]"); |