/work/obj-fuzz/dist/include/mozilla/dom/PeriodicWaveBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM PeriodicWave.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_PeriodicWaveBinding_h |
4 | | #define mozilla_dom_PeriodicWaveBinding_h |
5 | | |
6 | | #include "GeckoProfiler.h" |
7 | | #include "PeriodicWaveBinding.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 | | |
15 | | namespace mozilla { |
16 | | namespace dom { |
17 | | |
18 | | struct NativePropertyHooks; |
19 | | class PeriodicWave; |
20 | | struct PeriodicWaveAtoms; |
21 | | struct PeriodicWaveConstraintsAtoms; |
22 | | struct PeriodicWaveOptionsAtoms; |
23 | | class ProtoAndIfaceCache; |
24 | | |
25 | | } // namespace dom |
26 | | } // namespace mozilla |
27 | | |
28 | | namespace mozilla { |
29 | | namespace dom { |
30 | | |
31 | | struct PeriodicWaveConstraints : public DictionaryBase |
32 | | { |
33 | | MOZ_INIT_OUTSIDE_CTOR bool mDisableNormalization; |
34 | | |
35 | | PeriodicWaveConstraints(); |
36 | | |
37 | | explicit inline PeriodicWaveConstraints(const FastDictionaryInitializer& ) |
38 | 0 | { |
39 | 0 | // Do nothing here; this is used by our "Fast" subclass |
40 | 0 | } |
41 | | |
42 | | explicit inline PeriodicWaveConstraints(const PeriodicWaveConstraints& aOther) |
43 | 0 | { |
44 | 0 | *this = aOther; |
45 | 0 | } |
46 | | |
47 | | bool |
48 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
49 | | |
50 | | bool |
51 | | Init(const nsAString& aJSON); |
52 | | |
53 | | bool |
54 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
55 | | |
56 | | bool |
57 | | ToJSON(nsAString& aJSON) const; |
58 | | |
59 | | void |
60 | | TraceDictionary(JSTracer* trc); |
61 | | |
62 | | PeriodicWaveConstraints& |
63 | | operator=(const PeriodicWaveConstraints& aOther); |
64 | | |
65 | | private: |
66 | | static bool |
67 | | InitIds(JSContext* cx, PeriodicWaveConstraintsAtoms* atomsCache); |
68 | | }; |
69 | | |
70 | | namespace binding_detail { |
71 | | struct FastPeriodicWaveConstraints : public PeriodicWaveConstraints |
72 | | { |
73 | | inline FastPeriodicWaveConstraints() |
74 | | : PeriodicWaveConstraints(FastDictionaryInitializer()) |
75 | 0 | { |
76 | 0 | // Doesn't matter what int we pass to the parent constructor |
77 | 0 | } |
78 | | }; |
79 | | } // namespace binding_detail |
80 | | |
81 | | |
82 | | struct PeriodicWaveOptions : public PeriodicWaveConstraints |
83 | | { |
84 | | MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<float>> mImag; |
85 | | MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<float>> mReal; |
86 | | |
87 | | PeriodicWaveOptions(); |
88 | | |
89 | | explicit inline PeriodicWaveOptions(const FastDictionaryInitializer& ) |
90 | | : PeriodicWaveConstraints(FastDictionaryInitializer()) |
91 | 0 | { |
92 | 0 | // Do nothing here; this is used by our "Fast" subclass |
93 | 0 | } |
94 | | |
95 | | explicit inline PeriodicWaveOptions(const PeriodicWaveOptions& aOther) |
96 | 0 | { |
97 | 0 | *this = aOther; |
98 | 0 | } |
99 | | |
100 | | bool |
101 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
102 | | |
103 | | bool |
104 | | Init(const nsAString& aJSON); |
105 | | |
106 | | bool |
107 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
108 | | |
109 | | bool |
110 | | ToJSON(nsAString& aJSON) const; |
111 | | |
112 | | void |
113 | | TraceDictionary(JSTracer* trc); |
114 | | |
115 | | PeriodicWaveOptions& |
116 | | operator=(const PeriodicWaveOptions& aOther); |
117 | | |
118 | | private: |
119 | | static bool |
120 | | InitIds(JSContext* cx, PeriodicWaveOptionsAtoms* atomsCache); |
121 | | }; |
122 | | |
123 | | namespace binding_detail { |
124 | | struct FastPeriodicWaveOptions : public PeriodicWaveOptions |
125 | | { |
126 | | inline FastPeriodicWaveOptions() |
127 | | : PeriodicWaveOptions(FastDictionaryInitializer()) |
128 | 0 | { |
129 | 0 | // Doesn't matter what int we pass to the parent constructor |
130 | 0 | } |
131 | | }; |
132 | | } // namespace binding_detail |
133 | | |
134 | | |
135 | | namespace PeriodicWave_Binding { |
136 | | |
137 | | typedef mozilla::dom::PeriodicWave NativeType; |
138 | | |
139 | | bool |
140 | | ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj); |
141 | | |
142 | | const JSClass* |
143 | | GetJSClass(); |
144 | | |
145 | | bool |
146 | | Wrap(JSContext* aCx, mozilla::dom::PeriodicWave* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
147 | | |
148 | | template <class T> |
149 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
150 | 0 | { |
151 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
152 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
153 | 0 | } |
154 | | |
155 | | // We declare this as an array so that retrieving a pointer to this |
156 | | // binding's property hooks only requires compile/link-time resolvable |
157 | | // address arithmetic. Declaring it as a pointer instead would require |
158 | | // doing a run-time load to fetch a pointer to this binding's property |
159 | | // hooks. And then structures which embedded a pointer to this structure |
160 | | // would require a run-time load for proper initialization, which would |
161 | | // then induce static constructors. Lots of static constructors. |
162 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
163 | | |
164 | | void |
165 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
166 | | |
167 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
168 | 0 | { |
169 | 0 | /* Get the interface prototype object for this class. This will create the |
170 | 0 | object as needed. */ |
171 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::PeriodicWave, |
172 | 0 | &CreateInterfaceObjects, |
173 | 0 | /* aDefineOnGlobal = */ true); |
174 | 0 |
|
175 | 0 | } |
176 | | |
177 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
178 | 0 | { |
179 | 0 | /* Get the interface object for this class. This will create the object as |
180 | 0 | needed. */ |
181 | 0 |
|
182 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::PeriodicWave, |
183 | 0 | &CreateInterfaceObjects, |
184 | 0 | aDefineOnGlobal); |
185 | 0 | } |
186 | | |
187 | | JSObject* |
188 | | GetConstructorObject(JSContext* aCx); |
189 | | |
190 | | } // namespace PeriodicWave_Binding |
191 | | |
192 | | |
193 | | |
194 | | } // namespace dom |
195 | | } // namespace mozilla |
196 | | |
197 | | #endif // mozilla_dom_PeriodicWaveBinding_h |