Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dom/bindings/SVGUseElementBinding.cpp
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM SVGUseElement.webidl BY Codegen.py - DO NOT EDIT */
2
3
#include "SVGGraphicsElementBinding.h"
4
#include "SVGUseElementBinding.h"
5
#include "WrapperFactory.h"
6
#include "mozilla/OwningNonNull.h"
7
#include "mozilla/dom/BindingUtils.h"
8
#include "mozilla/dom/DOMJSClass.h"
9
#include "mozilla/dom/NonRefcountedDOMObject.h"
10
#include "mozilla/dom/SVGAnimatedLength.h"
11
#include "mozilla/dom/SVGAnimatedString.h"
12
#include "mozilla/dom/SVGUseElement.h"
13
#include "mozilla/dom/XrayExpandoClass.h"
14
15
namespace mozilla {
16
namespace dom {
17
18
namespace binding_detail {}; // Just to make sure it's known as a namespace
19
using namespace mozilla::dom::binding_detail;
20
21
22
namespace SVGUseElement_Binding {
23
24
static_assert(IsRefcounted<NativeType>::value == IsRefcounted<SVGGraphicsElement_Binding::NativeType>::value,
25
              "Can't inherit from an interface with a different ownership model.");
26
27
MOZ_CAN_RUN_SCRIPT static bool
28
get_x(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGUseElement* self, JSJitGetterCallArgs args)
29
0
{
30
0
  AUTO_PROFILER_LABEL_FAST("get SVGUseElement.x", DOM, cx);
31
0
32
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->X()));
33
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
34
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
35
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
36
0
    return false;
37
0
  }
38
0
  return true;
39
0
}
40
41
static const JSJitInfo x_getterinfo = {
42
  { (JSJitGetterOp)get_x },
43
  { prototypes::id::SVGUseElement },
44
  { PrototypeTraits<prototypes::id::SVGUseElement>::Depth },
45
  JSJitInfo::Getter,
46
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
47
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
48
  false,  /* isInfallible. False in setters. */
49
  true,  /* isMovable.  Not relevant for setters. */
50
  true, /* isEliminatable.  Not relevant for setters. */
51
  false, /* isAlwaysInSlot.  Only relevant for getters. */
52
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
53
  false,  /* isTypedMethod.  Only relevant for methods. */
54
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
55
};
56
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
57
static_assert(0 < 1, "There is no slot for us");
58
59
MOZ_CAN_RUN_SCRIPT static bool
60
get_y(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGUseElement* self, JSJitGetterCallArgs args)
61
0
{
62
0
  AUTO_PROFILER_LABEL_FAST("get SVGUseElement.y", DOM, cx);
63
0
64
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->Y()));
65
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
66
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
67
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
68
0
    return false;
69
0
  }
70
0
  return true;
71
0
}
72
73
static const JSJitInfo y_getterinfo = {
74
  { (JSJitGetterOp)get_y },
75
  { prototypes::id::SVGUseElement },
76
  { PrototypeTraits<prototypes::id::SVGUseElement>::Depth },
77
  JSJitInfo::Getter,
78
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
79
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
80
  false,  /* isInfallible. False in setters. */
81
  true,  /* isMovable.  Not relevant for setters. */
82
  true, /* isEliminatable.  Not relevant for setters. */
83
  false, /* isAlwaysInSlot.  Only relevant for getters. */
84
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
85
  false,  /* isTypedMethod.  Only relevant for methods. */
86
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
87
};
88
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
89
static_assert(0 < 1, "There is no slot for us");
90
91
MOZ_CAN_RUN_SCRIPT static bool
92
get_width(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGUseElement* self, JSJitGetterCallArgs args)
93
0
{
94
0
  AUTO_PROFILER_LABEL_FAST("get SVGUseElement.width", DOM, cx);
95
0
96
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->Width()));
97
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
98
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
99
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
100
0
    return false;
101
0
  }
102
0
  return true;
