зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1254378 - Make new 'speech-synth-started' component service category. r=smaug
MozReview-Commit-ID: LsPDCdpUA48 --HG-- extra : rebase_source : 5ebebebb601a54959c49d9e4b87c8f96be4ff2c7
This commit is contained in:
Родитель
1df06a0d6d
Коммит
1fd9961689
|
@ -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 }
|
||||
};
|
||||
|
||||
|
|
|
@ -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"
|
||||
%}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 }
|
||||
};
|
||||
|
||||
|
|
|
@ -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 }
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче