diff --git a/dom/media/webspeech/recognition/SpeechRecognition.cpp b/dom/media/webspeech/recognition/SpeechRecognition.cpp index 5a018a47aef9..002612aedc88 100644 --- a/dom/media/webspeech/recognition/SpeechRecognition.cpp +++ b/dom/media/webspeech/recognition/SpeechRecognition.cpp @@ -9,7 +9,6 @@ #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" -#include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/SpeechRecognitionBinding.h" #include "mozilla/dom/MediaStreamTrackBinding.h" #include "mozilla/dom/MediaStreamError.h" @@ -144,15 +143,6 @@ SpeechRecognition::WrapObject(JSContext* aCx, JS::Handle aGivenProto) return SpeechRecognitionBinding::Wrap(aCx, this, aGivenProto); } -bool -SpeechRecognition::IsAuthorized(JSContext* aCx, JSObject* aGlobal) -{ - bool enableTests = Preferences::GetBool(TEST_PREFERENCE_ENABLE); - bool enableRecognitionEnable = Preferences::GetBool(TEST_PREFERENCE_RECOGNITION_ENABLE); - bool enableRecognitionForceEnable = Preferences::GetBool(TEST_PREFERENCE_RECOGNITION_FORCE_ENABLE); - return (IsInCertifiedApp(aCx, aGlobal) || enableRecognitionForceEnable || enableTests) && enableRecognitionEnable; -} - already_AddRefed SpeechRecognition::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv) diff --git a/dom/media/webspeech/recognition/SpeechRecognition.h b/dom/media/webspeech/recognition/SpeechRecognition.h index 7c5649faee79..7f43493087b6 100644 --- a/dom/media/webspeech/recognition/SpeechRecognition.h +++ b/dom/media/webspeech/recognition/SpeechRecognition.h @@ -38,8 +38,6 @@ namespace dom { #define TEST_PREFERENCE_ENABLE "media.webspeech.test.enable" #define TEST_PREFERENCE_FAKE_FSM_EVENTS "media.webspeech.test.fake_fsm_events" #define TEST_PREFERENCE_FAKE_RECOGNITION_SERVICE "media.webspeech.test.fake_recognition_service" -#define TEST_PREFERENCE_RECOGNITION_ENABLE "media.webspeech.recognition.enable" -#define TEST_PREFERENCE_RECOGNITION_FORCE_ENABLE "media.webspeech.recognition.force_enable" #define SPEECH_RECOGNITION_TEST_EVENT_REQUEST_TOPIC "SpeechRecognitionTest:RequestEvent" #define SPEECH_RECOGNITION_TEST_END_TOPIC "SpeechRecognitionTest:End" @@ -67,8 +65,6 @@ public: virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; - static bool IsAuthorized(JSContext* aCx, JSObject* aGlobal); - static already_AddRefed Constructor(const GlobalObject& aGlobal, ErrorResult& aRv); diff --git a/dom/tests/mochitest/general/test_interfaces.html b/dom/tests/mochitest/general/test_interfaces.html index 3c11c6e893d7..0de37e035d48 100644 --- a/dom/tests/mochitest/general/test_interfaces.html +++ b/dom/tests/mochitest/general/test_interfaces.html @@ -938,6 +938,22 @@ var interfaceNamesInGlobalScope = {name: "SourceBuffer", linux: false, release: false}, // IMPORTANT: Do not change this list without review from a DOM peer! {name: "SourceBufferList", linux: false, release: false}, +// IMPORTANT: Do not change this list without review from a DOM peer! + {name: "SpeechRecognition", b2g: true, nightly: true}, +// IMPORTANT: Do not change this list without review from a DOM peer! + {name: "SpeechRecognitionError", b2g: true, nightly: true}, +// IMPORTANT: Do not change this list without review from a DOM peer! + {name: "SpeechRecognitionAlternative", b2g: true, nightly: true}, +// IMPORTANT: Do not change this list without review from a DOM peer! + {name: "SpeechRecognitionResult", b2g: true, nightly: true}, +// IMPORTANT: Do not change this list without review from a DOM peer! + {name: "SpeechRecognitionResultList", b2g: true, nightly: true}, +// IMPORTANT: Do not change this list without review from a DOM peer! + {name: "SpeechRecognitionEvent", b2g: true, nightly: true}, +// IMPORTANT: Do not change this list without review from a DOM peer! + {name: "SpeechGrammar", b2g: true, nightly: true}, +// IMPORTANT: Do not change this list without review from a DOM peer! + {name: "SpeechGrammarList", b2g: true, nightly: true}, // IMPORTANT: Do not change this list without review from a DOM peer! {name: "SpeechSynthesisEvent", b2g: true}, // IMPORTANT: Do not change this list without review from a DOM peer! diff --git a/dom/webidl/SpeechGrammar.webidl b/dom/webidl/SpeechGrammar.webidl index 8cc97d2ffc5c..774a3c548104 100644 --- a/dom/webidl/SpeechGrammar.webidl +++ b/dom/webidl/SpeechGrammar.webidl @@ -11,8 +11,7 @@ */ [Constructor, - Pref="media.webspeech.recognition.enable", - Func="SpeechRecognition::IsAuthorized"] + Pref="media.webspeech.recognition.enable"] interface SpeechGrammar { [Throws] attribute DOMString src; diff --git a/dom/webidl/SpeechGrammarList.webidl b/dom/webidl/SpeechGrammarList.webidl index f1b5775ae0c3..89d95767b9ea 100644 --- a/dom/webidl/SpeechGrammarList.webidl +++ b/dom/webidl/SpeechGrammarList.webidl @@ -10,8 +10,7 @@ * liability, trademark and document use rules apply. */ -[Constructor, Pref="media.webspeech.recognition.enable", - Func="SpeechRecognition::IsAuthorized"] +[Constructor, Pref="media.webspeech.recognition.enable"] interface SpeechGrammarList { readonly attribute unsigned long length; [Throws] diff --git a/dom/webidl/SpeechRecognition.webidl b/dom/webidl/SpeechRecognition.webidl index 584ced2d10e3..556d972d1ec2 100644 --- a/dom/webidl/SpeechRecognition.webidl +++ b/dom/webidl/SpeechRecognition.webidl @@ -11,8 +11,7 @@ */ [Constructor, - Pref="media.webspeech.recognition.enable", - Func="SpeechRecognition::IsAuthorized"] + Pref="media.webspeech.recognition.enable"] interface SpeechRecognition : EventTarget { // recognition parameters [Throws] diff --git a/dom/webidl/SpeechRecognitionAlternative.webidl b/dom/webidl/SpeechRecognitionAlternative.webidl index f2692404d590..c5844e1a3a27 100644 --- a/dom/webidl/SpeechRecognitionAlternative.webidl +++ b/dom/webidl/SpeechRecognitionAlternative.webidl @@ -10,8 +10,7 @@ * liability, trademark and document use rules apply. */ -[Pref="media.webspeech.recognition.enable", - Func="SpeechRecognition::IsAuthorized"] +[Pref="media.webspeech.recognition.enable"] interface SpeechRecognitionAlternative { readonly attribute DOMString transcript; readonly attribute float confidence; diff --git a/dom/webidl/SpeechRecognitionError.webidl b/dom/webidl/SpeechRecognitionError.webidl index ddc74e88da00..ef57bbaafbf0 100644 --- a/dom/webidl/SpeechRecognitionError.webidl +++ b/dom/webidl/SpeechRecognitionError.webidl @@ -16,7 +16,6 @@ enum SpeechRecognitionErrorCode { }; [Pref="media.webspeech.recognition.enable", - Func="SpeechRecognition::IsAuthorized", Constructor(DOMString type, optional SpeechRecognitionErrorInit eventInitDict)] interface SpeechRecognitionError : Event { diff --git a/dom/webidl/SpeechRecognitionEvent.webidl b/dom/webidl/SpeechRecognitionEvent.webidl index 7a95323d7752..a464fcc70d29 100644 --- a/dom/webidl/SpeechRecognitionEvent.webidl +++ b/dom/webidl/SpeechRecognitionEvent.webidl @@ -6,7 +6,6 @@ interface nsISupports; [Pref="media.webspeech.recognition.enable", - Func="SpeechRecognition::IsAuthorized", Constructor(DOMString type, optional SpeechRecognitionEventInit eventInitDict)] interface SpeechRecognitionEvent : Event { diff --git a/dom/webidl/SpeechRecognitionResult.webidl b/dom/webidl/SpeechRecognitionResult.webidl index c66bb9ca2f06..9fb7bdc6b738 100644 --- a/dom/webidl/SpeechRecognitionResult.webidl +++ b/dom/webidl/SpeechRecognitionResult.webidl @@ -10,8 +10,7 @@ * liability, trademark and document use rules apply. */ -[Pref="media.webspeech.recognition.enable", - Func="SpeechRecognition::IsAuthorized"] +[Pref="media.webspeech.recognition.enable"] interface SpeechRecognitionResult { readonly attribute unsigned long length; getter SpeechRecognitionAlternative item(unsigned long index); diff --git a/dom/webidl/SpeechRecognitionResultList.webidl b/dom/webidl/SpeechRecognitionResultList.webidl index ec182c1def48..184ef183371a 100644 --- a/dom/webidl/SpeechRecognitionResultList.webidl +++ b/dom/webidl/SpeechRecognitionResultList.webidl @@ -10,8 +10,7 @@ * liability, trademark and document use rules apply. */ -[Pref="media.webspeech.recognition.enable", - Func="SpeechRecognition::IsAuthorized"] +[Pref="media.webspeech.recognition.enable"] interface SpeechRecognitionResultList { readonly attribute unsigned long length; getter SpeechRecognitionResult item(unsigned long index);