103
0
}
104
105
static const JSJitInfo width_getterinfo = {
106
  { (JSJitGetterOp)get_width },
107
  { prototypes::id::SVGUseElement },
108
  { PrototypeTraits<prototypes::id::SVGUseElement>::Depth },
109
  JSJitInfo::Getter,
110
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
111
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
112
  false,  /* isInfallible. False in setters. */
113
  true,  /* isMovable.  Not relevant for setters. */
114
  true, /* isEliminatable.  Not relevant for setters. */
115
  false, /* isAlwaysInSlot.  Only relevant for getters. */
116
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
117
  false,  /* isTypedMethod.  Only relevant for methods. */
118
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
119
};
120
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
121
static_assert(0 < 1, "There is no slot for us");
122
123
MOZ_CAN_RUN_SCRIPT static bool
124
get_height(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGUseElement* self, JSJitGetterCallArgs args)
125
0
{
126
0
  AUTO_PROFILER_LABEL_FAST("get SVGUseElement.height", DOM, cx);
127
0
128
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedLength>(self->Height()));
129
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
130
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
131
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
132
0
    return false;
133
0
  }
134
0
  return true;
135
0
}
136
137
static const JSJitInfo height_getterinfo = {
138
  { (JSJitGetterOp)get_height },
139
  { prototypes::id::SVGUseElement },
140
  { PrototypeTraits<prototypes::id::SVGUseElement>::Depth },
141
  JSJitInfo::Getter,
142
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
143
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
144
  false,  /* isInfallible. False in setters. */
145
  true,  /* isMovable.  Not relevant for setters. */
146
  true, /* isEliminatable.  Not relevant for setters. */
147
  false, /* isAlwaysInSlot.  Only relevant for getters. */
148
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
149
  false,  /* isTypedMethod.  Only relevant for methods. */
150
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
151
};
152
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
153
static_assert(0 < 1, "There is no slot for us");
154
155
MOZ_CAN_RUN_SCRIPT static bool
156
get_href(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::SVGUseElement* self, JSJitGetterCallArgs args)
157
0
{
158
0
  AUTO_PROFILER_LABEL_FAST("get SVGUseElement.href", DOM, cx);
159
0
160
0
  auto result(StrongOrRawPtr<mozilla::dom::SVGAnimatedString>(self->Href()));
161
0
  MOZ_ASSERT(!JS_IsExceptionPending(cx));
162
0
  if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
163
0
    MOZ_ASSERT(JS_IsExceptionPending(cx));
164
0
    return false;
165
0
  }
166
0
  return true;
167
0
}
168
169
static const JSJitInfo href_getterinfo = {
170
  { (JSJitGetterOp)get_href },
171
  { prototypes::id::SVGUseElement },
172
  { PrototypeTraits<prototypes::id::SVGUseElement>::Depth },
173
  JSJitInfo::Getter,
174
  JSJitInfo::AliasNone, /* aliasSet.  Not relevant for setters. */
175
  JSVAL_TYPE_OBJECT,  /* returnType.  Not relevant for setters. */
176
  false,  /* isInfallible. False in setters. */
177
  true,  /* isMovable.  Not relevant for setters. */
178
  true, /* isEliminatable.  Not relevant for setters. */
179
  false, /* isAlwaysInSlot.  Only relevant for getters. */
180
  false, /* isLazilyCachedInSlot.  Only relevant for getters. */
181
  false,  /* isTypedMethod.  Only relevant for methods. */
182
  0   /* Reserved slot index, if we're stored in a slot, else 0. */
183
};
184
static_assert(0 <= JSJitInfo::maxSlotIndex, "We won't fit");
185
static_assert(0 < 1, "There is no slot for us");
186
187
static bool
188
_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
189
0
{
190
0
  mozilla::dom::SVGUseElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGUseElement>(obj);
191
0
  // We don't want to preserve if we don't have a wrapper, and we
192
0
  // obviously can't preserve if we're not initialized.
193
0
  if (self && self->GetWrapperPreserveColor()) {
194
0
    PreserveWrapper(self);
195
0
  }
196
0
  return true;
197
0
}
198
199
static void
200
_finalize(js::FreeOp* fop, JSObject* obj)
201
0
{
202
0
  mozilla::dom::SVGUseElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGUseElement>(obj);
203
0
  if (self) {
204
0
    ClearWrapper(self, self, obj);
205
0
    AddForDeferredFinalization<mozilla::dom::SVGUseElement>(self);
206
0
  }
207
0
}
208
209
static size_t
210
_objectMoved(JSObject* obj, JSObject* old)
211
0
{
212
0
  mozilla::dom::SVGUseElement* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::SVGUseElement>(obj);
213
0
  if (self) {
214
0
    UpdateWrapper(self, self, obj, old);
215
0
  }
216
0
217
0
  return 0;
218
0
}
219
220
// We deliberately use brace-elision to make Visual Studio produce better initalization code.
221
#if defined(__clang__)
222
#pragma clang diagnostic push
223
#pragma clang diagnostic ignored "-Wmissing-braces"
224
#endif
225
static const JSPropertySpec sAttributes_specs[] = {
226
  { "x", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &x_getterinfo, nullptr, nullptr },
227
  { "y", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &y_getterinfo, nullptr, nullptr },
228
  { "width", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &width_getterinfo, nullptr, nullptr },
229
  { "height", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &height_getterinfo, nullptr, nullptr },
230
  { "href", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &href_getterinfo, nullptr, nullptr },
231
  { nullptr, 0, nullptr, nullptr, nullptr, nullptr }
232
};
233
#if defined(__clang__)
234
#pragma clang diagnostic pop
235
#endif
236
237
238
static const Prefable<const JSPropertySpec> sAttributes[] = {
239
  { nullptr, &sAttributes_specs[0] },
240
  { nullptr, nullptr }
241
};
242
243
static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX,
244
    "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
