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 // Debugger.prototype.makeGlobalObjectReference returns a D.O for a global
2 // without adding it as a debuggee.
4 let g1 = newGlobal();
5 let dbg = new Debugger;
6 assertEq(dbg.hasDebuggee(g1), false);
8 let g1w = dbg.makeGlobalObjectReference(g1);
9 assertEq(dbg.hasDebuggee(g1), false);
10 assertEq(g1w.unsafeDereference(), g1);
11 assertEq(g1w, g1w.makeDebuggeeValue(g1));
13 assertEq(dbg.addDebuggee(g1w), g1w);
14 assertEq(dbg.hasDebuggee(g1), true);
15 assertEq(dbg.hasDebuggee(g1w), true);
16 assertEq(g1w.unsafeDereference(), g1);
17 assertEq(g1w, g1w.makeDebuggeeValue(g1));
19 // makeGlobalObjectReference dereferences CCWs.
20 let g2 = newGlobal();
21 g2.g1 = g1;
22 let g2w = dbg.addDebuggee(g2);
23 let g2g1w = g2w.getOwnPropertyDescriptor('g1').value;
24 assertEq(g2g1w !== g1w, true);
25 assertEq(g2g1w.unwrap(), g1w);
26 assertEq(dbg.makeGlobalObjectReference(g2g1w), g1w);