Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/KeyframeAnimationOptionsBinding.h
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM KeyframeAnimationOptions.webidl BY Codegen.py - DO NOT EDIT */
2
3
#ifndef mozilla_dom_KeyframeAnimationOptionsBinding_h
4
#define mozilla_dom_KeyframeAnimationOptionsBinding_h
5
6
#include "AnimatableBinding.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/FakeString.h"
13
#include "mozilla/dom/Nullable.h"
14
#include "mozilla/dom/UnionMember.h"
15
16
namespace mozilla {
17
namespace dom {
18
19
struct NativePropertyHooks;
20
class ProtoAndIfaceCache;
21
22
} // namespace dom
23
} // namespace mozilla
24
25
namespace mozilla {
26
namespace dom {
27
28
class UnrestrictedDoubleOrKeyframeAnimationOptions
29
{
30
  friend class UnrestrictedDoubleOrKeyframeAnimationOptionsArgument;
31
  enum Type
32
  {
33
    eUninitialized,
34
    eUnrestrictedDouble,
35
    eKeyframeAnimationOptions
36
  };
37
38
  union Value
39
  {
40
    UnionMember<double > mUnrestrictedDouble;
41
    UnionMember<binding_detail::FastKeyframeAnimationOptions > mKeyframeAnimationOptions;
42
43
  };
44
45
  Type mType;
46
  Value mValue;
47
48
  UnrestrictedDoubleOrKeyframeAnimationOptions(const UnrestrictedDoubleOrKeyframeAnimationOptions&) = delete;
49
  UnrestrictedDoubleOrKeyframeAnimationOptions& operator=(const UnrestrictedDoubleOrKeyframeAnimationOptions&) = delete;
50
public:
51
  explicit inline UnrestrictedDoubleOrKeyframeAnimationOptions()
52
    : mType(eUninitialized)
53
0
  {
54
0
  }
55
56
  inline ~UnrestrictedDoubleOrKeyframeAnimationOptions()
57
0
  {
58
0
    Uninit();
59
0
  }
60
61
  inline double&
62
  RawSetAsUnrestrictedDouble()
63
0
  {
64
0
    if (mType == eUnrestrictedDouble) {
65
0
      return mValue.mUnrestrictedDouble.Value();
66
0
    }
67
0
    MOZ_ASSERT(mType == eUninitialized);
68
0
    mType = eUnrestrictedDouble;
69
0
    return mValue.mUnrestrictedDouble.SetValue();
70
0
  }
71
72
  inline double&
73
  SetAsUnrestrictedDouble()
74
0
  {
75
0
    if (mType == eUnrestrictedDouble) {
76
0
      return mValue.mUnrestrictedDouble.Value();
77
0
    }
78
0
    Uninit();
79
0
    mType = eUnrestrictedDouble;
80
0
    return mValue.mUnrestrictedDouble.SetValue();
81
0
  }
82
83
  inline bool
84
  IsUnrestrictedDouble() const
85
0
  {
86
0
    return mType == eUnrestrictedDouble;
87
0
  }
88
89
  inline double&
90
  GetAsUnrestrictedDouble()
91
0
  {
92
0
    MOZ_ASSERT(IsUnrestrictedDouble(), "Wrong type!");
93
0
    return mValue.mUnrestrictedDouble.Value();
94
0
  }
95
96
  inline double
97
  GetAsUnrestrictedDouble() const
98
0
  {
99
0
    MOZ_ASSERT(IsUnrestrictedDouble(), "Wrong type!");
100
0
    return mValue.mUnrestrictedDouble.Value();
101
0
  }
102
103
  inline binding_detail::FastKeyframeAnimationOptions&
104
  RawSetAsKeyframeAnimationOptions()
105
0
  {
106
0
    if (mType == eKeyframeAnimationOptions) {
107
0
      return mValue.mKeyframeAnimationOptions.Value();
108
0
    }
109
0
    MOZ_ASSERT(mType == eUninitialized);
110
0
    mType = eKeyframeAnimationOptions;
111
0
    return mValue.mKeyframeAnimationOptions.SetValue();
112
0
  }
113
114
  inline binding_detail::FastKeyframeAnimationOptions&
115
  SetAsKeyframeAnimationOptions()
116
0
  {
117
0
    if (mType == eKeyframeAnimationOptions) {
118
0
      return mValue.mKeyframeAnimationOptions.Value();
119
0
    }
120
0
    Uninit();
121
0
    mType = eKeyframeAnimationOptions;
122
0
    return mValue.mKeyframeAnimationOptions.SetValue();
123
0
  }
124
125
  inline bool
126
  IsKeyframeAnimationOptions() const
127
0
  {
128
0
    return mType == eKeyframeAnimationOptions;
129
0
  }
130
131
  inline binding_detail::FastKeyframeAnimationOptions&
132
  GetAsKeyframeAnimationOptions()
133
0
  {
134
0
    MOZ_ASSERT(IsKeyframeAnimationOptions(), "Wrong type!");
135
0
    return mValue.mKeyframeAnimationOptions.Value();
136
0
  }
137
138
  inline const KeyframeAnimationOptions&
139
  GetAsKeyframeAnimationOptions() const
140
0
  {
141
0
    MOZ_ASSERT(IsKeyframeAnimationOptions(), "Wrong type!");
142
0
    return mValue.mKeyframeAnimationOptions.Value();
143
0
  }
144
145
  inline void
146
  Uninit()
147
  {
148
    switch (mType) {
149
      case eUninitialized: {
150
        break;
151
      }
152
      case eUnrestrictedDouble: {
153
        DestroyUnrestrictedDouble();
154
        break;
155
      }
156
      case eKeyframeAnimationOptions: {
157
        DestroyKeyframeAnimationOptions();
158
        break;
159
      }
160
    }
161
  }
162
163
  bool
164
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
165
166
private:
167
  inline void
168
  DestroyUnrestrictedDouble()
169
0
  {
170
0
    MOZ_ASSERT(IsUnrestrictedDouble(), "Wrong type!");
171
0
    mValue.mUnrestrictedDouble.Destroy();
172
0
    mType = eUninitialized;
173
0
  }
174
175
  inline void
176
  DestroyKeyframeAnimationOptions()
177
0
  {
178
0
    MOZ_ASSERT(IsKeyframeAnimationOptions(), "Wrong type!");
179
0
    mValue.mKeyframeAnimationOptions.Destroy();
180
0
    mType = eUninitialized;
181
0
  }
182
};
183
184
185
class OwningUnrestrictedDoubleOrKeyframeAnimationOptions : public AllOwningUnionBase
186
{
187
  friend void ImplCycleCollectionUnlink(OwningUnrestrictedDoubleOrKeyframeAnimationOptions& aUnion);
188
  enum Type
189
  {
190
    eUninitialized,
191
    eUnrestrictedDouble,
192
    eKeyframeAnimationOptions
193
  };
194
195
  union Value
196
  {
197
    UnionMember<double > mUnrestrictedDouble;
198
    UnionMember<KeyframeAnimationOptions > mKeyframeAnimationOptions;
199
200
  };
201
202
  Type mType;
203
  Value mValue;
204
205
public:
206
  explicit inline OwningUnrestrictedDoubleOrKeyframeAnimationOptions()
207
    : mType(eUninitialized)
208
0
  {
209
0
  }
210
211
  explicit inline OwningUnrestrictedDoubleOrKeyframeAnimationOptions(const OwningUnrestrictedDoubleOrKeyframeAnimationOptions& aOther)
212
    : mType(eUninitialized)
213
0
  {
214
0
    *this = aOther;
215
0
  }
216
217
  inline ~OwningUnrestrictedDoubleOrKeyframeAnimationOptions()
218
0
  {
219
0
    Uninit();
220
0
  }
221
222
  double&
223
  RawSetAsUnrestrictedDouble();
224
225
  double&
226
  SetAsUnrestrictedDouble();
227
228
  bool
229
  TrySetToUnrestrictedDouble(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
230
231
  inline bool
232
  IsUnrestrictedDouble() const
233
0
  {
234
0
    return mType == eUnrestrictedDouble;
235
0
  }
236
237
  inline double&
238
  GetAsUnrestrictedDouble()
239
0
  {
240
0
    MOZ_ASSERT(IsUnrestrictedDouble(), "Wrong type!");
241
0
    return mValue.mUnrestrictedDouble.Value();
242
0
  }
243
244
  inline double const &
245
  GetAsUnrestrictedDouble() const
246
0
  {
247
0
    MOZ_ASSERT(IsUnrestrictedDouble(), "Wrong type!");
248
0
    return mValue.mUnrestrictedDouble.Value();
249
0
  }
250
251
  KeyframeAnimationOptions&
252
  RawSetAsKeyframeAnimationOptions();
253
254
  KeyframeAnimationOptions&
255
  SetAsKeyframeAnimationOptions();
256
257
  bool
258
  TrySetToKeyframeAnimationOptions(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
259
260
  inline bool
261
  IsKeyframeAnimationOptions() const
262
0
  {
263
0
    return mType == eKeyframeAnimationOptions;
264
0
  }
265
266
  inline KeyframeAnimationOptions&
267
  GetAsKeyframeAnimationOptions()
268
0
  {
269
0
    MOZ_ASSERT(IsKeyframeAnimationOptions(), "Wrong type!");
270
0
    return mValue.mKeyframeAnimationOptions.Value();
271
0
  }
272
273
  inline KeyframeAnimationOptions const &
274
  GetAsKeyframeAnimationOptions() const
275
0
  {
276
0
    MOZ_ASSERT(IsKeyframeAnimationOptions(), "Wrong type!");
277
0
    return mValue.mKeyframeAnimationOptions.Value();
278
0
  }
279
280
  void
281
  Uninit();
282
283
  bool
284
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
285
286
  void
287
  TraceUnion(JSTracer* trc);
288
289
  OwningUnrestrictedDoubleOrKeyframeAnimationOptions&
290
  operator=(const OwningUnrestrictedDoubleOrKeyframeAnimationOptions& aOther);
291
292
private:
293
  void
294
  DestroyUnrestrictedDouble();
295
296
  void
297
  DestroyKeyframeAnimationOptions();
298
};
299
300
301
} // namespace dom
302
} // namespace mozilla
303
304
#endif // mozilla_dom_KeyframeAnimationOptionsBinding_h