245
static_assert(5 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX,
246
    "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
247
248
249
static uint16_t sNativeProperties_sortedPropertyIndices[5];
250
static PropertyInfo sNativeProperties_propertyInfos[5];
251
252
static const NativePropertiesN<1> sNativeProperties = {
253
  false, 0,
254
  false, 0,
255
  false, 0,
256
  true,  0 /* sAttributes */,
257
  false, 0,
258
  false, 0,
259
  false, 0,
260
  -1,
261
  5,
262
  sNativeProperties_sortedPropertyIndices,
263
  {
264
    { sAttributes, &sNativeProperties_propertyInfos[0] }
265
  }
266
};
267
static_assert(5 < 1ull << CHAR_BIT * sizeof(sNativeProperties.propertyInfoCount),
268
    "We have a property info count that is oversized");
269
270
static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
271
  {
272
    "Function",
273
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE),
274
    &sBoringInterfaceObjectClassClassOps,
275
    JS_NULL_CLASS_SPEC,
276
    JS_NULL_CLASS_EXT,
277
    &sInterfaceObjectClassObjectOps
278
  },
279
  eInterface,
280
  true,
281
  prototypes::id::SVGUseElement,
282
  PrototypeTraits<prototypes::id::SVGUseElement>::Depth,
283
  sNativePropertyHooks,
284
  "function SVGUseElement() {\n    [native code]\n}",
285
  SVGGraphicsElement_Binding::GetConstructorObject
286
};
287
288
static const DOMIfaceAndProtoJSClass sPrototypeClass = {
289
  {
290
    "SVGUseElementPrototype",
291
    JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE),
292
    JS_NULL_CLASS_OPS,
293
    JS_NULL_CLASS_SPEC,
294
    JS_NULL_CLASS_EXT,
295
    JS_NULL_OBJECT_OPS
296
  },
297
  eInterfacePrototype,
298
  false,
299
  prototypes::id::SVGUseElement,
300
  PrototypeTraits<prototypes::id::SVGUseElement>::Depth,
301
  sNativePropertyHooks,
302
  "[object SVGUseElementPrototype]",
303
  SVGGraphicsElement_Binding::GetProtoObject
