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 hooks fire based on debuggees.
3 var g1 = newGlobal();
4 g1.eval("var g2 = newGlobal('same-compartment')");
5 var g2 = g1.g2;
6 g1.eval("function f() { debugger; g2.g(); }");
7 g2.eval("function g() { debugger; }");
9 var log;
10 var dbg = new Debugger;
11 dbg.onDebuggerStatement = function (frame) { log += frame.callee.name; };
13 // No debuggees: onDebuggerStatement is not called.
14 log = '';
15 g1.f();
16 assertEq(log, '');
18 // Add a debuggee and check that the handler is called.
19 var g1w = dbg.addDebuggee(g1);
20 log = '';
21 g1.f();
22 assertEq(log, 'f');
24 // Two debuggees, two onDebuggerStatement calls.
25 dbg.addDebuggee(g2);
26 log = '';
27 g1.f();
28 assertEq(log, 'fg');
30 // After a debuggee is removed, it no longer calls hooks.
31 assertEq(dbg.removeDebuggee(g1w), undefined);
32 log = '';
33 g1.f();
34 assertEq(log, 'g');