diff options
author | Moonchild <moonchild@palemoon.org> | 2020-06-01 21:58:35 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-06-01 21:58:35 +0000 |
commit | c6ca4380e9e5e95df9de02daf8bfb9a6ebc22810 (patch) | |
tree | c7672903a2030d37f861b12900165a015f49d10a /dom/media/webspeech/recognition/SpeechRecognitionResult.cpp | |
parent | 451509e2c0188a4164d4b3d1d9f5839ed1e95246 (diff) | |
parent | 744b044935f7d1d67fbe0df42d898efcbdd00536 (diff) | |
download | UXP-c6ca4380e9e5e95df9de02daf8bfb9a6ebc22810.tar UXP-c6ca4380e9e5e95df9de02daf8bfb9a6ebc22810.tar.gz UXP-c6ca4380e9e5e95df9de02daf8bfb9a6ebc22810.tar.lz UXP-c6ca4380e9e5e95df9de02daf8bfb9a6ebc22810.tar.xz UXP-c6ca4380e9e5e95df9de02daf8bfb9a6ebc22810.zip |
Merge remote-tracking branch 'origin/redwood' into release
Diffstat (limited to 'dom/media/webspeech/recognition/SpeechRecognitionResult.cpp')
-rw-r--r-- | dom/media/webspeech/recognition/SpeechRecognitionResult.cpp | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/dom/media/webspeech/recognition/SpeechRecognitionResult.cpp b/dom/media/webspeech/recognition/SpeechRecognitionResult.cpp deleted file mode 100644 index 33ac1b806..000000000 --- a/dom/media/webspeech/recognition/SpeechRecognitionResult.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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 "SpeechRecognitionResult.h" -#include "mozilla/dom/SpeechRecognitionResultBinding.h" - -#include "SpeechRecognition.h" - -namespace mozilla { -namespace dom { - -NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(SpeechRecognitionResult, mParent) -NS_IMPL_CYCLE_COLLECTING_ADDREF(SpeechRecognitionResult) -NS_IMPL_CYCLE_COLLECTING_RELEASE(SpeechRecognitionResult) -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SpeechRecognitionResult) - NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY - NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END - -SpeechRecognitionResult::SpeechRecognitionResult(SpeechRecognition* aParent) - : mParent(aParent) -{ -} - -SpeechRecognitionResult::~SpeechRecognitionResult() -{ -} - -JSObject* -SpeechRecognitionResult::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) -{ - return SpeechRecognitionResultBinding::Wrap(aCx, this, aGivenProto); -} - -nsISupports* -SpeechRecognitionResult::GetParentObject() const -{ - return static_cast<DOMEventTargetHelper*>(mParent.get()); -} - -already_AddRefed<SpeechRecognitionAlternative> -SpeechRecognitionResult::IndexedGetter(uint32_t aIndex, bool& aPresent) -{ - if (aIndex >= Length()) { - aPresent = false; - return nullptr; - } - - aPresent = true; - return Item(aIndex); -} - -uint32_t -SpeechRecognitionResult::Length() const -{ - return mItems.Length(); -} - -already_AddRefed<SpeechRecognitionAlternative> -SpeechRecognitionResult::Item(uint32_t aIndex) -{ - RefPtr<SpeechRecognitionAlternative> alternative = mItems.ElementAt(aIndex); - return alternative.forget(); -} - -bool -SpeechRecognitionResult::IsFinal() const -{ - return true; // TODO -} - -} // namespace dom -} // namespace mozilla |