304
};
305
306
static const js::ClassOps sClassOps = {
307
  _addProperty, /* addProperty */
308
  nullptr,               /* delProperty */
309
  nullptr,               /* enumerate */
310
  nullptr, /* newEnumerate */
311
  nullptr, /* resolve */
312
  nullptr, /* mayResolve */
313
  _finalize, /* finalize */
314
  nullptr, /* call */
315
  nullptr,               /* hasInstance */
316
  nullptr,               /* construct */
317
  nullptr, /* trace */
318
};
319
320
static const js::ClassExtension sClassExtension = {
321
  nullptr, /* weakmapKeyDelegateOp */
322
  _objectMoved /* objectMovedOp */
323
};
324
325
static const DOMJSClass sClass = {
326
  { "SVGUseElement",
327
    JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
328
    &sClassOps,
329
    JS_NULL_CLASS_SPEC,
330
    &sClassExtension,
331
    JS_NULL_OBJECT_OPS
332
  },
333
  { prototypes::id::EventTarget, prototypes::id::Node, prototypes::id::Element, prototypes::id::SVGElement, prototypes::id::SVGGraphicsElement, prototypes::id::SVGUseElement, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
334
  IsBaseOf<nsISupports, mozilla::dom::SVGUseElement >::value,
335
  sNativePropertyHooks,
336
  FindAssociatedGlobalForNative<mozilla::dom::SVGUseElement>::Get,
337
  GetProtoObjectHandle,
338
  GetCCParticipant<mozilla::dom::SVGUseElement>::Get()
339
};
340
static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS,
341
              "Must have the right minimal number of reserved slots.");
342
static_assert(1 >= 1,
343
              "Must have enough reserved slots.");
344
345
const JSClass*
346
GetJSClass()
347
0
{
348
0
  return sClass.ToJSClass();
349
0
}
350
351
bool
352
Wrap(JSContext* aCx, mozilla::dom::SVGUseElement* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
353
0
{
354
0
  static_assert(!IsBaseOf<NonRefcountedDOMObject, mozilla::dom::SVGUseElement>::value,
355
0
                "Shouldn't have wrappercached things that are not refcounted.");
356
0
  MOZ_ASSERT(static_cast<mozilla::dom::SVGUseElement*>(aObject) ==
357
0
             reinterpret_cast<mozilla::dom::SVGUseElement*>(aObject),
358
0
             "Multiple inheritance for mozilla::dom::SVGUseElement is broken.");
359
0
  MOZ_ASSERT(static_cast<mozilla::dom::SVGGraphicsElement*>(aObject) ==
360
0
             reinterpret_cast<mozilla::dom::SVGGraphicsElement*>(aObject),
361
0
             "Multiple inheritance for mozilla::dom::SVGGraphicsElement is broken.");
362
0
  MOZ_ASSERT(static_cast<nsSVGElement*>(aObject) ==
363
0
             reinterpret_cast<nsSVGElement*>(aObject),
364
0
             "Multiple inheritance for nsSVGElement is broken.");
365
0
  MOZ_ASSERT(static_cast<mozilla::dom::Element*>(aObject) ==
366
0
             reinterpret_cast<mozilla::dom::Element*>(aObject),
367
0
             "Multiple inheritance for mozilla::dom::Element is broken.");
368
0
  MOZ_ASSERT(static_cast<nsINode*>(aObject) ==
369
0
             reinterpret_cast<nsINode*>(aObject),
370
0
             "Multiple inheritance for nsINode is broken.");
371
0
  MOZ_ASSERT(static_cast<mozilla::dom::EventTarget*>(aObject) ==
372
0
             reinterpret_cast<mozilla::dom::EventTarget*>(aObject),
373
0
             "Multiple inheritance for mozilla::dom::EventTarget is broken.");
374
0
  MOZ_ASSERT(ToSupportsIsCorrect(aObject));
375
0
  MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx));
376
0
  MOZ_ASSERT(!aCache->GetWrapper(),
377
0
             "You should probably not be using Wrap() directly; use "
378
0
             "GetOrCreateDOMReflector instead");
379
0
380
0
  MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
381
0
             "nsISupports must be on our primary inheritance chain");
382
0
383
0
  JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
384
0
  if (!global) {
385
0
    return false;
386
0
  }
387
0
  MOZ_ASSERT(JS_IsGlobalObject(global));
388
0
  MOZ_ASSERT(JS::ObjectIsNotGray(global));
