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 counter = 0;
2 function inc() { return counter++ }
3 var imp = { inc:inc };
5 function FFI1(stdlib, foreign) {
6 "use asm";
8 var inc = foreign.inc;
10 function g() {
11 return inc()|0
12 }
14 return g
15 }
17 function FFI2(stdlib, foreign) {
18 "use asm";
20 var inc=foreign.inc;
22 function g() {
23 inc()
24 }
26 return g
27 }
30 var f = FFI2(this, imp); // produces AOT-compiled version
31 f()
32 assertEq(counter, 1);
34 var f = FFI1(this, imp); // produces AOT-compiled version
36 assertEq(f(), 1);
37 assertEq(counter, 2);
38 assertEq(f(), 2);
39 assertEq(counter, 3);