diff --git a/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerModule.cpp b/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerModule.cpp index 17370a25a345..bc80eb06e770 100644 --- a/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerModule.cpp +++ b/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerModule.cpp @@ -20,7 +20,7 @@ using namespace mozilla::dom; NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(OSXSpeechSynthesizerService, OSXSpeechSynthesizerService::GetInstanceForService) -// Defines kSAPISERVICE_CID +// Defines kOSXSERVICE_CID NS_DEFINE_NAMED_CID(OSXSPEECHSYNTHESIZERSERVICE_CID); static const mozilla::Module::CIDEntry kCIDs[] = { @@ -34,7 +34,7 @@ static const mozilla::Module::ContractIDEntry kContracts[] = { }; static const mozilla::Module::CategoryEntry kCategories[] = { - { "profile-after-change", "Sapi Speech Synth", OSXSPEECHSYNTHESIZERSERVICE_CONTRACTID }, + { "speech-synth-started", "OSX Speech Synth", OSXSPEECHSYNTHESIZERSERVICE_CONTRACTID }, { nullptr } }; diff --git a/dom/media/webspeech/synth/nsISpeechService.idl b/dom/media/webspeech/synth/nsISpeechService.idl index c802837155d0..710686f1ed80 100644 --- a/dom/media/webspeech/synth/nsISpeechService.idl +++ b/dom/media/webspeech/synth/nsISpeechService.idl @@ -165,3 +165,9 @@ interface nsISpeechService : nsISupports readonly attribute SpeechServiceType serviceType; }; + +%{C++ +// This is the service category speech services could use to start up as +// a component. +#define NS_SPEECH_SYNTH_STARTED "speech-synth-started" +%} diff --git a/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp b/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp index 59c76d158268..e36be7e78c84 100644 --- a/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp +++ b/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp @@ -7,6 +7,7 @@ #include "nsILocaleService.h" #include "nsISpeechService.h" #include "nsServiceManagerUtils.h" +#include "nsCategoryManagerUtils.h" #include "SpeechSynthesisUtterance.h" #include "SpeechSynthesisVoice.h" @@ -190,6 +191,11 @@ nsSynthVoiceRegistry::GetInstance() gSynthVoiceRegistry = new nsSynthVoiceRegistry(); Preferences::AddBoolVarCache(&sForceGlobalQueue, "media.webspeech.synth.force_global_queue"); + if (XRE_IsParentProcess()) { + // Start up all speech synth services. + NS_CreateServicesFromCategory(NS_SPEECH_SYNTH_STARTED, nullptr, + NS_SPEECH_SYNTH_STARTED); + } } return gSynthVoiceRegistry; diff --git a/dom/media/webspeech/synth/speechd/SpeechDispatcherModule.cpp b/dom/media/webspeech/synth/speechd/SpeechDispatcherModule.cpp index deed7c1d29b4..a7f7ad5352c5 100644 --- a/dom/media/webspeech/synth/speechd/SpeechDispatcherModule.cpp +++ b/dom/media/webspeech/synth/speechd/SpeechDispatcherModule.cpp @@ -33,7 +33,7 @@ static const mozilla::Module::ContractIDEntry kContracts[] = { }; static const mozilla::Module::CategoryEntry kCategories[] = { - { "profile-after-change", "SpeechDispatcher Speech Synth", SPEECHDISPATCHERSERVICE_CONTRACTID }, + { "speech-synth-started", "SpeechDispatcher Speech Synth", SPEECHDISPATCHERSERVICE_CONTRACTID }, { nullptr } }; diff --git a/dom/media/webspeech/synth/windows/SapiModule.cpp b/dom/media/webspeech/synth/windows/SapiModule.cpp index 729dabcba37a..f9d7c9a89d57 100644 --- a/dom/media/webspeech/synth/windows/SapiModule.cpp +++ b/dom/media/webspeech/synth/windows/SapiModule.cpp @@ -34,7 +34,7 @@ static const mozilla::Module::ContractIDEntry kContracts[] = { }; static const mozilla::Module::CategoryEntry kCategories[] = { - { "profile-after-change", "Sapi Speech Synth", SAPISERVICE_CONTRACTID }, + { "speech-synth-started", "Sapi Speech Synth", SAPISERVICE_CONTRACTID }, { nullptr } };