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 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/ */
4 this.EXPORTED_SYMBOLS = ["CrashTestUtils"];
6 this.CrashTestUtils = {
7 // These will be defined using ctypes APIs below.
8 crash: null,
9 lockDir: null,
10 dumpHasStream: null,
11 dumpHasInstructionPointerMemory: null,
13 // Constants for crash()
14 // Keep these in sync with nsTestCrasher.cpp!
15 CRASH_INVALID_POINTER_DEREF: 0,
16 CRASH_PURE_VIRTUAL_CALL: 1,
17 CRASH_RUNTIMEABORT: 2,
18 CRASH_OOM: 3,
19 CRASH_MOZ_CRASH: 4,
20 CRASH_ABORT: 5,
22 // Constants for dumpHasStream()
23 // From google_breakpad/common/minidump_format.h
24 MD_THREAD_LIST_STREAM: 3,
25 MD_MEMORY_INFO_LIST_STREAM: 16
26 };
28 // Grab APIs from the testcrasher shared library
29 Components.utils.import("resource://gre/modules/Services.jsm");
30 Components.utils.import("resource://gre/modules/ctypes.jsm");
31 let dir = Services.dirsvc.get("CurWorkD", Components.interfaces.nsILocalFile);
32 let file = dir.clone();
33 file.append(ctypes.libraryName("testcrasher"));
34 let lib = ctypes.open(file.path);
35 CrashTestUtils.crash = lib.declare("Crash",
36 ctypes.default_abi,
37 ctypes.void_t,
38 ctypes.int16_t);
39 CrashTestUtils.saveAppMemory = lib.declare("SaveAppMemory",
40 ctypes.default_abi,
41 ctypes.uint64_t);
43 CrashTestUtils.lockDir = lib.declare("LockDir",
44 ctypes.default_abi,
45 ctypes.voidptr_t, // nsILocalFile*
46 ctypes.voidptr_t); // nsISupports*
49 try {
50 CrashTestUtils.TryOverrideExceptionHandler = lib.declare("TryOverrideExceptionHandler",
51 ctypes.default_abi,
52 ctypes.void_t);
53 }
54 catch(ex) {}
56 CrashTestUtils.dumpHasStream = lib.declare("DumpHasStream",
57 ctypes.default_abi,
58 ctypes.bool,
59 ctypes.char.ptr,
60 ctypes.uint32_t);
62 CrashTestUtils.dumpHasInstructionPointerMemory =
63 lib.declare("DumpHasInstructionPointerMemory",
64 ctypes.default_abi,
65 ctypes.bool,
66 ctypes.char.ptr);
68 CrashTestUtils.dumpCheckMemory = lib.declare("DumpCheckMemory",
69 ctypes.default_abi,
70 ctypes.bool,
71 ctypes.char.ptr);