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 afd6ca669c
commit c703f8c144
5 changed files with 7 additions and 11 deletions

View File

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

View File

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

View File

@ -87,9 +87,9 @@ public:
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;

View File

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

View File

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