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 // Dispatching an event to a debugger must keep enough of it gc-alive to avoid
2 // crashing.
4 var g = newGlobal();
5 var hits;
7 function addDebug() {
8 // The loop is here to defeat the conservative GC. :-\
9 for (var i = 0; i < 4; i++) {
10 var dbg = new Debugger(g);
11 dbg.onDebuggerStatement = function (stack) {
12 hits++;
13 this.enabled = false;
14 this.onDebuggerStatement = undefined;
15 gc();
16 };
17 if (i > 0) {
18 dbg.enabled = false;
19 dbg.onDebuggerStatement = undefined;
20 dbg = null;
21 }
22 }
23 }
25 addDebug();
26 hits = 0;
27 g.eval("debugger;");
28 assertEq(hits, 1);