Coverage Report

Created: 2018-09-25 14:53

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