389
0
390
0
  // That might have ended up wrapping us already, due to the wonders
391
0
  // of XBL.  Check for that, and bail out as needed.
392
0
  aReflector.set(aCache->GetWrapper());
393
0
  if (aReflector) {
394
#ifdef DEBUG
395
    AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
396
#endif // DEBUG
397
    return true;
398
0
  }
399
0
400
0
  JSAutoRealm ar(aCx, global);
401
0
  JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
402
0
  if (!canonicalProto) {
403
0
    return false;
404
0
  }
405
0
  JS::Rooted<JSObject*> proto(aCx);
406
0
  if (aGivenProto) {
407
0
    proto = aGivenProto;
408
0
    // Unfortunately, while aGivenProto was in the compartment of aCx
409
0
    // coming in, we changed compartments to that of "parent" so may need
410
0
    // to wrap the proto here.
411
0
    if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) {
412
0
      if (!JS_WrapObject(aCx, &proto)) {
413
0
        return false;
414
0
      }
415
0
    }
416
0
  } else {
417
0
    proto = canonicalProto;
418
0
  }
419
0
420
0
  BindingJSObjectCreator<mozilla::dom::SVGUseElement> creator(aCx);
421
0
  creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
422
0
  if (!aReflector) {
423
0
    return false;
424
0
  }
425
0
426
0
  aCache->SetWrapper(aReflector);
427
0
  creator.InitializationSucceeded();
428
0
429
0
  MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&
430
0
             aCache->GetWrapperPreserveColor() == aReflector);
431
0
  // If proto != canonicalProto, we have to preserve our wrapper;
432
0
  // otherwise we won't be able to properly recreate it later, since
433
0
  // we won't know what proto to use.  Note that we don't check
434
0
  // aGivenProto here, since it's entirely possible (and even
435
0
  // somewhat common) to have a non-null aGivenProto which is the
436
0
  // same as canonicalProto.
437
0
  if (proto != canonicalProto) {
438
0
    PreserveWrapper(aObject);
439
0
  }
440
0
441
0
  return true;
442
0
}
443
444
const NativePropertyHooks sNativePropertyHooks[] = { {
445
  nullptr,
446
  nullptr,
447
  nullptr,
448
  { sNativeProperties.Upcast(), nullptr },
449
  prototypes::id::SVGUseElement,
450
  constructors::id::SVGUseElement,
451
  SVGGraphicsElement_Binding::sNativePropertyHooks,
452
  &DefaultXrayExpandoObjectClass
453
} };
454
455
void
456
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal)
457
0
{
458
0
  JS::Handle<JSObject*> parentProto(SVGGraphicsElement_Binding::GetProtoObjectHandle(aCx));
459
0
  if (!parentProto) {
460
0
    return;
461
0
  }
462
0
463
0
  JS::Handle<JSObject*> constructorProto(SVGGraphicsElement_Binding::GetConstructorObjectHandle(aCx));
464
0
  if (!constructorProto) {
465
0
    return;
466
0
  }
467
0
468
0
  static bool sIdsInited = false;
469
0
  if (!sIdsInited && NS_IsMainThread()) {
470
0
    if (!InitIds(aCx, sNativeProperties.Upcast())) {
471
0
      return;
472
0
    }
473
0
    sIdsInited = true;
474
0
  }
475
0
476
0
  JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::SVGUseElement);
477
0
  JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::SVGUseElement);
478
0
  dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
479
0
                              &sPrototypeClass.mBase, protoCache,
480
0
                              nullptr,
481
0
                              constructorProto, &sInterfaceObjectClass.mBase, 0, nullptr,
482
0
                              interfaceCache,
483
0
                              sNativeProperties.Upcast(),
484
0
                              nullptr,
485
0
                              "SVGUseElement", aDefineOnGlobal,
486
0
                              nullptr,
487
0
                              false);
488
0
}
489
490
JSObject*
491
GetConstructorObject(JSContext* aCx)
492
0
{
493
0
  return GetConstructorObjectHandle(aCx);
494
0
}
495
496
} // namespace SVGUseElement_Binding
497
498
499
500
} // namespace dom
501
} // namespace mozilla