Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/media/webspeech/recognition/SpeechRecognitionAlternative.cpp
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim:set ts=2 sw=2 sts=2 et cindent: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#include "SpeechRecognitionAlternative.h"
8
9
#include "mozilla/dom/SpeechRecognitionAlternativeBinding.h"
10
11
#include "SpeechRecognition.h"
12
13
namespace mozilla {
14
namespace dom {
15
16
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(SpeechRecognitionAlternative, mParent)
17
NS_IMPL_CYCLE_COLLECTING_ADDREF(SpeechRecognitionAlternative)
18
NS_IMPL_CYCLE_COLLECTING_RELEASE(SpeechRecognitionAlternative)
19
0
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SpeechRecognitionAlternative)
20
0
  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
21
0
  NS_INTERFACE_MAP_ENTRY(nsISupports)
22
0
NS_INTERFACE_MAP_END
23
24
SpeechRecognitionAlternative::SpeechRecognitionAlternative(SpeechRecognition* aParent)
25
  : mConfidence(0)
26
  , mParent(aParent)
27
0
{
28
0
}
29
30
SpeechRecognitionAlternative::~SpeechRecognitionAlternative()
31
0
{
32
0
}
33
34
JSObject*
35
SpeechRecognitionAlternative::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
36
0
{
37
0
  return SpeechRecognitionAlternative_Binding::Wrap(aCx, this, aGivenProto);
38
0
}
39
40
nsISupports*
41
SpeechRecognitionAlternative::GetParentObject() const
42
0
{
43
0
  return static_cast<DOMEventTargetHelper*>(mParent.get());
44
0
}
45
46
void
47
SpeechRecognitionAlternative::GetTranscript(nsString& aRetVal) const
48
0
{
49
0
  aRetVal = mTranscript;
50
0
}
51
52
float
53
SpeechRecognitionAlternative::Confidence() const
54
0
{
55
0
  return mConfidence;
56
0
}
57
58
} // namespace dom
59
} // namespace mozilla