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 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsISpeechService; |
michael@0 | 9 | |
michael@0 | 10 | [scriptable, builtinclass, uuid(53dcc868-4193-4c3c-a1d9-fe5a0a6af2fb)] |
michael@0 | 11 | interface nsISynthVoiceRegistry : nsISupports |
michael@0 | 12 | { |
michael@0 | 13 | /** |
michael@0 | 14 | * Register a speech synthesis voice. |
michael@0 | 15 | * |
michael@0 | 16 | * @param aService the service that provides this voice. |
michael@0 | 17 | * @param aUri a unique identifier for this voice. |
michael@0 | 18 | * @param aName human-readable name for this voice. |
michael@0 | 19 | * @param aLang a BCP 47 language tag. |
michael@0 | 20 | * @param aLocalService true if service does not require network. |
michael@0 | 21 | */ |
michael@0 | 22 | void addVoice(in nsISpeechService aService, in DOMString aUri, |
michael@0 | 23 | in DOMString aName, in DOMString aLang, |
michael@0 | 24 | in boolean aLocalService); |
michael@0 | 25 | |
michael@0 | 26 | /** |
michael@0 | 27 | * Remove a speech synthesis voice. |
michael@0 | 28 | * |
michael@0 | 29 | * @param aService the service that was used to add the voice. |
michael@0 | 30 | * @param aUri a unique identifier of an existing voice. |
michael@0 | 31 | */ |
michael@0 | 32 | void removeVoice(in nsISpeechService aService, in DOMString aUri); |
michael@0 | 33 | |
michael@0 | 34 | /** |
michael@0 | 35 | * Set a voice as default. |
michael@0 | 36 | * |
michael@0 | 37 | * @param aUri a unique identifier of an existing voice. |
michael@0 | 38 | * @param aIsDefault true if this voice should be toggled as default. |
michael@0 | 39 | */ |
michael@0 | 40 | void setDefaultVoice(in DOMString aUri, in boolean aIsDefault); |
michael@0 | 41 | |
michael@0 | 42 | readonly attribute uint32_t voiceCount; |
michael@0 | 43 | |
michael@0 | 44 | AString getVoice(in uint32_t aIndex); |
michael@0 | 45 | |
michael@0 | 46 | bool isDefaultVoice(in DOMString aUri); |
michael@0 | 47 | |
michael@0 | 48 | bool isLocalVoice(in DOMString aUri); |
michael@0 | 49 | |
michael@0 | 50 | AString getVoiceLang(in DOMString aUri); |
michael@0 | 51 | |
michael@0 | 52 | AString getVoiceName(in DOMString aUri); |
michael@0 | 53 | }; |
michael@0 | 54 | |
michael@0 | 55 | %{C++ |
michael@0 | 56 | #define NS_SYNTHVOICEREGISTRY_CID \ |
michael@0 | 57 | { /* {7090524d-5574-4492-a77f-d8d558ced59d} */ \ |
michael@0 | 58 | 0x7090524d, \ |
michael@0 | 59 | 0x5574, \ |
michael@0 | 60 | 0x4492, \ |
michael@0 | 61 | { 0xa7, 0x7f, 0xd8, 0xd5, 0x58, 0xce, 0xd5, 0x9d } \ |
michael@0 | 62 | } |
michael@0 | 63 | |
michael@0 | 64 | #define NS_SYNTHVOICEREGISTRY_CONTRACTID \ |
michael@0 | 65 | "@mozilla.org/synth-voice-registry;1" |
michael@0 | 66 | |
michael@0 | 67 | #define NS_SYNTHVOICEREGISTRY_CLASSNAME \ |
michael@0 | 68 | "Speech Synthesis Voice Registry" |
michael@0 | 69 | |
michael@0 | 70 | %} |