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

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:60b6559a9b2a
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 #include "mozilla/ModuleUtils.h"
6 #include "nsIClassInfoImpl.h"
7
8 #ifdef MOZ_WEBRTC
9
10 #include "nsPicoService.h"
11
12 using namespace mozilla::dom;
13
14 #define PICOSERVICE_CID \
15 {0x346c4fc8, 0x12fe, 0x459c, {0x81, 0x19, 0x9a, 0xa7, 0x73, 0x37, 0x7f, 0xf4}}
16
17 #define PICOSERVICE_CONTRACTID "@mozilla.org/synthpico;1"
18
19 // Defines nsPicoServiceConstructor
20 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsPicoService,
21 nsPicoService::GetInstanceForService)
22
23 // Defines kPICOSERVICE_CID
24 NS_DEFINE_NAMED_CID(PICOSERVICE_CID);
25
26 static const mozilla::Module::CIDEntry kCIDs[] = {
27 { &kPICOSERVICE_CID, true, nullptr, nsPicoServiceConstructor },
28 { nullptr }
29 };
30
31 static const mozilla::Module::ContractIDEntry kContracts[] = {
32 { PICOSERVICE_CONTRACTID, &kPICOSERVICE_CID },
33 { nullptr }
34 };
35
36 static const mozilla::Module::CategoryEntry kCategories[] = {
37 { "profile-after-change", "Pico Speech Synth", PICOSERVICE_CONTRACTID },
38 { nullptr }
39 };
40
41 static void
42 UnloadPicoModule()
43 {
44 nsPicoService::Shutdown();
45 }
46
47 static const mozilla::Module kModule = {
48 mozilla::Module::kVersion,
49 kCIDs,
50 kContracts,
51 kCategories,
52 nullptr,
53 nullptr,
54 UnloadPicoModule
55 };
56
57 NSMODULE_DEFN(synthpico) = &kModule;
58 #endif

mercurial