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 // Bug 689101 - if the binary layout of jsval does not match between C and C++
2 // code, then calls to functions returning jsval may get compiled differently
3 // than the callee, resulting in parameters being shifted over by one.
4 //
5 // An example is where on Windows, calling jsdValue.getWrappedValue() will
6 // return a random floating point number instead of an object.
7 //
8 // This test must be run with debugging already enabled
10 function run_test() {
11 const Cc = Components.classes;
12 const Ci = Components.interfaces;
13 const DebuggerService = Cc["@mozilla.org/js/jsd/debugger-service;1"];
14 const jsdIDebuggerService = Ci.jsdIDebuggerService;
15 var jsd = DebuggerService.getService(jsdIDebuggerService);
17 do_check_true(jsd.isOn);
19 var n = 0;
20 function f() {
21 n++;
22 }
24 jsd.enumerateScripts({ enumerateScript: function(script) {
25 script.setBreakpoint(0);
26 } });
28 jsd.breakpointHook = function(frame, type, dummy) {
29 var scope = frame.scope;
30 var parent = scope.jsParent; // Probably does not need to be called
31 var wrapped = scope.getWrappedValue();
32 // Do not try to print 'wrapped'; it may be an internal Call object
33 // that will crash when you toString it. Different bug.
34 do_check_eq(typeof(wrapped), "object");
35 return Ci.jsdIExecutionHook.RETURN_CONTINUE;
36 };
38 f();
40 jsd.breakpointHook = null;
41 jsd = null;
42 }