/work/obj-fuzz/dom/bindings/SpeechRecognitionEvent.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 | | /* THIS FILE IS AUTOGENERATED FROM SpeechRecognitionEvent.webidl BY Codegen.py - DO NOT EDIT */ |
8 | | |
9 | | #include "EventBinding.h" |
10 | | #include "SpeechRecognition.h" |
11 | | #include "SpeechRecognitionEvent.h" |
12 | | #include "SpeechRecognitionEventBinding.h" |
13 | | #include "js/GCAPI.h" |
14 | | #include "mozilla/dom/Nullable.h" |
15 | | #include "mozilla/dom/PrimitiveConversions.h" |
16 | | #include "mozilla/dom/SpeechRecognitionEvent.h" |
17 | | #include "mozilla/dom/SpeechRecognitionResultList.h" |
18 | | #include "nsIDocument.h" |
19 | | |
20 | | namespace mozilla { |
21 | | namespace dom { |
22 | | |
23 | | |
24 | | NS_IMPL_CYCLE_COLLECTION_CLASS(SpeechRecognitionEvent) |
25 | | |
26 | | NS_IMPL_ADDREF_INHERITED(SpeechRecognitionEvent, Event) |
27 | | NS_IMPL_RELEASE_INHERITED(SpeechRecognitionEvent, Event) |
28 | | |
29 | 0 | NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(SpeechRecognitionEvent, Event) |
30 | 0 | NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mResults) |
31 | 0 | NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEmma) |
32 | 0 | NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END |
33 | | |
34 | 0 | NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(SpeechRecognitionEvent, Event) |
35 | 0 | NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mInterpretation) |
36 | 0 | NS_IMPL_CYCLE_COLLECTION_TRACE_END |
37 | | |
38 | 0 | NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(SpeechRecognitionEvent, Event) |
39 | 0 | NS_IMPL_CYCLE_COLLECTION_UNLINK(mResults) |
40 | 0 | NS_IMPL_CYCLE_COLLECTION_UNLINK(mEmma) |
41 | 0 | tmp->mInterpretation.setUndefined(); |
42 | 0 | NS_IMPL_CYCLE_COLLECTION_UNLINK_END |
43 | | |
44 | 0 | NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SpeechRecognitionEvent) |
45 | 0 | NS_INTERFACE_MAP_END_INHERITING(Event) |
46 | | |
47 | | SpeechRecognitionEvent::SpeechRecognitionEvent(mozilla::dom::EventTarget* aOwner) |
48 | | : Event(aOwner, nullptr, nullptr) |
49 | 0 | { |
50 | 0 | } |
51 | | |
52 | | SpeechRecognitionEvent::~SpeechRecognitionEvent() |
53 | 0 | { |
54 | 0 | mInterpretation = JS::UndefinedValue(); |
55 | 0 | mozilla::DropJSObjects(this); |
56 | 0 | } |
57 | | |
58 | | void |
59 | | SpeechRecognitionEvent::GetInterpretation(JS::MutableHandle<JS::Value> aRetVal) const |
60 | 0 | { |
61 | 0 | JS::ExposeValueToActiveJS(mInterpretation); |
62 | 0 | aRetVal.set(mInterpretation); |
63 | 0 | } |
64 | | |
65 | | SpeechRecognitionEvent* |
66 | | SpeechRecognitionEvent::AsSpeechRecognitionEvent() |
67 | 0 | { |
68 | 0 | return this; |
69 | 0 | } |
70 | | |
71 | | JSObject* |
72 | | SpeechRecognitionEvent::WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) |
73 | 0 | { |
74 | 0 | return SpeechRecognitionEvent_Binding::Wrap(aCx, this, aGivenProto); |
75 | 0 | } |
76 | | |
77 | | already_AddRefed<SpeechRecognitionEvent> |
78 | | SpeechRecognitionEvent::Constructor(mozilla::dom::EventTarget* aOwner, const nsAString& aType, const SpeechRecognitionEventInit& aEventInitDict) |
79 | 0 | { |
80 | 0 | RefPtr<SpeechRecognitionEvent> e = new SpeechRecognitionEvent(aOwner); |
81 | 0 | bool trusted = e->Init(aOwner); |
82 | 0 | e->InitEvent(aType, aEventInitDict.mBubbles, aEventInitDict.mCancelable); |
83 | 0 | e->mResultIndex = aEventInitDict.mResultIndex; |
84 | 0 | e->mResults = aEventInitDict.mResults; |
85 | 0 | e->mInterpretation = aEventInitDict.mInterpretation; |
86 | 0 | e->mEmma = aEventInitDict.mEmma; |
87 | 0 | e->SetTrusted(trusted); |
88 | 0 | e->SetComposed(aEventInitDict.mComposed); |
89 | 0 | mozilla::HoldJSObjects(e.get()); |
90 | 0 | return e.forget(); |
91 | 0 | } |
92 | | |
93 | | already_AddRefed<SpeechRecognitionEvent> |
94 | | SpeechRecognitionEvent::Constructor(const GlobalObject& aGlobal, const nsAString& aType, const SpeechRecognitionEventInit& aEventInitDict, ErrorResult& aRv) |
95 | 0 | { |
96 | 0 | nsCOMPtr<mozilla::dom::EventTarget> owner = do_QueryInterface(aGlobal.GetAsSupports()); |
97 | 0 | return Constructor(owner, aType, aEventInitDict); |
98 | 0 | } |
99 | | |
100 | | uint32_t |
101 | | SpeechRecognitionEvent::ResultIndex() const |
102 | 0 | { |
103 | 0 | return mResultIndex; |
104 | 0 | } |
105 | | |
106 | | SpeechRecognitionResultList* |
107 | | SpeechRecognitionEvent::GetResults() const |
108 | 0 | { |
109 | 0 | return mResults; |
110 | 0 | } |
111 | | |
112 | | void |
113 | | SpeechRecognitionEvent::GetInterpretation(JSContext* cx, JS::MutableHandle<JS::Value> aRetVal) const |
114 | 0 | { |
115 | 0 | GetInterpretation(aRetVal); |
116 | 0 | } |
117 | | |
118 | | nsIDocument* |
119 | | SpeechRecognitionEvent::GetEmma() const |
120 | 0 | { |
121 | 0 | return mEmma; |
122 | 0 | } |
123 | | |
124 | | |
125 | | } // namespace dom |
126 | | } // namespace mozilla |