Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/SpeechRecognitionEventBinding.h
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM SpeechRecognitionEvent.webidl BY Codegen.py - DO NOT EDIT */
2
3
#ifndef mozilla_dom_SpeechRecognitionEventBinding_h
4
#define mozilla_dom_SpeechRecognitionEventBinding_h
5
6
#include "EventBinding.h"
7
#include "GeckoProfiler.h"
8
#include "js/RootingAPI.h"
9
#include "jspubtd.h"
10
#include "mozilla/ErrorResult.h"
11
#include "mozilla/dom/BindingDeclarations.h"
12
#include "mozilla/dom/Nullable.h"
13
#include "mozilla/dom/PrototypeList.h"
14
#include "mozilla/dom/SpeechRecognitionResultList.h"
15
#include "nsIDocument.h"
16
17
class nsIDocument;
18
19
namespace mozilla {
20
namespace dom {
21
22
struct NativePropertyHooks;
23
class ProtoAndIfaceCache;
24
class SpeechRecognitionEvent;
25
struct SpeechRecognitionEventAtoms;
26
struct SpeechRecognitionEventInitAtoms;
27
class SpeechRecognitionResultList;
28
29
} // namespace dom
30
} // namespace mozilla
31
32
namespace mozilla {
33
namespace dom {
34
35
struct SpeechRecognitionEventInit : public EventInit
36
{
37
  MOZ_INIT_OUTSIDE_CTOR RefPtr<nsIDocument> mEmma;
38
  MOZ_INIT_OUTSIDE_CTOR JS::Value mInterpretation;
39
  MOZ_INIT_OUTSIDE_CTOR uint32_t mResultIndex;
40
  MOZ_INIT_OUTSIDE_CTOR RefPtr<mozilla::dom::SpeechRecognitionResultList> mResults;
41
42
  SpeechRecognitionEventInit();
43
44
  explicit inline SpeechRecognitionEventInit(const FastDictionaryInitializer& )
45
    : EventInit(FastDictionaryInitializer()),
46
      mInterpretation(JS::UndefinedValue())
47
0
  {
48
0
    // Do nothing here; this is used by our "Fast" subclass
49
0
  }
50
51
private:
52
  SpeechRecognitionEventInit(const SpeechRecognitionEventInit&) = delete;
53
  SpeechRecognitionEventInit& operator=(const SpeechRecognitionEventInit&) = delete;
54
55
  static bool
56
  InitIds(JSContext* cx, SpeechRecognitionEventInitAtoms* atomsCache);
57
58
public:
59
  bool
60
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
61
62
  bool
63
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
64
65
  void
66
  TraceDictionary(JSTracer* trc);
67
68
  inline void
69
  TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags)
70
0
  {
71
0
    ImplCycleCollectionTraverse(aCallback, mEmma, "mEmma", aFlags);
72
0
    ImplCycleCollectionTraverse(aCallback, mResults, "mResults", aFlags);
73
0
  }
74
75
  inline void
76
  UnlinkForCC()
77
0
  {
78
0
    ImplCycleCollectionUnlink(mEmma);
79
0
    ImplCycleCollectionUnlink(mResults);
80
0
  }
81
};
82
83
namespace binding_detail {
84
struct FastSpeechRecognitionEventInit : public SpeechRecognitionEventInit
85
{
86
  inline FastSpeechRecognitionEventInit()
87
    : SpeechRecognitionEventInit(FastDictionaryInitializer())
88
0
  {
89
0
    // Doesn't matter what int we pass to the parent constructor
90
0
  }
91
};
92
} // namespace binding_detail
93
94
95
namespace SpeechRecognitionEvent_Binding {
96
97
  typedef mozilla::dom::SpeechRecognitionEvent NativeType;
98
99
  bool
100
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
101
102
  const JSClass*
103
  GetJSClass();
104
105
  bool
106
  Wrap(JSContext* aCx, mozilla::dom::SpeechRecognitionEvent* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
107
108
  template <class T>
109
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
110
0
  {
111
0
    JS::Rooted<JSObject*> reflector(aCx);
112
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
113
0
  }
114
115
  // We declare this as an array so that retrieving a pointer to this
116
  // binding's property hooks only requires compile/link-time resolvable
117
  // address arithmetic.  Declaring it as a pointer instead would require
118
  // doing a run-time load to fetch a pointer to this binding's property
119
  // hooks.  And then structures which embedded a pointer to this structure
120
  // would require a run-time load for proper initialization, which would
121
  // then induce static constructors.  Lots of static constructors.
122
  extern const NativePropertyHooks sNativePropertyHooks[];
123
124
  void
125
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
126
127
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
128
0
  {
129
0
    /* Get the interface prototype object for this class.  This will create the
130
0
       object as needed. */
131
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::SpeechRecognitionEvent,
132
0
                                       &CreateInterfaceObjects,
133
0
                                       /* aDefineOnGlobal = */ true);
134
0
135
0
  }
136
137
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
138
0
  {
139
0
    /* Get the interface object for this class.  This will create the object as
140
0
       needed. */
141
0
142
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::SpeechRecognitionEvent,
143
0
                                       &CreateInterfaceObjects,
144
0
                                       aDefineOnGlobal);
145
0
  }
146
147
  JSObject*
148
  GetConstructorObject(JSContext* aCx);
149
150
} // namespace SpeechRecognitionEvent_Binding
151
152
153
154
} // namespace dom
155
} // namespace mozilla
156
157
#endif // mozilla_dom_SpeechRecognitionEventBinding_h