Bug 1187791 - Part 1 of 1 - SpeechRecognition::maxAlternatives can't throw; so, rm webidl throws specifier. r=smaug
authorKelly Davis <kdavis@mozilla.com>
Tue, 04 Aug 2015 00:39:00 +0200
changeset 287749 c0aa604ac8a77017df1a0279d9c0348be56d0faf
parent 287748 3891407491fba1b72fed57fb8b32533add97b297
child 287750 2053b3d500ab9cd913a2d34ba152337dc49dd117
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1187791
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1187791 - Part 1 of 1 - SpeechRecognition::maxAlternatives can't throw; so, rm webidl throws specifier. r=smaug
dom/media/webspeech/recognition/PocketSphinxSpeechRecognitionService.cpp
dom/media/webspeech/recognition/SpeechRecognition.cpp
dom/media/webspeech/recognition/SpeechRecognition.h
dom/media/webspeech/recognition/test/FakeSpeechRecognitionService.cpp
dom/webidl/SpeechRecognition.webidl
--- a/dom/media/webspeech/recognition/PocketSphinxSpeechRecognitionService.cpp
+++ b/dom/media/webspeech/recognition/PocketSphinxSpeechRecognitionService.cpp
@@ -49,18 +49,17 @@ public:
                                    // thread!
 
     // Declare javascript result events
     nsRefPtr<SpeechEvent> event = new SpeechEvent(
       mRecognition, SpeechRecognition::EVENT_RECOGNITIONSERVICE_FINAL_RESULT);
     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 = mResult;
       alternative->mConfidence = 100;
 
       result->mItems.AppendElement(alternative);
     }
@@ -326,18 +325,17 @@ PocketSphinxSpeechRecognitionService::Ob
 }
 
 SpeechRecognitionResultList*
 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);
 
     alternative->mTranscript = NS_LITERAL_STRING("Mock final result");
     alternative->mConfidence = 0.0f;
 
     result->mItems.AppendElement(alternative);
   }
--- a/dom/media/webspeech/recognition/SpeechRecognition.cpp
+++ b/dom/media/webspeech/recognition/SpeechRecognition.cpp
@@ -679,23 +679,23 @@ SpeechRecognition::InterimResults() cons
 void
 SpeechRecognition::SetInterimResults(bool aArg)
 {
   mInterimResults = aArg;
   return;
 }
 
 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;
 }
 
 void
 SpeechRecognition::GetServiceURI(nsString& aRetVal, ErrorResult& aRv) const
 {
--- a/dom/media/webspeech/recognition/SpeechRecognition.h
+++ b/dom/media/webspeech/recognition/SpeechRecognition.h
@@ -82,19 +82,19 @@ public:
   bool GetContinuous(ErrorResult& aRv) const;
 
   void SetContinuous(bool aArg, ErrorResult& aRv);
 
   bool InterimResults() const;
 
   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 SetServiceURI(const nsAString& aArg, ErrorResult& aRv);
 
   void Start(const Optional<NonNull<DOMMediaStream>>& aStream, ErrorResult& aRv);
 
   void Stop();
--- a/dom/media/webspeech/recognition/test/FakeSpeechRecognitionService.cpp
+++ b/dom/media/webspeech/recognition/test/FakeSpeechRecognitionService.cpp
@@ -97,18 +97,17 @@ FakeSpeechRecognitionService::Observe(ns
   return NS_OK;
 }
 
 SpeechRecognitionResultList*
 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");
     alternative->mConfidence = 0.0f;
 
     result->mItems.AppendElement(alternative);
   }
   resultList->mItems.AppendElement(result);
--- a/dom/webidl/SpeechRecognition.webidl
+++ b/dom/webidl/SpeechRecognition.webidl
@@ -15,17 +15,16 @@
  Func="SpeechRecognition::IsAuthorized"]
 interface SpeechRecognition : EventTarget {
     // recognition parameters
     attribute SpeechGrammarList grammars;
     attribute DOMString lang;
     [Throws]
     attribute boolean continuous;
     attribute boolean interimResults;
-    [Throws]
     attribute unsigned long maxAlternatives;
     [Throws]
     attribute DOMString serviceURI;
 
     // methods to drive the speech interaction
     [Throws, UnsafeInPrerendering]
     void start(optional MediaStream stream);
     void stop();