Bug 1187791 - Part 1 of 1 - SpeechRecognition::maxAlternatives can't throw; so, rm webidl throws specifier. r=smaug

This commit is contained in:
Kelly Davis 2015-08-04 00:39:00 +02:00
parent 2d545a0f85
commit c8b6f5100e
5 changed files with 7 additions and 11 deletions

View File

@ -54,8 +54,7 @@ public:
SpeechRecognitionResultList* resultList = SpeechRecognitionResultList* resultList =
new SpeechRecognitionResultList(mRecognition); new SpeechRecognitionResultList(mRecognition);
SpeechRecognitionResult* result = new SpeechRecognitionResult(mRecognition); SpeechRecognitionResult* result = new SpeechRecognitionResult(mRecognition);
ErrorResult rv; if (0 < mRecognition->MaxAlternatives()) {
if (0 < mRecognition->GetMaxAlternatives(rv)) { // GetMaxAlternatives can't fail
SpeechRecognitionAlternative* alternative = SpeechRecognitionAlternative* alternative =
new SpeechRecognitionAlternative(mRecognition); new SpeechRecognitionAlternative(mRecognition);
@ -331,8 +330,7 @@ PocketSphinxSpeechRecognitionService::BuildMockResultList()
SpeechRecognitionResultList* resultList = SpeechRecognitionResultList* resultList =
new SpeechRecognitionResultList(mRecognition); new SpeechRecognitionResultList(mRecognition);
SpeechRecognitionResult* result = new SpeechRecognitionResult(mRecognition); SpeechRecognitionResult* result = new SpeechRecognitionResult(mRecognition);
ErrorResult rv; if (0 < mRecognition->MaxAlternatives()) {
if (0 < mRecognition->GetMaxAlternatives(rv)) { // GetMaxAlternatives can't fail
SpeechRecognitionAlternative* alternative = SpeechRecognitionAlternative* alternative =
new SpeechRecognitionAlternative(mRecognition); new SpeechRecognitionAlternative(mRecognition);

View File

@ -684,13 +684,13 @@ SpeechRecognition::SetInterimResults(bool aArg)
} }
uint32_t uint32_t
SpeechRecognition::GetMaxAlternatives(ErrorResult& aRv) const SpeechRecognition::MaxAlternatives() const
{ {
return mMaxAlternatives; return mMaxAlternatives;
} }
void void
SpeechRecognition::SetMaxAlternatives(uint32_t aArg, ErrorResult& aRv) SpeechRecognition::SetMaxAlternatives(uint32_t aArg)
{ {
mMaxAlternatives = aArg; mMaxAlternatives = aArg;
return; return;

View File

@ -87,9 +87,9 @@ public:
void SetInterimResults(bool aArg); void SetInterimResults(bool aArg);
uint32_t GetMaxAlternatives(ErrorResult& aRv) const; uint32_t MaxAlternatives() const;
void SetMaxAlternatives(uint32_t aArg, ErrorResult& aRv); void SetMaxAlternatives(uint32_t aArg);
void GetServiceURI(nsString& aRetVal, ErrorResult& aRv) const; void GetServiceURI(nsString& aRetVal, ErrorResult& aRv) const;

View File

@ -102,8 +102,7 @@ FakeSpeechRecognitionService::BuildMockResultList()
{ {
SpeechRecognitionResultList* resultList = new SpeechRecognitionResultList(mRecognition); SpeechRecognitionResultList* resultList = new SpeechRecognitionResultList(mRecognition);
SpeechRecognitionResult* result = new SpeechRecognitionResult(mRecognition); SpeechRecognitionResult* result = new SpeechRecognitionResult(mRecognition);
ErrorResult rv; if (0 < mRecognition->MaxAlternatives()) {
if (0 < mRecognition->GetMaxAlternatives(rv)) { // GetMaxAlternatives can't fail
SpeechRecognitionAlternative* alternative = new SpeechRecognitionAlternative(mRecognition); SpeechRecognitionAlternative* alternative = new SpeechRecognitionAlternative(mRecognition);
alternative->mTranscript = NS_LITERAL_STRING("Mock final result"); alternative->mTranscript = NS_LITERAL_STRING("Mock final result");

View File

@ -20,7 +20,6 @@ interface SpeechRecognition : EventTarget {
[Throws] [Throws]
attribute boolean continuous; attribute boolean continuous;
attribute boolean interimResults; attribute boolean interimResults;
[Throws]
attribute unsigned long maxAlternatives; attribute unsigned long maxAlternatives;
[Throws] [Throws]
attribute DOMString serviceURI; attribute DOMString serviceURI;