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.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | "use strict"; |
michael@0 | 6 | |
michael@0 | 7 | Components.utils.import("resource://gre/modules/devtools/event-emitter.js"); |
michael@0 | 8 | |
michael@0 | 9 | const EXPORTED_SYMBOLS = ["Devices"]; |
michael@0 | 10 | |
michael@0 | 11 | let addonInstalled = false; |
michael@0 | 12 | |
michael@0 | 13 | const Devices = { |
michael@0 | 14 | _devices: {}, |
michael@0 | 15 | |
michael@0 | 16 | get helperAddonInstalled() { |
michael@0 | 17 | return addonInstalled; |
michael@0 | 18 | }, |
michael@0 | 19 | set helperAddonInstalled(v) { |
michael@0 | 20 | addonInstalled = v; |
michael@0 | 21 | this.emit("addon-status-updated", v); |
michael@0 | 22 | }, |
michael@0 | 23 | |
michael@0 | 24 | register: function (name, device) { |
michael@0 | 25 | this._devices[name] = device; |
michael@0 | 26 | this.emit("register"); |
michael@0 | 27 | }, |
michael@0 | 28 | |
michael@0 | 29 | unregister: function (name) { |
michael@0 | 30 | delete this._devices[name]; |
michael@0 | 31 | this.emit("unregister"); |
michael@0 | 32 | }, |
michael@0 | 33 | |
michael@0 | 34 | available: function () { |
michael@0 | 35 | return Object.keys(this._devices).sort(); |
michael@0 | 36 | }, |
michael@0 | 37 | |
michael@0 | 38 | getByName: function (name) { |
michael@0 | 39 | return this._devices[name]; |
michael@0 | 40 | } |
michael@0 | 41 | }; |
michael@0 | 42 | |
michael@0 | 43 | EventEmitter.decorate(Devices); |