Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
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 | #include "nsISupports.idl" |
michael@0 | 6 | |
michael@0 | 7 | interface nsIDOMWindow; |
michael@0 | 8 | |
michael@0 | 9 | [scriptable, uuid(1B406E32-CF42-471E-A470-6FD600BF4C7B)] |
michael@0 | 10 | interface nsIDeviceSensorData : nsISupports |
michael@0 | 11 | { |
michael@0 | 12 | // Keep in sync with hal/HalSensor.h |
michael@0 | 13 | const unsigned long TYPE_ORIENTATION = 0; |
michael@0 | 14 | const unsigned long TYPE_ACCELERATION = 1; |
michael@0 | 15 | const unsigned long TYPE_PROXIMITY = 2; |
michael@0 | 16 | const unsigned long TYPE_LINEAR_ACCELERATION = 3; |
michael@0 | 17 | const unsigned long TYPE_GYROSCOPE = 4; |
michael@0 | 18 | const unsigned long TYPE_LIGHT = 5; |
michael@0 | 19 | |
michael@0 | 20 | readonly attribute unsigned long type; |
michael@0 | 21 | |
michael@0 | 22 | readonly attribute double x; |
michael@0 | 23 | readonly attribute double y; |
michael@0 | 24 | readonly attribute double z; |
michael@0 | 25 | }; |
michael@0 | 26 | |
michael@0 | 27 | [scriptable, uuid(e46e47c7-55ff-44c4-abce-21b14ba07f86)] |
michael@0 | 28 | interface nsIDeviceSensors : nsISupports |
michael@0 | 29 | { |
michael@0 | 30 | /** |
michael@0 | 31 | * Returns true if the given window has any listeners of the given type |
michael@0 | 32 | */ |
michael@0 | 33 | bool hasWindowListener(in unsigned long aType, in nsIDOMWindow aWindow); |
michael@0 | 34 | |
michael@0 | 35 | // Holds pointers, not AddRef objects -- it is up to the caller |
michael@0 | 36 | // to call RemoveWindowListener before the window is deleted. |
michael@0 | 37 | |
michael@0 | 38 | [noscript] void addWindowListener(in unsigned long aType, in nsIDOMWindow aWindow); |
michael@0 | 39 | [noscript] void removeWindowListener(in unsigned long aType, in nsIDOMWindow aWindow); |
michael@0 | 40 | [noscript] void removeWindowAsListener(in nsIDOMWindow aWindow); |
michael@0 | 41 | }; |
michael@0 | 42 | |
michael@0 | 43 | %{C++ |
michael@0 | 44 | |
michael@0 | 45 | #define NS_DEVICE_SENSORS_CID \ |
michael@0 | 46 | { 0xecba5203, 0x77da, 0x465a, \ |
michael@0 | 47 | { 0x86, 0x5e, 0x78, 0xb7, 0xaf, 0x10, 0xd8, 0xf7 } } |
michael@0 | 48 | |
michael@0 | 49 | #define NS_DEVICE_SENSORS_CONTRACTID "@mozilla.org/devicesensors;1" |
michael@0 | 50 | |
michael@0 | 51 | %} |