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 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 * vim: set ts=8 sts=4 et sw=4 tw=99:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef jit_AsmJSSignalHandlers_h
8 #define jit_AsmJSSignalHandlers_h
10 struct JSRuntime;
12 #ifdef XP_MACOSX
13 # include <mach/mach.h>
14 # include "jslock.h"
15 #endif
17 namespace js {
19 // Returns whether signal handlers for asm.js and for JitRuntime access
20 // violations have been installed.
21 bool
22 EnsureAsmJSSignalHandlersInstalled(JSRuntime *rt);
24 // Force any currently-executing asm.js code to call
25 // js::HandleExecutionInterrupt.
26 extern void
27 RequestInterruptForAsmJSCode(JSRuntime *rt);
29 // On OSX we are forced to use the lower-level Mach exception mechanism instead
30 // of Unix signals. Mach exceptions are not handled on the victim's stack but
31 // rather require an extra thread. For simplicity, we create one such thread
32 // per JSRuntime (upon the first use of asm.js in the JSRuntime). This thread
33 // and related resources are owned by AsmJSMachExceptionHandler which is owned
34 // by JSRuntime.
35 #ifdef XP_MACOSX
36 class AsmJSMachExceptionHandler
37 {
38 bool installed_;
39 PRThread *thread_;
40 mach_port_t port_;
42 void uninstall();
44 public:
45 AsmJSMachExceptionHandler();
46 ~AsmJSMachExceptionHandler() { uninstall(); }
47 mach_port_t port() const { return port_; }
48 bool installed() const { return installed_; }
49 bool install(JSRuntime *rt);
50 };
51 #endif
53 } // namespace js
55 #endif // jit_AsmJSSignalHandlers_h