Backed out changeset bdaede62fdcf (bug 1169653) for introducing new rooting hazards.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 11 Jun 2015 15:48:09 -0400
changeset 279168 bf40676095aac00fd78c37a9e8958ca4810fbc02
parent 279167 99d6da0042f3c290393e97c5709f449a9129bdc5
child 279169 8cf9d3e497f9de891ed01bfdf52668b4ec6c5738
child 279295 6231a72d0557b2e835150945188bea306f996da8
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1169653
milestone41.0a1
backs outbdaede62fdcf1bb2d705aadcf3387d14782b57e7
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
Backed out changeset bdaede62fdcf (bug 1169653) for introducing new rooting hazards. CLOSED TREE
dom/media/webspeech/recognition/SpeechRecognition.cpp
dom/media/webspeech/recognition/SpeechRecognition.h
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/SpeechGrammar.webidl
dom/webidl/SpeechGrammarList.webidl
dom/webidl/SpeechRecognition.webidl
dom/webidl/SpeechRecognitionAlternative.webidl
dom/webidl/SpeechRecognitionError.webidl
dom/webidl/SpeechRecognitionEvent.webidl
dom/webidl/SpeechRecognitionResult.webidl
dom/webidl/SpeechRecognitionResultList.webidl
--- a/dom/media/webspeech/recognition/SpeechRecognition.cpp
+++ b/dom/media/webspeech/recognition/SpeechRecognition.cpp
@@ -4,17 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SpeechRecognition.h"
 
 #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"
 #include "mozilla/MediaManager.h"
 #include "mozilla/Services.h"
 
 #include "AudioSegment.h"
 #include "endpointer.h"
@@ -139,25 +138,16 @@ SpeechRecognition::SetState(FSMState sta
 }
 
 JSObject*
 SpeechRecognition::WrapObject(JSContext* aCx, JS::Handle<JSObject*> 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>
 SpeechRecognition::Constructor(const GlobalObject& aGlobal,
                                ErrorResult& aRv)
 {
   nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(aGlobal.GetAsSupports());
   if (!win) {
     aRv.Throw(NS_ERROR_FAILURE);
   }
--- a/dom/media/webspeech/recognition/SpeechRecognition.h
+++ b/dom/media/webspeech/recognition/SpeechRecognition.h
@@ -33,18 +33,16 @@
 
 namespace mozilla {
 
 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"
 
 class GlobalObject;
 class SpeechEvent;
 
 PRLogModuleInfo* GetSpeechRecognitionLog();
 #define SR_LOG(...) MOZ_LOG(GetSpeechRecognitionLog(), mozilla::LogLevel::Debug, (__VA_ARGS__))
@@ -62,18 +60,16 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIOBSERVER
 
   nsISupports* GetParentObject() const;
 
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
-  static bool IsAuthorized(JSContext* aCx, JSObject* aGlobal);
-
   static already_AddRefed<SpeechRecognition>
   Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
 
   already_AddRefed<SpeechGrammarList> GetGrammars(ErrorResult& aRv) const;
 
   void SetGrammars(mozilla::dom::SpeechGrammarList& aArg, ErrorResult& aRv);
 
   void GetLang(nsString& aRetVal, ErrorResult& aRv) const;
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -934,16 +934,32 @@ var interfaceNamesInGlobalScope =
     "SimpleGestureEvent",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "SimpleTest", xbl: false},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {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!
     {name: "SpeechSynthesis", b2g: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "SpeechSynthesisUtterance", b2g: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "SpeechSynthesisVoice", b2g: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
--- a/dom/webidl/SpeechGrammar.webidl
+++ b/dom/webidl/SpeechGrammar.webidl
@@ -6,17 +6,16 @@
  * The origin of this IDL file is
  * http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 [Constructor,
- Pref="media.webspeech.recognition.enable",
- Func="SpeechRecognition::IsAuthorized"]
+ Pref="media.webspeech.recognition.enable"]
 interface SpeechGrammar {
     [Throws]
     attribute DOMString src;
     [Throws]
     attribute float weight;
 };
 
--- a/dom/webidl/SpeechGrammarList.webidl
+++ b/dom/webidl/SpeechGrammarList.webidl
@@ -5,18 +5,17 @@
  *
  * The origin of this IDL file is
  * http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * 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]
     getter SpeechGrammar item(unsigned long index);
     [Throws]
     void addFromURI(DOMString src, optional float weight);
     [Throws]
     void addFromString(DOMString string, optional float weight);
--- a/dom/webidl/SpeechRecognition.webidl
+++ b/dom/webidl/SpeechRecognition.webidl
@@ -6,18 +6,17 @@
  * The origin of this IDL file is
  * http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 [Constructor,
- Pref="media.webspeech.recognition.enable",
- Func="SpeechRecognition::IsAuthorized"]
+ Pref="media.webspeech.recognition.enable"]
 interface SpeechRecognition : EventTarget {
     // recognition parameters
     [Throws]
     attribute SpeechGrammarList grammars;
     [Throws]
     attribute DOMString lang;
     [Throws]
     attribute boolean continuous;
--- a/dom/webidl/SpeechRecognitionAlternative.webidl
+++ b/dom/webidl/SpeechRecognitionAlternative.webidl
@@ -5,14 +5,13 @@
  *
  * The origin of this IDL file is
  * http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * 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;
 };
--- a/dom/webidl/SpeechRecognitionError.webidl
+++ b/dom/webidl/SpeechRecognitionError.webidl
@@ -11,17 +11,16 @@ enum SpeechRecognitionErrorCode {
   "network",
   "not-allowed",
   "service-not-allowed",
   "bad-grammar",
   "language-not-supported"
 };
 
 [Pref="media.webspeech.recognition.enable",
- Func="SpeechRecognition::IsAuthorized",
  Constructor(DOMString type, optional SpeechRecognitionErrorInit eventInitDict)]
 interface SpeechRecognitionError : Event
 {
   readonly attribute SpeechRecognitionErrorCode error;
   readonly attribute DOMString? message;
 };
 
 dictionary SpeechRecognitionErrorInit : EventInit
--- a/dom/webidl/SpeechRecognitionEvent.webidl
+++ b/dom/webidl/SpeechRecognitionEvent.webidl
@@ -1,17 +1,16 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 interface nsISupports;
 
 [Pref="media.webspeech.recognition.enable",
- Func="SpeechRecognition::IsAuthorized",
  Constructor(DOMString type, optional SpeechRecognitionEventInit eventInitDict)]
 interface SpeechRecognitionEvent : Event
 {
   readonly attribute unsigned long resultIndex;
   readonly attribute SpeechRecognitionResultList? results;
   readonly attribute any interpretation;
   readonly attribute Document? emma;
 };
--- a/dom/webidl/SpeechRecognitionResult.webidl
+++ b/dom/webidl/SpeechRecognitionResult.webidl
@@ -5,15 +5,14 @@
  *
  * The origin of this IDL file is
  * http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * 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);
     readonly attribute boolean isFinal;
 };
--- a/dom/webidl/SpeechRecognitionResultList.webidl
+++ b/dom/webidl/SpeechRecognitionResultList.webidl
@@ -5,14 +5,13 @@
  *
  * The origin of this IDL file is
  * http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * 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);
 };