content/media/webspeech/synth/pico/PicoModule.cpp

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

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 "mozilla/ModuleUtils.h"
michael@0 6 #include "nsIClassInfoImpl.h"
michael@0 7
michael@0 8 #ifdef MOZ_WEBRTC
michael@0 9
michael@0 10 #include "nsPicoService.h"
michael@0 11
michael@0 12 using namespace mozilla::dom;
michael@0 13
michael@0 14 #define PICOSERVICE_CID \
michael@0 15 {0x346c4fc8, 0x12fe, 0x459c, {0x81, 0x19, 0x9a, 0xa7, 0x73, 0x37, 0x7f, 0xf4}}
michael@0 16
michael@0 17 #define PICOSERVICE_CONTRACTID "@mozilla.org/synthpico;1"
michael@0 18
michael@0 19 // Defines nsPicoServiceConstructor
michael@0 20 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsPicoService,
michael@0 21 nsPicoService::GetInstanceForService)
michael@0 22
michael@0 23 // Defines kPICOSERVICE_CID
michael@0 24 NS_DEFINE_NAMED_CID(PICOSERVICE_CID);
michael@0 25
michael@0 26 static const mozilla::Module::CIDEntry kCIDs[] = {
michael@0 27 { &kPICOSERVICE_CID, true, nullptr, nsPicoServiceConstructor },
michael@0 28 { nullptr }
michael@0 29 };
michael@0 30
michael@0 31 static const mozilla::Module::ContractIDEntry kContracts[] = {
michael@0 32 { PICOSERVICE_CONTRACTID, &kPICOSERVICE_CID },
michael@0 33 { nullptr }
michael@0 34 };
michael@0 35
michael@0 36 static const mozilla::Module::CategoryEntry kCategories[] = {
michael@0 37 { "profile-after-change", "Pico Speech Synth", PICOSERVICE_CONTRACTID },
michael@0 38 { nullptr }
michael@0 39 };
michael@0 40
michael@0 41 static void
michael@0 42 UnloadPicoModule()
michael@0 43 {
michael@0 44 nsPicoService::Shutdown();
michael@0 45 }
michael@0 46
michael@0 47 static const mozilla::Module kModule = {
michael@0 48 mozilla::Module::kVersion,
michael@0 49 kCIDs,
michael@0 50 kContracts,
michael@0 51 kCategories,
michael@0 52 nullptr,
michael@0 53 nullptr,
michael@0 54 UnloadPicoModule
michael@0 55 };
michael@0 56
michael@0 57 NSMODULE_DEFN(synthpico) = &kModule;
michael@0 58 #endif

mercurial