diff options
author | Moonchild <moonchild@palemoon.org> | 2020-05-20 10:19:04 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-05-20 10:19:04 +0000 |
commit | 14f6f230d7545d3906a7fd72f3d4677f3b6503d8 (patch) | |
tree | 8d11d7cf5699af44e1a1d4536116c12628cbc445 /dom/events | |
parent | 750b4c3a11e6ed4d92598072899b02c549f17d26 (diff) | |
download | uxp-14f6f230d7545d3906a7fd72f3d4677f3b6503d8.tar.gz |
Issue #1538 - remove speech recognition engine
This removes speech recognition, pocketsphinx, training models
and the speech automated test interface.
This also re-establishes proper use of MOZ_WEBSPEECH to work
for the speech API (synthesis part only) that was a broken mess
before, with some synth parts being always built, some parts
being built only with it enabled and recognition parts being
dependent on it. I'm pretty sure it'd be totally busted if you'd
ever have tried building without MOZ_WEBPEECH before.
Tested that synthesis still works as-intended.
This resolves #1538
Diffstat (limited to 'dom/events')
-rw-r--r-- | dom/events/SpeechRecognitionError.cpp | 51 | ||||
-rw-r--r-- | dom/events/SpeechRecognitionError.h | 62 | ||||
-rw-r--r-- | dom/events/moz.build | 6 |
3 files changed, 0 insertions, 119 deletions
diff --git a/dom/events/SpeechRecognitionError.cpp b/dom/events/SpeechRecognitionError.cpp deleted file mode 100644 index 2d0c357e6b..0000000000 --- a/dom/events/SpeechRecognitionError.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* 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/. */ - -#include "SpeechRecognitionError.h" - -namespace mozilla { -namespace dom { - -SpeechRecognitionError::SpeechRecognitionError( - mozilla::dom::EventTarget* aOwner, - nsPresContext* aPresContext, - WidgetEvent* aEvent) - : Event(aOwner, aPresContext, aEvent) - , mError() -{ -} - -SpeechRecognitionError::~SpeechRecognitionError() {} - -already_AddRefed<SpeechRecognitionError> -SpeechRecognitionError::Constructor(const GlobalObject& aGlobal, - const nsAString& aType, - const SpeechRecognitionErrorInit& aParam, - ErrorResult& aRv) -{ - nsCOMPtr<mozilla::dom::EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports()); - RefPtr<SpeechRecognitionError> e = new SpeechRecognitionError(t, nullptr, nullptr); - bool trusted = e->Init(t); - e->InitSpeechRecognitionError(aType, aParam.mBubbles, aParam.mCancelable, aParam.mError, aParam.mMessage); - e->SetTrusted(trusted); - e->SetComposed(aParam.mComposed); - return e.forget(); -} - -void -SpeechRecognitionError::InitSpeechRecognitionError(const nsAString& aType, - bool aCanBubble, - bool aCancelable, - SpeechRecognitionErrorCode aError, - const nsAString& aMessage) -{ - Event::InitEvent(aType, aCanBubble, aCancelable); - mError = aError; - mMessage = aMessage; -} - -} // namespace dom -} // namespace mozilla diff --git a/dom/events/SpeechRecognitionError.h b/dom/events/SpeechRecognitionError.h deleted file mode 100644 index ef43feffd1..0000000000 --- a/dom/events/SpeechRecognitionError.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* 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/. */ - -#ifndef SpeechRecognitionError_h__ -#define SpeechRecognitionError_h__ - -#include "mozilla/dom/Event.h" -#include "mozilla/dom/SpeechRecognitionErrorBinding.h" - -namespace mozilla { -namespace dom { - -class SpeechRecognitionError : public Event -{ -public: - SpeechRecognitionError(mozilla::dom::EventTarget* aOwner, - nsPresContext* aPresContext, - WidgetEvent* aEvent); - virtual ~SpeechRecognitionError(); - - static already_AddRefed<SpeechRecognitionError> - Constructor(const GlobalObject& aGlobal, - const nsAString& aType, - const SpeechRecognitionErrorInit& aParam, - ErrorResult& aRv); - - virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override - { - return mozilla::dom::SpeechRecognitionErrorBinding::Wrap(aCx, this, aGivenProto); - } - - void - GetMessage(nsAString& aString) - { - aString = mMessage; - } - - SpeechRecognitionErrorCode - Error() - { - return mError; - } - - void - InitSpeechRecognitionError(const nsAString& aType, - bool aCanBubble, - bool aCancelable, - SpeechRecognitionErrorCode aError, - const nsAString& aMessage); - -protected: - SpeechRecognitionErrorCode mError; - nsString mMessage; -}; - -} // namespace dom -} // namespace mozilla - -#endif // SpeechRecognitionError_h__ diff --git a/dom/events/moz.build b/dom/events/moz.build index 661f56c7e9..2378b92be7 100644 --- a/dom/events/moz.build +++ b/dom/events/moz.build @@ -73,9 +73,6 @@ EXPORTS.mozilla.dom += [ 'XULCommandEvent.h', ] -if CONFIG['MOZ_WEBSPEECH']: - EXPORTS.mozilla.dom += ['SpeechRecognitionError.h'] - SOURCES += [ 'AnimationEvent.cpp', 'AsyncEventDispatcher.cpp', @@ -127,9 +124,6 @@ SOURCES += [ 'XULCommandEvent.cpp', ] -if CONFIG['MOZ_WEBSPEECH']: - SOURCES += ['SpeechRecognitionError.cpp'] - include('/ipc/chromium/chromium-config.mozbuild') FINAL_LIBRARY = 'xul' |