Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/WebGLRenderingContextBinding.h
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM WebGLRenderingContext.webidl BY Codegen.py - DO NOT EDIT */
2
3
#ifndef mozilla_dom_WebGLRenderingContextBinding_h
4
#define mozilla_dom_WebGLRenderingContextBinding_h
5
6
#include "GeckoProfiler.h"
7
#include "js/RootingAPI.h"
8
#include "jsfriendapi.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/PrototypeList.h"
15
#include "mozilla/dom/TypedArray.h"
16
#include "mozilla/dom/UnionMember.h"
17
18
namespace mozilla {
19
20
class WebGLActiveInfo;
21
struct WebGLActiveInfoAtoms;
22
class WebGLBuffer;
23
struct WebGLBufferAtoms;
24
class WebGLContext;
25
struct WebGLContextAtoms;
26
class WebGLExtensionBlendMinMax;
27
struct WebGLExtensionBlendMinMaxAtoms;
28
class WebGLExtensionColorBufferFloat;
29
struct WebGLExtensionColorBufferFloatAtoms;
30
class WebGLExtensionColorBufferHalfFloat;
31
struct WebGLExtensionColorBufferHalfFloatAtoms;
32
class WebGLExtensionCompressedTextureASTC;
33
struct WebGLExtensionCompressedTextureASTCAtoms;
34
class WebGLExtensionCompressedTextureATC;
35
struct WebGLExtensionCompressedTextureATCAtoms;
36
class WebGLExtensionCompressedTextureES3;
37
struct WebGLExtensionCompressedTextureES3Atoms;
38
class WebGLExtensionCompressedTextureETC1;
39
struct WebGLExtensionCompressedTextureETC1Atoms;
40
class WebGLExtensionCompressedTexturePVRTC;
41
struct WebGLExtensionCompressedTexturePVRTCAtoms;
42
class WebGLExtensionCompressedTextureS3TC;
43
struct WebGLExtensionCompressedTextureS3TCAtoms;
44
class WebGLExtensionCompressedTextureS3TC_SRGB;
45
struct WebGLExtensionCompressedTextureS3TC_SRGBAtoms;
46
class WebGLExtensionDebugRendererInfo;
47
struct WebGLExtensionDebugRendererInfoAtoms;
48
class WebGLExtensionDebugShaders;
49
struct WebGLExtensionDebugShadersAtoms;
50
class WebGLExtensionDepthTexture;
51
struct WebGLExtensionDepthTextureAtoms;
52
class WebGLExtensionDisjointTimerQuery;
53
struct WebGLExtensionDisjointTimerQueryAtoms;
54
class WebGLExtensionDrawBuffers;
55
struct WebGLExtensionDrawBuffersAtoms;
56
class WebGLExtensionElementIndexUint;
57
struct WebGLExtensionElementIndexUintAtoms;
58
class WebGLExtensionFragDepth;
59
struct WebGLExtensionFragDepthAtoms;
60
class WebGLExtensionInstancedArrays;
61
struct WebGLExtensionInstancedArraysAtoms;
62
class WebGLExtensionLoseContext;
63
struct WebGLExtensionLoseContextAtoms;
64
class WebGLExtensionMOZDebug;
65
struct WebGLExtensionMOZDebugAtoms;
66
class WebGLExtensionSRGB;
67
struct WebGLExtensionSRGBAtoms;
68
class WebGLExtensionShaderTextureLod;
69
struct WebGLExtensionShaderTextureLodAtoms;
70
class WebGLExtensionStandardDerivatives;
71
struct WebGLExtensionStandardDerivativesAtoms;
72
class WebGLExtensionTextureFilterAnisotropic;
73
struct WebGLExtensionTextureFilterAnisotropicAtoms;
74
class WebGLExtensionTextureFloat;
75
struct WebGLExtensionTextureFloatAtoms;
76
class WebGLExtensionTextureFloatLinear;
77
struct WebGLExtensionTextureFloatLinearAtoms;
78
class WebGLExtensionTextureHalfFloat;
79
struct WebGLExtensionTextureHalfFloatAtoms;
80
class WebGLExtensionTextureHalfFloatLinear;
81
struct WebGLExtensionTextureHalfFloatLinearAtoms;
82
class WebGLExtensionVertexArray;
83
struct WebGLExtensionVertexArrayAtoms;
84
class WebGLFramebuffer;
85
struct WebGLFramebufferAtoms;
86
class WebGLProgram;
87
struct WebGLProgramAtoms;
88
class WebGLQuery;
89
struct WebGLQueryAtoms;
90
class WebGLRenderbuffer;
91
struct WebGLRenderbufferAtoms;
92
class WebGLShader;
93
struct WebGLShaderAtoms;
94
class WebGLShaderPrecisionFormat;
95
struct WebGLShaderPrecisionFormatAtoms;
96
class WebGLTexture;
97
struct WebGLTextureAtoms;
98
class WebGLUniformLocation;
99
struct WebGLUniformLocationAtoms;
100
class WebGLVertexArray;
101
struct WebGLVertexArrayAtoms;
102
103
namespace dom {
104
105
class HTMLCanvasElement;
106
struct NativePropertyHooks;
107
class OffscreenCanvas;
108
class OwningHTMLCanvasElementOrOffscreenCanvas;
109
class ProtoAndIfaceCache;
110
struct WebGLContextAttributesAtoms;
111
112
} // namespace dom
113
114
} // namespace mozilla
115
116
namespace mozilla {
117
namespace dom {
118
119
enum class WebGLPowerPreference : uint8_t {
120
  Default,
121
  Low_power,
122
  High_performance,
123
  EndGuard_
124
};
125
126
namespace WebGLPowerPreferenceValues {
127
extern const EnumEntry strings[4];
128
} // namespace WebGLPowerPreferenceValues
129
130
bool
131
ToJSValue(JSContext* aCx, WebGLPowerPreference aArgument, JS::MutableHandle<JS::Value> aValue);
132
133
134
void
135
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback, OwningHTMLCanvasElementOrOffscreenCanvas& aUnion, const char* aName, uint32_t aFlags = 0);
136
137
138
void
139
ImplCycleCollectionUnlink(OwningHTMLCanvasElementOrOffscreenCanvas& aUnion);
140
141
142
class Float32ArrayOrUnrestrictedFloatSequence
143
{
144
  friend class Float32ArrayOrUnrestrictedFloatSequenceArgument;
145
  enum Type
146
  {
147
    eUninitialized,
148
    eFloat32Array,
149
    eUnrestrictedFloatSequence
150
  };
151
152
  union Value
153
  {
154
    UnionMember<RootedSpiderMonkeyInterface<Float32Array> > mFloat32Array;
155
    UnionMember<binding_detail::AutoSequence<float> > mUnrestrictedFloatSequence;
156
157
  };
158
159
  Type mType;
160
  Value mValue;
161
162
  Float32ArrayOrUnrestrictedFloatSequence(const Float32ArrayOrUnrestrictedFloatSequence&) = delete;
163
  Float32ArrayOrUnrestrictedFloatSequence& operator=(const Float32ArrayOrUnrestrictedFloatSequence&) = delete;
164
public:
165
  explicit inline Float32ArrayOrUnrestrictedFloatSequence()
166
    : mType(eUninitialized)
167
0
  {
168
0
  }
169
170
  inline ~Float32ArrayOrUnrestrictedFloatSequence()
171
0
  {
172
0
    Uninit();
173
0
  }
174
175
  inline RootedSpiderMonkeyInterface<Float32Array>&
176
  RawSetAsFloat32Array(JSContext* cx)
177
0
  {
178
0
    if (mType == eFloat32Array) {
179
0
      return mValue.mFloat32Array.Value();
180
0
    }
181
0
    MOZ_ASSERT(mType == eUninitialized);
182
0
    mType = eFloat32Array;
183
0
    return mValue.mFloat32Array.SetValue(cx);
184
0
  }
185
186
  inline RootedSpiderMonkeyInterface<Float32Array>&
187
  SetAsFloat32Array(JSContext* cx)
188
0
  {
189
0
    if (mType == eFloat32Array) {
190
0
      return mValue.mFloat32Array.Value();
191
0
    }
192
0
    Uninit();
193
0
    mType = eFloat32Array;
194
0
    return mValue.mFloat32Array.SetValue(cx);
195
0
  }
196
197
  inline bool
198
  IsFloat32Array() const
199
0
  {
200
0
    return mType == eFloat32Array;
201
0
  }
202
203
  inline RootedSpiderMonkeyInterface<Float32Array>&
204
  GetAsFloat32Array()
205
0
  {
206
0
    MOZ_ASSERT(IsFloat32Array(), "Wrong type!");
207
0
    return mValue.mFloat32Array.Value();
208
0
  }
209
210
  inline Float32Array const &
211
  GetAsFloat32Array() const
212
0
  {
213
0
    MOZ_ASSERT(IsFloat32Array(), "Wrong type!");
214
0
    return mValue.mFloat32Array.Value();
215
0
  }
216
217
  inline binding_detail::AutoSequence<float>&
218
  RawSetAsUnrestrictedFloatSequence()
219
0
  {
220
0
    if (mType == eUnrestrictedFloatSequence) {
221
0
      return mValue.mUnrestrictedFloatSequence.Value();
222
0
    }
223
0
    MOZ_ASSERT(mType == eUninitialized);
224
0
    mType = eUnrestrictedFloatSequence;
225
0
    return mValue.mUnrestrictedFloatSequence.SetValue();
226
0
  }
227
228
  inline binding_detail::AutoSequence<float>&
229
  SetAsUnrestrictedFloatSequence()
230
0
  {
231
0
    if (mType == eUnrestrictedFloatSequence) {
232
0
      return mValue.mUnrestrictedFloatSequence.Value();
233
0
    }
234
0
    Uninit();
235
0
    mType = eUnrestrictedFloatSequence;
236
0
    return mValue.mUnrestrictedFloatSequence.SetValue();
237
0
  }
238
239
  inline bool
240
  IsUnrestrictedFloatSequence() const
241
0
  {
242
0
    return mType == eUnrestrictedFloatSequence;
243
0
  }
244
245
  inline binding_detail::AutoSequence<float>&
246
  GetAsUnrestrictedFloatSequence()
247
0
  {
248
0
    MOZ_ASSERT(IsUnrestrictedFloatSequence(), "Wrong type!");
249
0
    return mValue.mUnrestrictedFloatSequence.Value();
250
0
  }
251
252
  inline const Sequence<float>&
253
  GetAsUnrestrictedFloatSequence() const
254
0
  {
255
0
    MOZ_ASSERT(IsUnrestrictedFloatSequence(), "Wrong type!");
256
0
    return mValue.mUnrestrictedFloatSequence.Value();
257
0
  }
258
259
  inline void
260
  Uninit()
261
  {
262
    switch (mType) {
263
      case eUninitialized: {
264
        break;
265
      }
266
      case eFloat32Array: {
267
        DestroyFloat32Array();
268
        break;
269
      }
270
      case eUnrestrictedFloatSequence: {
271
        DestroyUnrestrictedFloatSequence();
272
        break;
273
      }
274
    }
275
  }
276
277
  bool
278
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
279
280
private:
281
  inline void
282
  DestroyFloat32Array()
283
0
  {
284
0
    MOZ_ASSERT(IsFloat32Array(), "Wrong type!");
285
0
    mValue.mFloat32Array.Destroy();
286
0
    mType = eUninitialized;
287
0
  }
288
289
  inline void
290
  DestroyUnrestrictedFloatSequence()
291
0
  {
292
0
    MOZ_ASSERT(IsUnrestrictedFloatSequence(), "Wrong type!");
293
0
    mValue.mUnrestrictedFloatSequence.Destroy();
294
0
    mType = eUninitialized;
295
0
  }
296
};
297
298
299
class OwningFloat32ArrayOrUnrestrictedFloatSequence : public AllOwningUnionBase
300
{
301
  friend void ImplCycleCollectionUnlink(OwningFloat32ArrayOrUnrestrictedFloatSequence& aUnion);
302
  enum Type
303
  {
304
    eUninitialized,
305
    eFloat32Array,
306
    eUnrestrictedFloatSequence
307
  };
308
309
  union Value
310
  {
311
    UnionMember<Float32Array > mFloat32Array;
312
    UnionMember<Sequence<float> > mUnrestrictedFloatSequence;
313
314
  };
315
316
  Type mType;
317
  Value mValue;
318
319
  OwningFloat32ArrayOrUnrestrictedFloatSequence(const OwningFloat32ArrayOrUnrestrictedFloatSequence&) = delete;
320
  OwningFloat32ArrayOrUnrestrictedFloatSequence& operator=(const OwningFloat32ArrayOrUnrestrictedFloatSequence&) = delete;
321
public:
322
  explicit inline OwningFloat32ArrayOrUnrestrictedFloatSequence()
323
    : mType(eUninitialized)
324
0
  {
325
0
  }
326
327
  inline ~OwningFloat32ArrayOrUnrestrictedFloatSequence()
328
0
  {
329
0
    Uninit();
330
0
  }
331
332
  Float32Array&
333
  RawSetAsFloat32Array();
334
335
  Float32Array&
336
  SetAsFloat32Array();
337
338
  bool
339
  TrySetToFloat32Array(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
340
341
  inline bool
342
  IsFloat32Array() const
343
0
  {
344
0
    return mType == eFloat32Array;
345
0
  }
346
347
  inline Float32Array&
348
  GetAsFloat32Array()
349
0
  {
350
0
    MOZ_ASSERT(IsFloat32Array(), "Wrong type!");
351
0
    return mValue.mFloat32Array.Value();
352
0
  }
353
354
  inline Float32Array const &
355
  GetAsFloat32Array() const
356
0
  {
357
0
    MOZ_ASSERT(IsFloat32Array(), "Wrong type!");
358
0
    return mValue.mFloat32Array.Value();
359
0
  }
360
361
  Sequence<float>&
362
  RawSetAsUnrestrictedFloatSequence();
363
364
  Sequence<float>&
365
  SetAsUnrestrictedFloatSequence();
366
367
  bool
368
  TrySetToUnrestrictedFloatSequence(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
369
370
  inline bool
371
  IsUnrestrictedFloatSequence() const
372
0
  {
373
0
    return mType == eUnrestrictedFloatSequence;
374
0
  }
375
376
  inline Sequence<float>&
377
  GetAsUnrestrictedFloatSequence()
378
0
  {
379
0
    MOZ_ASSERT(IsUnrestrictedFloatSequence(), "Wrong type!");
380
0
    return mValue.mUnrestrictedFloatSequence.Value();
381
0
  }
382
383
  inline Sequence<float> const &
384
  GetAsUnrestrictedFloatSequence() const
385
0
  {
386
0
    MOZ_ASSERT(IsUnrestrictedFloatSequence(), "Wrong type!");
387
0
    return mValue.mUnrestrictedFloatSequence.Value();
388
0
  }
389
390
  void
391
  Uninit();
392
393
  bool
394
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
395
396
  void
397
  TraceUnion(JSTracer* trc);
398
399
private:
400
  void
401
  DestroyFloat32Array();
402
403
  void
404
  DestroyUnrestrictedFloatSequence();
405
};
406
407
408
class HTMLCanvasElementOrOffscreenCanvas
409
{
410
  friend class HTMLCanvasElementOrOffscreenCanvasArgument;
411
  enum Type
412
  {
413
    eUninitialized,
414
    eHTMLCanvasElement,
415
    eOffscreenCanvas
416
  };
417
418
  union Value
419
  {
420
    UnionMember<NonNull<mozilla::dom::HTMLCanvasElement> > mHTMLCanvasElement;
421
    UnionMember<NonNull<mozilla::dom::OffscreenCanvas> > mOffscreenCanvas;
422
423
  };
424
425
  Type mType;
426
  Value mValue;
427
428
  HTMLCanvasElementOrOffscreenCanvas(const HTMLCanvasElementOrOffscreenCanvas&) = delete;
429
  HTMLCanvasElementOrOffscreenCanvas& operator=(const HTMLCanvasElementOrOffscreenCanvas&) = delete;
430
public:
431
  explicit inline HTMLCanvasElementOrOffscreenCanvas()
432
    : mType(eUninitialized)
433
0
  {
434
0
  }
435
436
  inline ~HTMLCanvasElementOrOffscreenCanvas()
437
0
  {
438
0
    Uninit();
439
0
  }
440
441
  inline NonNull<mozilla::dom::HTMLCanvasElement>&
442
  RawSetAsHTMLCanvasElement()
443
0
  {
444
0
    if (mType == eHTMLCanvasElement) {
445
0
      return mValue.mHTMLCanvasElement.Value();
446
0
    }
447
0
    MOZ_ASSERT(mType == eUninitialized);
448
0
    mType = eHTMLCanvasElement;
449
0
    return mValue.mHTMLCanvasElement.SetValue();
450
0
  }
451
452
  inline NonNull<mozilla::dom::HTMLCanvasElement>&
453
  SetAsHTMLCanvasElement()
454
0
  {
455
0
    if (mType == eHTMLCanvasElement) {
456
0
      return mValue.mHTMLCanvasElement.Value();
457
0
    }
458
0
    Uninit();
459
0
    mType = eHTMLCanvasElement;
460
0
    return mValue.mHTMLCanvasElement.SetValue();
461
0
  }
462
463
  inline bool
464
  IsHTMLCanvasElement() const
465
0
  {
466
0
    return mType == eHTMLCanvasElement;
467
0
  }
468
469
  inline NonNull<mozilla::dom::HTMLCanvasElement>&
470
  GetAsHTMLCanvasElement()
471
0
  {
472
0
    MOZ_ASSERT(IsHTMLCanvasElement(), "Wrong type!");
473
0
    return mValue.mHTMLCanvasElement.Value();
474
0
  }
475
476
  inline mozilla::dom::HTMLCanvasElement&
477
  GetAsHTMLCanvasElement() const
478
0
  {
479
0
    MOZ_ASSERT(IsHTMLCanvasElement(), "Wrong type!");
480
0
    return mValue.mHTMLCanvasElement.Value();
481
0
  }
482
483
  inline NonNull<mozilla::dom::OffscreenCanvas>&
484
  RawSetAsOffscreenCanvas()
485
0
  {
486
0
    if (mType == eOffscreenCanvas) {
487
0
      return mValue.mOffscreenCanvas.Value();
488
0
    }
489
0
    MOZ_ASSERT(mType == eUninitialized);
490
0
    mType = eOffscreenCanvas;
491
0
    return mValue.mOffscreenCanvas.SetValue();
492
0
  }
493
494
  inline NonNull<mozilla::dom::OffscreenCanvas>&
495
  SetAsOffscreenCanvas()
496
0
  {
497
0
    if (mType == eOffscreenCanvas) {
498
0
      return mValue.mOffscreenCanvas.Value();
499
0
    }
500
0
    Uninit();
501
0
    mType = eOffscreenCanvas;
502
0
    return mValue.mOffscreenCanvas.SetValue();
503
0
  }
504
505
  inline bool
506
  IsOffscreenCanvas() const
507
0
  {
508
0
    return mType == eOffscreenCanvas;
509
0
  }
510
511
  inline NonNull<mozilla::dom::OffscreenCanvas>&
512
  GetAsOffscreenCanvas()
513
0
  {
514
0
    MOZ_ASSERT(IsOffscreenCanvas(), "Wrong type!");
515
0
    return mValue.mOffscreenCanvas.Value();
516
0
  }
517
518
  inline mozilla::dom::OffscreenCanvas&
519
  GetAsOffscreenCanvas() const
520
0
  {
521
0
    MOZ_ASSERT(IsOffscreenCanvas(), "Wrong type!");
522
0
    return mValue.mOffscreenCanvas.Value();
523
0
  }
524
525
  inline void
526
  Uninit()
527
0
  {
528
0
    switch (mType) {
529
0
      case eUninitialized: {
530
0
        break;
531
0
      }
532
0
      case eHTMLCanvasElement: {
533
0
        DestroyHTMLCanvasElement();
534
0
        break;
535
0
      }
536
0
      case eOffscreenCanvas: {
537
0
        DestroyOffscreenCanvas();
538
0
        break;
539
0
      }
540
0
    }
541
0
  }
542
543
  bool
544
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
545
546
private:
547
  inline void
548
  DestroyHTMLCanvasElement()
549
0
  {
550
0
    MOZ_ASSERT(IsHTMLCanvasElement(), "Wrong type!");
551
0
    mValue.mHTMLCanvasElement.Destroy();
552
0
    mType = eUninitialized;
553
0
  }
554
555
  inline void
556
  DestroyOffscreenCanvas()
557
0
  {
558
0
    MOZ_ASSERT(IsOffscreenCanvas(), "Wrong type!");
559
0
    mValue.mOffscreenCanvas.Destroy();
560
0
    mType = eUninitialized;
561
0
  }
562
};
563
564
565
class OwningHTMLCanvasElementOrOffscreenCanvas : public AllOwningUnionBase
566
{
567
  friend void ImplCycleCollectionUnlink(OwningHTMLCanvasElementOrOffscreenCanvas& aUnion);
568
  enum Type
569
  {
570
    eUninitialized,
571
    eHTMLCanvasElement,
572
    eOffscreenCanvas
573
  };
574
575
  union Value
576
  {
577
    UnionMember<OwningNonNull<mozilla::dom::HTMLCanvasElement> > mHTMLCanvasElement;
578
    UnionMember<OwningNonNull<mozilla::dom::OffscreenCanvas> > mOffscreenCanvas;
579
580
  };
581
582
  Type mType;
583
  Value mValue;
584
585
public:
586
  explicit inline OwningHTMLCanvasElementOrOffscreenCanvas()
587
    : mType(eUninitialized)
588
0
  {
589
0
  }
590
591
  explicit inline OwningHTMLCanvasElementOrOffscreenCanvas(const OwningHTMLCanvasElementOrOffscreenCanvas& aOther)
592
    : mType(eUninitialized)
593
0
  {
594
0
    *this = aOther;
595
0
  }
596
597
  inline ~OwningHTMLCanvasElementOrOffscreenCanvas()
598
0
  {
599
0
    Uninit();
600
0
  }
601
602
  OwningNonNull<mozilla::dom::HTMLCanvasElement>&
603
  RawSetAsHTMLCanvasElement();
604
605
  OwningNonNull<mozilla::dom::HTMLCanvasElement>&
606
  SetAsHTMLCanvasElement();
607
608
  bool
609
  TrySetToHTMLCanvasElement(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
610
611
  inline bool
612
  IsHTMLCanvasElement() const
613
0
  {
614
0
    return mType == eHTMLCanvasElement;
615
0
  }
616
617
  inline OwningNonNull<mozilla::dom::HTMLCanvasElement>&
618
  GetAsHTMLCanvasElement()
619
0
  {
620
0
    MOZ_ASSERT(IsHTMLCanvasElement(), "Wrong type!");
621
0
    return mValue.mHTMLCanvasElement.Value();
622
0
  }
623
624
  inline OwningNonNull<mozilla::dom::HTMLCanvasElement> const &
625
  GetAsHTMLCanvasElement() const
626
0
  {
627
0
    MOZ_ASSERT(IsHTMLCanvasElement(), "Wrong type!");
628
0
    return mValue.mHTMLCanvasElement.Value();
629
0
  }
630
631
  OwningNonNull<mozilla::dom::OffscreenCanvas>&
632
  RawSetAsOffscreenCanvas();
633
634
  OwningNonNull<mozilla::dom::OffscreenCanvas>&
635
  SetAsOffscreenCanvas();
636
637
  bool
638
  TrySetToOffscreenCanvas(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
639
640
  inline bool
641
  IsOffscreenCanvas() const
642
0
  {
643
0
    return mType == eOffscreenCanvas;
644
0
  }
645
646
  inline OwningNonNull<mozilla::dom::OffscreenCanvas>&
647
  GetAsOffscreenCanvas()
648
0
  {
649
0
    MOZ_ASSERT(IsOffscreenCanvas(), "Wrong type!");
650
0
    return mValue.mOffscreenCanvas.Value();
651
0
  }
652
653
  inline OwningNonNull<mozilla::dom::OffscreenCanvas> const &
654
  GetAsOffscreenCanvas() const
655
0
  {
656
0
    MOZ_ASSERT(IsOffscreenCanvas(), "Wrong type!");
657
0
    return mValue.mOffscreenCanvas.Value();
658
0
  }
659
660
  void
661
  Uninit();
662
663
  bool
664
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
665
666
  void
667
  TraceUnion(JSTracer* trc);
668
669
  OwningHTMLCanvasElementOrOffscreenCanvas&
670
  operator=(const OwningHTMLCanvasElementOrOffscreenCanvas& aOther);
671
672
private:
673
  void
674
  DestroyHTMLCanvasElement();
675
676
  void
677
  DestroyOffscreenCanvas();
678
};
679
680
681
class Int32ArrayOrLongSequence
682
{
683
  friend class Int32ArrayOrLongSequenceArgument;
684
  enum Type
685
  {
686
    eUninitialized,
687
    eInt32Array,
688
    eLongSequence
689
  };
690
691
  union Value
692
  {
693
    UnionMember<RootedSpiderMonkeyInterface<Int32Array> > mInt32Array;
694
    UnionMember<binding_detail::AutoSequence<int32_t> > mLongSequence;
695
696
  };
697
698
  Type mType;
699
  Value mValue;
700
701
  Int32ArrayOrLongSequence(const Int32ArrayOrLongSequence&) = delete;
702
  Int32ArrayOrLongSequence& operator=(const Int32ArrayOrLongSequence&) = delete;
703
public:
704
  explicit inline Int32ArrayOrLongSequence()
705
    : mType(eUninitialized)
706
0
  {
707
0
  }
708
709
  inline ~Int32ArrayOrLongSequence()
710
0
  {
711
0
    Uninit();
712
0
  }
713
714
  inline RootedSpiderMonkeyInterface<Int32Array>&
715
  RawSetAsInt32Array(JSContext* cx)
716
0
  {
717
0
    if (mType == eInt32Array) {
718
0
      return mValue.mInt32Array.Value();
719
0
    }
720
0
    MOZ_ASSERT(mType == eUninitialized);
721
0
    mType = eInt32Array;
722
0
    return mValue.mInt32Array.SetValue(cx);
723
0
  }
724
725
  inline RootedSpiderMonkeyInterface<Int32Array>&
726
  SetAsInt32Array(JSContext* cx)
727
0
  {
728
0
    if (mType == eInt32Array) {
729
0
      return mValue.mInt32Array.Value();
730
0
    }
731
0
    Uninit();
732
0
    mType = eInt32Array;
733
0
    return mValue.mInt32Array.SetValue(cx);
734
0
  }
735
736
  inline bool
737
  IsInt32Array() const
738
0
  {
739
0
    return mType == eInt32Array;
740
0
  }
741
742
  inline RootedSpiderMonkeyInterface<Int32Array>&
743
  GetAsInt32Array()
744
0
  {
745
0
    MOZ_ASSERT(IsInt32Array(), "Wrong type!");
746
0
    return mValue.mInt32Array.Value();
747
0
  }
748
749
  inline Int32Array const &
750
  GetAsInt32Array() const
751
0
  {
752
0
    MOZ_ASSERT(IsInt32Array(), "Wrong type!");
753
0
    return mValue.mInt32Array.Value();
754
0
  }
755
756
  inline binding_detail::AutoSequence<int32_t>&
757
  RawSetAsLongSequence()
758
0
  {
759
0
    if (mType == eLongSequence) {
760
0
      return mValue.mLongSequence.Value();
761
0
    }
762
0
    MOZ_ASSERT(mType == eUninitialized);
763
0
    mType = eLongSequence;
764
0
    return mValue.mLongSequence.SetValue();
765
0
  }
766
767
  inline binding_detail::AutoSequence<int32_t>&
768
  SetAsLongSequence()
769
0
  {
770
0
    if (mType == eLongSequence) {
771
0
      return mValue.mLongSequence.Value();
772
0
    }
773
0
    Uninit();
774
0
    mType = eLongSequence;
775
0
    return mValue.mLongSequence.SetValue();
776
0
  }
777
778
  inline bool
779
  IsLongSequence() const
780
0
  {
781
0
    return mType == eLongSequence;
782
0
  }
783
784
  inline binding_detail::AutoSequence<int32_t>&
785
  GetAsLongSequence()
786
0
  {
787
0
    MOZ_ASSERT(IsLongSequence(), "Wrong type!");
788
0
    return mValue.mLongSequence.Value();
789
0
  }
790
791
  inline const Sequence<int32_t>&
792
  GetAsLongSequence() const
793
0
  {
794
0
    MOZ_ASSERT(IsLongSequence(), "Wrong type!");
795
0
    return mValue.mLongSequence.Value();
796
0
  }
797
798
  inline void
799
  Uninit()
800
  {
801
    switch (mType) {
802
      case eUninitialized: {
803
        break;
804
      }
805
      case eInt32Array: {
806
        DestroyInt32Array();
807
        break;
808
      }
809
      case eLongSequence: {
810
        DestroyLongSequence();
811
        break;
812
      }
813
    }
814
  }
815
816
  bool
817
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
818
819
private:
820
  inline void
821
  DestroyInt32Array()
822
0
  {
823
0
    MOZ_ASSERT(IsInt32Array(), "Wrong type!");
824
0
    mValue.mInt32Array.Destroy();
825
0
    mType = eUninitialized;
826
0
  }
827
828
  inline void
829
  DestroyLongSequence()
830
0
  {
831
0
    MOZ_ASSERT(IsLongSequence(), "Wrong type!");
832
0
    mValue.mLongSequence.Destroy();
833
0
    mType = eUninitialized;
834
0
  }
835
};
836
837
838
class OwningInt32ArrayOrLongSequence : public AllOwningUnionBase
839
{
840
  friend void ImplCycleCollectionUnlink(OwningInt32ArrayOrLongSequence& aUnion);
841
  enum Type
842
  {
843
    eUninitialized,
844
    eInt32Array,
845
    eLongSequence
846
  };
847
848
  union Value
849
  {
850
    UnionMember<Int32Array > mInt32Array;
851
    UnionMember<Sequence<int32_t> > mLongSequence;
852
853
  };
854
855
  Type mType;
856
  Value mValue;
857
858
  OwningInt32ArrayOrLongSequence(const OwningInt32ArrayOrLongSequence&) = delete;
859
  OwningInt32ArrayOrLongSequence& operator=(const OwningInt32ArrayOrLongSequence&) = delete;
860
public:
861
  explicit inline OwningInt32ArrayOrLongSequence()
862
    : mType(eUninitialized)
863
0
  {
864
0
  }
865
866
  inline ~OwningInt32ArrayOrLongSequence()
867
0
  {
868
0
    Uninit();
869
0
  }
870
871
  Int32Array&
872
  RawSetAsInt32Array();
873
874
  Int32Array&
875
  SetAsInt32Array();
876
877
  bool
878
  TrySetToInt32Array(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
879
880
  inline bool
881
  IsInt32Array() const
882
0
  {
883
0
    return mType == eInt32Array;
884
0
  }
885
886
  inline Int32Array&
887
  GetAsInt32Array()
888
0
  {
889
0
    MOZ_ASSERT(IsInt32Array(), "Wrong type!");
890
0
    return mValue.mInt32Array.Value();
891
0
  }
892
893
  inline Int32Array const &
894
  GetAsInt32Array() const
895
0
  {
896
0
    MOZ_ASSERT(IsInt32Array(), "Wrong type!");
897
0
    return mValue.mInt32Array.Value();
898
0
  }
899
900
  Sequence<int32_t>&
901
  RawSetAsLongSequence();
902
903
  Sequence<int32_t>&
904
  SetAsLongSequence();
905
906
  bool
907
  TrySetToLongSequence(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
908
909
  inline bool
910
  IsLongSequence() const
911
0
  {
912
0
    return mType == eLongSequence;
913
0
  }
914
915
  inline Sequence<int32_t>&
916
  GetAsLongSequence()
917
0
  {
918
0
    MOZ_ASSERT(IsLongSequence(), "Wrong type!");
919
0
    return mValue.mLongSequence.Value();
920
0
  }
921
922
  inline Sequence<int32_t> const &
923
  GetAsLongSequence() const
924
0
  {
925
0
    MOZ_ASSERT(IsLongSequence(), "Wrong type!");
926
0
    return mValue.mLongSequence.Value();
927
0
  }
928
929
  void
930
  Uninit();
931
932
  bool
933
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
934
935
  void
936
  TraceUnion(JSTracer* trc);
937
938
private:
939
  void
940
  DestroyInt32Array();
941
942
  void
943
  DestroyLongSequence();
944
};
945
946
947
struct WebGLContextAttributes : public DictionaryBase
948
{
949
  MOZ_INIT_OUTSIDE_CTOR Optional<bool> mAlpha;
950
  MOZ_INIT_OUTSIDE_CTOR bool mAntialias;
951
  MOZ_INIT_OUTSIDE_CTOR bool mDepth;
952
  MOZ_INIT_OUTSIDE_CTOR bool mFailIfMajorPerformanceCaveat;
953
  MOZ_INIT_OUTSIDE_CTOR WebGLPowerPreference mPowerPreference;
954
  MOZ_INIT_OUTSIDE_CTOR bool mPremultipliedAlpha;
955
  MOZ_INIT_OUTSIDE_CTOR bool mPreserveDrawingBuffer;
956
  MOZ_INIT_OUTSIDE_CTOR bool mStencil;
957
958
  WebGLContextAttributes();
959
960
  explicit inline WebGLContextAttributes(const FastDictionaryInitializer& )
961
0
  {
962
0
    // Do nothing here; this is used by our "Fast" subclass
963
0
  }
964
965
  explicit inline WebGLContextAttributes(const WebGLContextAttributes& aOther)
966
0
  {
967
0
    *this = aOther;
968
0
  }
969
970
  bool
971
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
972
973
  bool
974
  Init(const nsAString& aJSON);
975
976
  bool
977
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
978
979
  bool
980
  ToJSON(nsAString& aJSON) const;
981
982
  void
983
  TraceDictionary(JSTracer* trc);
984
985
  WebGLContextAttributes&
986
  operator=(const WebGLContextAttributes& aOther);
987
988
private:
989
  static bool
990
  InitIds(JSContext* cx, WebGLContextAttributesAtoms* atomsCache);
991
};
992
993
namespace binding_detail {
994
struct FastWebGLContextAttributes : public WebGLContextAttributes
995
{
996
  inline FastWebGLContextAttributes()
997
    : WebGLContextAttributes(FastDictionaryInitializer())
998
0
  {
999
0
    // Doesn't matter what int we pass to the parent constructor
1000
0
  }
1001
};
1002
} // namespace binding_detail
1003
1004
1005
namespace ANGLE_instanced_arrays_Binding {
1006
1007
  typedef mozilla::WebGLExtensionInstancedArrays NativeType;
1008
1009
  static const uint32_t VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 35070;
1010
  const JSClass*
1011
  GetJSClass();
1012
1013
  bool
1014
  Wrap(JSContext* aCx, mozilla::WebGLExtensionInstancedArrays* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1015
1016
  template <class T>
1017
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1018
0
  {
1019
0
    JS::Rooted<JSObject*> reflector(aCx);
1020
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1021
0
  }
1022
1023
  // We declare this as an array so that retrieving a pointer to this
1024
  // binding's property hooks only requires compile/link-time resolvable
1025
  // address arithmetic.  Declaring it as a pointer instead would require
1026
  // doing a run-time load to fetch a pointer to this binding's property
1027
  // hooks.  And then structures which embedded a pointer to this structure
1028
  // would require a run-time load for proper initialization, which would
1029
  // then induce static constructors.  Lots of static constructors.
1030
  extern const NativePropertyHooks sNativePropertyHooks[];
1031
1032
  void
1033
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1034
1035
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1036
0
  {
1037
0
    /* Get the interface prototype object for this class.  This will create the
1038
0
       object as needed. */
1039
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::ANGLE_instanced_arrays,
1040
0
                                       &CreateInterfaceObjects,
1041
0
                                       /* aDefineOnGlobal = */ true);
1042
0
1043
0
  }
1044
1045
} // namespace ANGLE_instanced_arrays_Binding
1046
1047
1048
1049
namespace EXT_blend_minmax_Binding {
1050
1051
  typedef mozilla::WebGLExtensionBlendMinMax NativeType;
1052
1053
  static const uint32_t MIN_EXT = 32775;
1054
  static const uint32_t MAX_EXT = 32776;
1055
  const JSClass*
1056
  GetJSClass();
1057
1058
  bool
1059
  Wrap(JSContext* aCx, mozilla::WebGLExtensionBlendMinMax* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1060
1061
  template <class T>
1062
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1063
0
  {
1064
0
    JS::Rooted<JSObject*> reflector(aCx);
1065
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1066
0
  }
1067
1068
  // We declare this as an array so that retrieving a pointer to this
1069
  // binding's property hooks only requires compile/link-time resolvable
1070
  // address arithmetic.  Declaring it as a pointer instead would require
1071
  // doing a run-time load to fetch a pointer to this binding's property
1072
  // hooks.  And then structures which embedded a pointer to this structure
1073
  // would require a run-time load for proper initialization, which would
1074
  // then induce static constructors.  Lots of static constructors.
1075
  extern const NativePropertyHooks sNativePropertyHooks[];
1076
1077
  void
1078
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1079
1080
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1081
0
  {
1082
0
    /* Get the interface prototype object for this class.  This will create the
1083
0
       object as needed. */
1084
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::EXT_blend_minmax,
1085
0
                                       &CreateInterfaceObjects,
1086
0
                                       /* aDefineOnGlobal = */ true);
1087
0
1088
0
  }
1089
1090
} // namespace EXT_blend_minmax_Binding
1091
1092
1093
1094
namespace EXT_color_buffer_half_float_Binding {
1095
1096
  typedef mozilla::WebGLExtensionColorBufferHalfFloat NativeType;
1097
1098
  static const uint32_t RGBA16F_EXT = 34842;
1099
  static const uint32_t RGB16F_EXT = 34843;
1100
  static const uint32_t FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 33297;
1101
  static const uint32_t UNSIGNED_NORMALIZED_EXT = 35863;
1102
  const JSClass*
1103
  GetJSClass();
1104
1105
  bool
1106
  Wrap(JSContext* aCx, mozilla::WebGLExtensionColorBufferHalfFloat* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1107
1108
  template <class T>
1109
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1110
0
  {
1111
0
    JS::Rooted<JSObject*> reflector(aCx);
1112
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1113
0
  }
1114
1115
  // We declare this as an array so that retrieving a pointer to this
1116
  // binding's property hooks only requires compile/link-time resolvable
1117
  // address arithmetic.  Declaring it as a pointer instead would require
1118
  // doing a run-time load to fetch a pointer to this binding's property
1119
  // hooks.  And then structures which embedded a pointer to this structure
1120
  // would require a run-time load for proper initialization, which would
1121
  // then induce static constructors.  Lots of static constructors.
1122
  extern const NativePropertyHooks sNativePropertyHooks[];
1123
1124
  void
1125
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1126
1127
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1128
0
  {
1129
0
    /* Get the interface prototype object for this class.  This will create the
1130
0
       object as needed. */
1131
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::EXT_color_buffer_half_float,
1132
0
                                       &CreateInterfaceObjects,
1133
0
                                       /* aDefineOnGlobal = */ true);
1134
0
1135
0
  }
1136
1137
} // namespace EXT_color_buffer_half_float_Binding
1138
1139
1140
1141
namespace EXT_disjoint_timer_query_Binding {
1142
1143
  typedef mozilla::WebGLExtensionDisjointTimerQuery NativeType;
1144
1145
  static const uint32_t QUERY_COUNTER_BITS_EXT = 34916;
1146
  static const uint32_t CURRENT_QUERY_EXT = 34917;
1147
  static const uint32_t QUERY_RESULT_EXT = 34918;
1148
  static const uint32_t QUERY_RESULT_AVAILABLE_EXT = 34919;
1149
  static const uint32_t TIME_ELAPSED_EXT = 35007;
1150
  static const uint32_t TIMESTAMP_EXT = 36392;
1151
  static const uint32_t GPU_DISJOINT_EXT = 36795;
1152
  const JSClass*
1153
  GetJSClass();
1154
1155
  bool
1156
  Wrap(JSContext* aCx, mozilla::WebGLExtensionDisjointTimerQuery* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1157
1158
  template <class T>
1159
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1160
0
  {
1161
0
    JS::Rooted<JSObject*> reflector(aCx);
1162
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1163
0
  }
1164
1165
  // We declare this as an array so that retrieving a pointer to this
1166
  // binding's property hooks only requires compile/link-time resolvable
1167
  // address arithmetic.  Declaring it as a pointer instead would require
1168
  // doing a run-time load to fetch a pointer to this binding's property
1169
  // hooks.  And then structures which embedded a pointer to this structure
1170
  // would require a run-time load for proper initialization, which would
1171
  // then induce static constructors.  Lots of static constructors.
1172
  extern const NativePropertyHooks sNativePropertyHooks[];
1173
1174
  void
1175
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1176
1177
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1178
0
  {
1179
0
    /* Get the interface prototype object for this class.  This will create the
1180
0
       object as needed. */
1181
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::EXT_disjoint_timer_query,
1182
0
                                       &CreateInterfaceObjects,
1183
0
                                       /* aDefineOnGlobal = */ true);
1184
0
1185
0
  }
1186
1187
} // namespace EXT_disjoint_timer_query_Binding
1188
1189
1190
1191
namespace EXT_frag_depth_Binding {
1192
1193
  typedef mozilla::WebGLExtensionFragDepth NativeType;
1194
1195
  const JSClass*
1196
  GetJSClass();
1197
1198
  bool
1199
  Wrap(JSContext* aCx, mozilla::WebGLExtensionFragDepth* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1200
1201
  template <class T>
1202
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1203
0
  {
1204
0
    JS::Rooted<JSObject*> reflector(aCx);
1205
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1206
0
  }
1207
1208
  // We declare this as an array so that retrieving a pointer to this
1209
  // binding's property hooks only requires compile/link-time resolvable
1210
  // address arithmetic.  Declaring it as a pointer instead would require
1211
  // doing a run-time load to fetch a pointer to this binding's property
1212
  // hooks.  And then structures which embedded a pointer to this structure
1213
  // would require a run-time load for proper initialization, which would
1214
  // then induce static constructors.  Lots of static constructors.
1215
  extern const NativePropertyHooks sNativePropertyHooks[];
1216
1217
  void
1218
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1219
1220
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1221
0
  {
1222
0
    /* Get the interface prototype object for this class.  This will create the
1223
0
       object as needed. */
1224
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::EXT_frag_depth,
1225
0
                                       &CreateInterfaceObjects,
1226
0
                                       /* aDefineOnGlobal = */ true);
1227
0
1228
0
  }
1229
1230
} // namespace EXT_frag_depth_Binding
1231
1232
1233
1234
namespace EXT_sRGB_Binding {
1235
1236
  typedef mozilla::WebGLExtensionSRGB NativeType;
1237
1238
  static const uint32_t SRGB_EXT = 35904;
1239
  static const uint32_t SRGB_ALPHA_EXT = 35906;
1240
  static const uint32_t SRGB8_ALPHA8_EXT = 35907;
1241
  static const uint32_t FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 33296;
1242
  const JSClass*
1243
  GetJSClass();
1244
1245
  bool
1246
  Wrap(JSContext* aCx, mozilla::WebGLExtensionSRGB* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1247
1248
  template <class T>
1249
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1250
0
  {
1251
0
    JS::Rooted<JSObject*> reflector(aCx);
1252
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1253
0
  }
1254
1255
  // We declare this as an array so that retrieving a pointer to this
1256
  // binding's property hooks only requires compile/link-time resolvable
1257
  // address arithmetic.  Declaring it as a pointer instead would require
1258
  // doing a run-time load to fetch a pointer to this binding's property
1259
  // hooks.  And then structures which embedded a pointer to this structure
1260
  // would require a run-time load for proper initialization, which would
1261
  // then induce static constructors.  Lots of static constructors.
1262
  extern const NativePropertyHooks sNativePropertyHooks[];
1263
1264
  void
1265
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1266
1267
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1268
0
  {
1269
0
    /* Get the interface prototype object for this class.  This will create the
1270
0
       object as needed. */
1271
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::EXT_sRGB,
1272
0
                                       &CreateInterfaceObjects,
1273
0
                                       /* aDefineOnGlobal = */ true);
1274
0
1275
0
  }
1276
1277
} // namespace EXT_sRGB_Binding
1278
1279
1280
1281
namespace EXT_shader_texture_lod_Binding {
1282
1283
  typedef mozilla::WebGLExtensionShaderTextureLod NativeType;
1284
1285
  const JSClass*
1286
  GetJSClass();
1287
1288
  bool
1289
  Wrap(JSContext* aCx, mozilla::WebGLExtensionShaderTextureLod* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1290
1291
  template <class T>
1292
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1293
0
  {
1294
0
    JS::Rooted<JSObject*> reflector(aCx);
1295
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1296
0
  }
1297
1298
  // We declare this as an array so that retrieving a pointer to this
1299
  // binding's property hooks only requires compile/link-time resolvable
1300
  // address arithmetic.  Declaring it as a pointer instead would require
1301
  // doing a run-time load to fetch a pointer to this binding's property
1302
  // hooks.  And then structures which embedded a pointer to this structure
1303
  // would require a run-time load for proper initialization, which would
1304
  // then induce static constructors.  Lots of static constructors.
1305
  extern const NativePropertyHooks sNativePropertyHooks[];
1306
1307
  void
1308
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1309
1310
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1311
0
  {
1312
0
    /* Get the interface prototype object for this class.  This will create the
1313
0
       object as needed. */
1314
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::EXT_shader_texture_lod,
1315
0
                                       &CreateInterfaceObjects,
1316
0
                                       /* aDefineOnGlobal = */ true);
1317
0
1318
0
  }
1319
1320
} // namespace EXT_shader_texture_lod_Binding
1321
1322
1323
1324
namespace EXT_texture_filter_anisotropic_Binding {
1325
1326
  typedef mozilla::WebGLExtensionTextureFilterAnisotropic NativeType;
1327
1328
  static const uint32_t TEXTURE_MAX_ANISOTROPY_EXT = 34046;
1329
  static const uint32_t MAX_TEXTURE_MAX_ANISOTROPY_EXT = 34047;
1330
  const JSClass*
1331
  GetJSClass();
1332
1333
  bool
1334
  Wrap(JSContext* aCx, mozilla::WebGLExtensionTextureFilterAnisotropic* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1335
1336
  template <class T>
1337
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1338
0
  {
1339
0
    JS::Rooted<JSObject*> reflector(aCx);
1340
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1341
0
  }
1342
1343
  // We declare this as an array so that retrieving a pointer to this
1344
  // binding's property hooks only requires compile/link-time resolvable
1345
  // address arithmetic.  Declaring it as a pointer instead would require
1346
  // doing a run-time load to fetch a pointer to this binding's property
1347
  // hooks.  And then structures which embedded a pointer to this structure
1348
  // would require a run-time load for proper initialization, which would
1349
  // then induce static constructors.  Lots of static constructors.
1350
  extern const NativePropertyHooks sNativePropertyHooks[];
1351
1352
  void
1353
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1354
1355
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1356
0
  {
1357
0
    /* Get the interface prototype object for this class.  This will create the
1358
0
       object as needed. */
1359
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::EXT_texture_filter_anisotropic,
1360
0
                                       &CreateInterfaceObjects,
1361
0
                                       /* aDefineOnGlobal = */ true);
1362
0
1363
0
  }
1364
1365
} // namespace EXT_texture_filter_anisotropic_Binding
1366
1367
1368
1369
namespace MOZ_debug_Binding {
1370
1371
  typedef mozilla::WebGLExtensionMOZDebug NativeType;
1372
1373
  static const uint32_t EXTENSIONS = 7939;
1374
  static const uint32_t WSI_INFO = 65536;
1375
  static const uint32_t UNPACK_REQUIRE_FASTPATH = 65537;
1376
  static const uint32_t DOES_INDEX_VALIDATION = 65538;
1377
  const JSClass*
1378
  GetJSClass();
1379
1380
  bool
1381
  Wrap(JSContext* aCx, mozilla::WebGLExtensionMOZDebug* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1382
1383
  template <class T>
1384
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1385
0
  {
1386
0
    JS::Rooted<JSObject*> reflector(aCx);
1387
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1388
0
  }
1389
1390
  // We declare this as an array so that retrieving a pointer to this
1391
  // binding's property hooks only requires compile/link-time resolvable
1392
  // address arithmetic.  Declaring it as a pointer instead would require
1393
  // doing a run-time load to fetch a pointer to this binding's property
1394
  // hooks.  And then structures which embedded a pointer to this structure
1395
  // would require a run-time load for proper initialization, which would
1396
  // then induce static constructors.  Lots of static constructors.
1397
  extern const NativePropertyHooks sNativePropertyHooks[];
1398
1399
  void
1400
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1401
1402
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1403
0
  {
1404
0
    /* Get the interface prototype object for this class.  This will create the
1405
0
       object as needed. */
1406
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::MOZ_debug,
1407
0
                                       &CreateInterfaceObjects,
1408
0
                                       /* aDefineOnGlobal = */ true);
1409
0
1410
0
  }
1411
1412
} // namespace MOZ_debug_Binding
1413
1414
1415
1416
namespace OES_element_index_uint_Binding {
1417
1418
  typedef mozilla::WebGLExtensionElementIndexUint NativeType;
1419
1420
  const JSClass*
1421
  GetJSClass();
1422
1423
  bool
1424
  Wrap(JSContext* aCx, mozilla::WebGLExtensionElementIndexUint* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1425
1426
  template <class T>
1427
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1428
0
  {
1429
0
    JS::Rooted<JSObject*> reflector(aCx);
1430
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1431
0
  }
1432
1433
  // We declare this as an array so that retrieving a pointer to this
1434
  // binding's property hooks only requires compile/link-time resolvable
1435
  // address arithmetic.  Declaring it as a pointer instead would require
1436
  // doing a run-time load to fetch a pointer to this binding's property
1437
  // hooks.  And then structures which embedded a pointer to this structure
1438
  // would require a run-time load for proper initialization, which would
1439
  // then induce static constructors.  Lots of static constructors.
1440
  extern const NativePropertyHooks sNativePropertyHooks[];
1441
1442
  void
1443
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1444
1445
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1446
0
  {
1447
0
    /* Get the interface prototype object for this class.  This will create the
1448
0
       object as needed. */
1449
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::OES_element_index_uint,
1450
0
                                       &CreateInterfaceObjects,
1451
0
                                       /* aDefineOnGlobal = */ true);
1452
0
1453
0
  }
1454
1455
} // namespace OES_element_index_uint_Binding
1456
1457
1458
1459
namespace OES_standard_derivatives_Binding {
1460
1461
  typedef mozilla::WebGLExtensionStandardDerivatives NativeType;
1462
1463
  static const uint32_t FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 35723;
1464
  const JSClass*
1465
  GetJSClass();
1466
1467
  bool
1468
  Wrap(JSContext* aCx, mozilla::WebGLExtensionStandardDerivatives* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1469
1470
  template <class T>
1471
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1472
0
  {
1473
0
    JS::Rooted<JSObject*> reflector(aCx);
1474
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1475
0
  }
1476
1477
  // We declare this as an array so that retrieving a pointer to this
1478
  // binding's property hooks only requires compile/link-time resolvable
1479
  // address arithmetic.  Declaring it as a pointer instead would require
1480
  // doing a run-time load to fetch a pointer to this binding's property
1481
  // hooks.  And then structures which embedded a pointer to this structure
1482
  // would require a run-time load for proper initialization, which would
1483
  // then induce static constructors.  Lots of static constructors.
1484
  extern const NativePropertyHooks sNativePropertyHooks[];
1485
1486
  void
1487
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1488
1489
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1490
0
  {
1491
0
    /* Get the interface prototype object for this class.  This will create the
1492
0
       object as needed. */
1493
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::OES_standard_derivatives,
1494
0
                                       &CreateInterfaceObjects,
1495
0
                                       /* aDefineOnGlobal = */ true);
1496
0
1497
0
  }
1498
1499
} // namespace OES_standard_derivatives_Binding
1500
1501
1502
1503
namespace OES_texture_float_Binding {
1504
1505
  typedef mozilla::WebGLExtensionTextureFloat NativeType;
1506
1507
  const JSClass*
1508
  GetJSClass();
1509
1510
  bool
1511
  Wrap(JSContext* aCx, mozilla::WebGLExtensionTextureFloat* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1512
1513
  template <class T>
1514
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1515
0
  {
1516
0
    JS::Rooted<JSObject*> reflector(aCx);
1517
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1518
0
  }
1519
1520
  // We declare this as an array so that retrieving a pointer to this
1521
  // binding's property hooks only requires compile/link-time resolvable
1522
  // address arithmetic.  Declaring it as a pointer instead would require
1523
  // doing a run-time load to fetch a pointer to this binding's property
1524
  // hooks.  And then structures which embedded a pointer to this structure
1525
  // would require a run-time load for proper initialization, which would
1526
  // then induce static constructors.  Lots of static constructors.
1527
  extern const NativePropertyHooks sNativePropertyHooks[];
1528
1529
  void
1530
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1531
1532
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1533
0
  {
1534
0
    /* Get the interface prototype object for this class.  This will create the
1535
0
       object as needed. */
1536
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::OES_texture_float,
1537
0
                                       &CreateInterfaceObjects,
1538
0
                                       /* aDefineOnGlobal = */ true);
1539
0
1540
0
  }
1541
1542
} // namespace OES_texture_float_Binding
1543
1544
1545
1546
namespace OES_texture_float_linear_Binding {
1547
1548
  typedef mozilla::WebGLExtensionTextureFloatLinear NativeType;
1549
1550
  const JSClass*
1551
  GetJSClass();
1552
1553
  bool
1554
  Wrap(JSContext* aCx, mozilla::WebGLExtensionTextureFloatLinear* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1555
1556
  template <class T>
1557
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1558
0
  {
1559
0
    JS::Rooted<JSObject*> reflector(aCx);
1560
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1561
0
  }
1562
1563
  // We declare this as an array so that retrieving a pointer to this
1564
  // binding's property hooks only requires compile/link-time resolvable
1565
  // address arithmetic.  Declaring it as a pointer instead would require
1566
  // doing a run-time load to fetch a pointer to this binding's property
1567
  // hooks.  And then structures which embedded a pointer to this structure
1568
  // would require a run-time load for proper initialization, which would
1569
  // then induce static constructors.  Lots of static constructors.
1570
  extern const NativePropertyHooks sNativePropertyHooks[];
1571
1572
  void
1573
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1574
1575
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1576
0
  {
1577
0
    /* Get the interface prototype object for this class.  This will create the
1578
0
       object as needed. */
1579
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::OES_texture_float_linear,
1580
0
                                       &CreateInterfaceObjects,
1581
0
                                       /* aDefineOnGlobal = */ true);
1582
0
1583
0
  }
1584
1585
} // namespace OES_texture_float_linear_Binding
1586
1587
1588
1589
namespace OES_texture_half_float_Binding {
1590
1591
  typedef mozilla::WebGLExtensionTextureHalfFloat NativeType;
1592
1593
  static const uint32_t HALF_FLOAT_OES = 36193;
1594
  const JSClass*
1595
  GetJSClass();
1596
1597
  bool
1598
  Wrap(JSContext* aCx, mozilla::WebGLExtensionTextureHalfFloat* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1599
1600
  template <class T>
1601
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1602
0
  {
1603
0
    JS::Rooted<JSObject*> reflector(aCx);
1604
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1605
0
  }
1606
1607
  // We declare this as an array so that retrieving a pointer to this
1608
  // binding's property hooks only requires compile/link-time resolvable
1609
  // address arithmetic.  Declaring it as a pointer instead would require
1610
  // doing a run-time load to fetch a pointer to this binding's property
1611
  // hooks.  And then structures which embedded a pointer to this structure
1612
  // would require a run-time load for proper initialization, which would
1613
  // then induce static constructors.  Lots of static constructors.
1614
  extern const NativePropertyHooks sNativePropertyHooks[];
1615
1616
  void
1617
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1618
1619
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1620
0
  {
1621
0
    /* Get the interface prototype object for this class.  This will create the
1622
0
       object as needed. */
1623
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::OES_texture_half_float,
1624
0
                                       &CreateInterfaceObjects,
1625
0
                                       /* aDefineOnGlobal = */ true);
1626
0
1627
0
  }
1628
1629
} // namespace OES_texture_half_float_Binding
1630
1631
1632
1633
namespace OES_texture_half_float_linear_Binding {
1634
1635
  typedef mozilla::WebGLExtensionTextureHalfFloatLinear NativeType;
1636
1637
  const JSClass*
1638
  GetJSClass();
1639
1640
  bool
1641
  Wrap(JSContext* aCx, mozilla::WebGLExtensionTextureHalfFloatLinear* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1642
1643
  template <class T>
1644
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1645
0
  {
1646
0
    JS::Rooted<JSObject*> reflector(aCx);
1647
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1648
0
  }
1649
1650
  // We declare this as an array so that retrieving a pointer to this
1651
  // binding's property hooks only requires compile/link-time resolvable
1652
  // address arithmetic.  Declaring it as a pointer instead would require
1653
  // doing a run-time load to fetch a pointer to this binding's property
1654
  // hooks.  And then structures which embedded a pointer to this structure
1655
  // would require a run-time load for proper initialization, which would
1656
  // then induce static constructors.  Lots of static constructors.
1657
  extern const NativePropertyHooks sNativePropertyHooks[];
1658
1659
  void
1660
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1661
1662
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1663
0
  {
1664
0
    /* Get the interface prototype object for this class.  This will create the
1665
0
       object as needed. */
1666
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::OES_texture_half_float_linear,
1667
0
                                       &CreateInterfaceObjects,
1668
0
                                       /* aDefineOnGlobal = */ true);
1669
0
1670
0
  }
1671
1672
} // namespace OES_texture_half_float_linear_Binding
1673
1674
1675
1676
namespace OES_vertex_array_object_Binding {
1677
1678
  typedef mozilla::WebGLExtensionVertexArray NativeType;
1679
1680
  static const uint32_t VERTEX_ARRAY_BINDING_OES = 34229;
1681
  const JSClass*
1682
  GetJSClass();
1683
1684
  bool
1685
  Wrap(JSContext* aCx, mozilla::WebGLExtensionVertexArray* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1686
1687
  template <class T>
1688
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1689
0
  {
1690
0
    JS::Rooted<JSObject*> reflector(aCx);
1691
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1692
0
  }
1693
1694
  // We declare this as an array so that retrieving a pointer to this
1695
  // binding's property hooks only requires compile/link-time resolvable
1696
  // address arithmetic.  Declaring it as a pointer instead would require
1697
  // doing a run-time load to fetch a pointer to this binding's property
1698
  // hooks.  And then structures which embedded a pointer to this structure
1699
  // would require a run-time load for proper initialization, which would
1700
  // then induce static constructors.  Lots of static constructors.
1701
  extern const NativePropertyHooks sNativePropertyHooks[];
1702
1703
  void
1704
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1705
1706
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1707
0
  {
1708
0
    /* Get the interface prototype object for this class.  This will create the
1709
0
       object as needed. */
1710
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::OES_vertex_array_object,
1711
0
                                       &CreateInterfaceObjects,
1712
0
                                       /* aDefineOnGlobal = */ true);
1713
0
1714
0
  }
1715
1716
} // namespace OES_vertex_array_object_Binding
1717
1718
1719
1720
namespace WEBGL_color_buffer_float_Binding {
1721
1722
  typedef mozilla::WebGLExtensionColorBufferFloat NativeType;
1723
1724
  static const uint32_t RGBA32F_EXT = 34836;
1725
  static const uint32_t RGB32F_EXT = 34837;
1726
  static const uint32_t FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 33297;
1727
  static const uint32_t UNSIGNED_NORMALIZED_EXT = 35863;
1728
  const JSClass*
1729
  GetJSClass();
1730
1731
  bool
1732
  Wrap(JSContext* aCx, mozilla::WebGLExtensionColorBufferFloat* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1733
1734
  template <class T>
1735
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1736
0
  {
1737
0
    JS::Rooted<JSObject*> reflector(aCx);
1738
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1739
0
  }
1740
1741
  // We declare this as an array so that retrieving a pointer to this
1742
  // binding's property hooks only requires compile/link-time resolvable
1743
  // address arithmetic.  Declaring it as a pointer instead would require
1744
  // doing a run-time load to fetch a pointer to this binding's property
1745
  // hooks.  And then structures which embedded a pointer to this structure
1746
  // would require a run-time load for proper initialization, which would
1747
  // then induce static constructors.  Lots of static constructors.
1748
  extern const NativePropertyHooks sNativePropertyHooks[];
1749
1750
  void
1751
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1752
1753
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1754
0
  {
1755
0
    /* Get the interface prototype object for this class.  This will create the
1756
0
       object as needed. */
1757
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WEBGL_color_buffer_float,
1758
0
                                       &CreateInterfaceObjects,
1759
0
                                       /* aDefineOnGlobal = */ true);
1760
0
1761
0
  }
1762
1763
} // namespace WEBGL_color_buffer_float_Binding
1764
1765
1766
1767
namespace WEBGL_compressed_texture_astc_Binding {
1768
1769
  typedef mozilla::WebGLExtensionCompressedTextureASTC NativeType;
1770
1771
  static const uint32_t COMPRESSED_RGBA_ASTC_4x4_KHR = 37808;
1772
  static const uint32_t COMPRESSED_RGBA_ASTC_5x4_KHR = 37809;
1773
  static const uint32_t COMPRESSED_RGBA_ASTC_5x5_KHR = 37810;
1774
  static const uint32_t COMPRESSED_RGBA_ASTC_6x5_KHR = 37811;
1775
  static const uint32_t COMPRESSED_RGBA_ASTC_6x6_KHR = 37812;
1776
  static const uint32_t COMPRESSED_RGBA_ASTC_8x5_KHR = 37813;
1777
  static const uint32_t COMPRESSED_RGBA_ASTC_8x6_KHR = 37814;
1778
  static const uint32_t COMPRESSED_RGBA_ASTC_8x8_KHR = 37815;
1779
  static const uint32_t COMPRESSED_RGBA_ASTC_10x5_KHR = 37816;
1780
  static const uint32_t COMPRESSED_RGBA_ASTC_10x6_KHR = 37817;
1781
  static const uint32_t COMPRESSED_RGBA_ASTC_10x8_KHR = 37818;
1782
  static const uint32_t COMPRESSED_RGBA_ASTC_10x10_KHR = 37819;
1783
  static const uint32_t COMPRESSED_RGBA_ASTC_12x10_KHR = 37820;
1784
  static const uint32_t COMPRESSED_RGBA_ASTC_12x12_KHR = 37821;
1785
  static const uint32_t COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 37840;
1786
  static const uint32_t COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 37841;
1787
  static const uint32_t COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 37842;
1788
  static const uint32_t COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 37843;
1789
  static const uint32_t COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 37844;
1790
  static const uint32_t COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 37845;
1791
  static const uint32_t COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 37846;
1792
  static const uint32_t COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 37847;
1793
  static const uint32_t COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 37848;
1794
  static const uint32_t COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 37849;
1795
  static const uint32_t COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 37850;
1796
  static const uint32_t COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 37851;
1797
  static const uint32_t COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 37852;
1798
  static const uint32_t COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 37853;
1799
  const JSClass*
1800
  GetJSClass();
1801
1802
  bool
1803
  Wrap(JSContext* aCx, mozilla::WebGLExtensionCompressedTextureASTC* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1804
1805
  template <class T>
1806
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1807
0
  {
1808
0
    JS::Rooted<JSObject*> reflector(aCx);
1809
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1810
0
  }
1811
1812
  // We declare this as an array so that retrieving a pointer to this
1813
  // binding's property hooks only requires compile/link-time resolvable
1814
  // address arithmetic.  Declaring it as a pointer instead would require
1815
  // doing a run-time load to fetch a pointer to this binding's property
1816
  // hooks.  And then structures which embedded a pointer to this structure
1817
  // would require a run-time load for proper initialization, which would
1818
  // then induce static constructors.  Lots of static constructors.
1819
  extern const NativePropertyHooks sNativePropertyHooks[];
1820
1821
  void
1822
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1823
1824
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1825
0
  {
1826
0
    /* Get the interface prototype object for this class.  This will create the
1827
0
       object as needed. */
1828
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WEBGL_compressed_texture_astc,
1829
0
                                       &CreateInterfaceObjects,
1830
0
                                       /* aDefineOnGlobal = */ true);
1831
0
1832
0
  }
1833
1834
} // namespace WEBGL_compressed_texture_astc_Binding
1835
1836
1837
1838
namespace WEBGL_compressed_texture_atc_Binding {
1839
1840
  typedef mozilla::WebGLExtensionCompressedTextureATC NativeType;
1841
1842
  static const uint32_t COMPRESSED_RGB_ATC_WEBGL = 35986;
1843
  static const uint32_t COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 35987;
1844
  static const uint32_t COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 34798;
1845
  const JSClass*
1846
  GetJSClass();
1847
1848
  bool
1849
  Wrap(JSContext* aCx, mozilla::WebGLExtensionCompressedTextureATC* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1850
1851
  template <class T>
1852
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1853
0
  {
1854
0
    JS::Rooted<JSObject*> reflector(aCx);
1855
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1856
0
  }
1857
1858
  // We declare this as an array so that retrieving a pointer to this
1859
  // binding's property hooks only requires compile/link-time resolvable
1860
  // address arithmetic.  Declaring it as a pointer instead would require
1861
  // doing a run-time load to fetch a pointer to this binding's property
1862
  // hooks.  And then structures which embedded a pointer to this structure
1863
  // would require a run-time load for proper initialization, which would
1864
  // then induce static constructors.  Lots of static constructors.
1865
  extern const NativePropertyHooks sNativePropertyHooks[];
1866
1867
  void
1868
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1869
1870
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1871
0
  {
1872
0
    /* Get the interface prototype object for this class.  This will create the
1873
0
       object as needed. */
1874
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WEBGL_compressed_texture_atc,
1875
0
                                       &CreateInterfaceObjects,
1876
0
                                       /* aDefineOnGlobal = */ true);
1877
0
1878
0
  }
1879
1880
} // namespace WEBGL_compressed_texture_atc_Binding
1881
1882
1883
1884
namespace WEBGL_compressed_texture_etc_Binding {
1885
1886
  typedef mozilla::WebGLExtensionCompressedTextureES3 NativeType;
1887
1888
  static const uint32_t COMPRESSED_R11_EAC = 37488;
1889
  static const uint32_t COMPRESSED_SIGNED_R11_EAC = 37489;
1890
  static const uint32_t COMPRESSED_RG11_EAC = 37490;
1891
  static const uint32_t COMPRESSED_SIGNED_RG11_EAC = 37491;
1892
  static const uint32_t COMPRESSED_RGB8_ETC2 = 37492;
1893
  static const uint32_t COMPRESSED_SRGB8_ETC2 = 37493;
1894
  static const uint32_t COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494;
1895
  static const uint32_t COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495;
1896
  static const uint32_t COMPRESSED_RGBA8_ETC2_EAC = 37496;
1897
  static const uint32_t COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497;
1898
  const JSClass*
1899
  GetJSClass();
1900
1901
  bool
1902
  Wrap(JSContext* aCx, mozilla::WebGLExtensionCompressedTextureES3* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1903
1904
  template <class T>
1905
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1906
0
  {
1907
0
    JS::Rooted<JSObject*> reflector(aCx);
1908
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1909
0
  }
1910
1911
  // We declare this as an array so that retrieving a pointer to this
1912
  // binding's property hooks only requires compile/link-time resolvable
1913
  // address arithmetic.  Declaring it as a pointer instead would require
1914
  // doing a run-time load to fetch a pointer to this binding's property
1915
  // hooks.  And then structures which embedded a pointer to this structure
1916
  // would require a run-time load for proper initialization, which would
1917
  // then induce static constructors.  Lots of static constructors.
1918
  extern const NativePropertyHooks sNativePropertyHooks[];
1919
1920
  void
1921
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1922
1923
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1924
0
  {
1925
0
    /* Get the interface prototype object for this class.  This will create the
1926
0
       object as needed. */
1927
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WEBGL_compressed_texture_etc,
1928
0
                                       &CreateInterfaceObjects,
1929
0
                                       /* aDefineOnGlobal = */ true);
1930
0
1931
0
  }
1932
1933
} // namespace WEBGL_compressed_texture_etc_Binding
1934
1935
1936
1937
namespace WEBGL_compressed_texture_etc1_Binding {
1938
1939
  typedef mozilla::WebGLExtensionCompressedTextureETC1 NativeType;
1940
1941
  static const uint32_t COMPRESSED_RGB_ETC1_WEBGL = 36196;
1942
  const JSClass*
1943
  GetJSClass();
1944
1945
  bool
1946
  Wrap(JSContext* aCx, mozilla::WebGLExtensionCompressedTextureETC1* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1947
1948
  template <class T>
1949
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1950
0
  {
1951
0
    JS::Rooted<JSObject*> reflector(aCx);
1952
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
1953
0
  }
1954
1955
  // We declare this as an array so that retrieving a pointer to this
1956
  // binding's property hooks only requires compile/link-time resolvable
1957
  // address arithmetic.  Declaring it as a pointer instead would require
1958
  // doing a run-time load to fetch a pointer to this binding's property
1959
  // hooks.  And then structures which embedded a pointer to this structure
1960
  // would require a run-time load for proper initialization, which would
1961
  // then induce static constructors.  Lots of static constructors.
1962
  extern const NativePropertyHooks sNativePropertyHooks[];
1963
1964
  void
1965
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
1966
1967
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
1968
0
  {
1969
0
    /* Get the interface prototype object for this class.  This will create the
1970
0
       object as needed. */
1971
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WEBGL_compressed_texture_etc1,
1972
0
                                       &CreateInterfaceObjects,
1973
0
                                       /* aDefineOnGlobal = */ true);
1974
0
1975
0
  }
1976
1977
} // namespace WEBGL_compressed_texture_etc1_Binding
1978
1979
1980
1981
namespace WEBGL_compressed_texture_pvrtc_Binding {
1982
1983
  typedef mozilla::WebGLExtensionCompressedTexturePVRTC NativeType;
1984
1985
  static const uint32_t COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840;
1986
  static const uint32_t COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 35841;
1987
  static const uint32_t COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842;
1988
  static const uint32_t COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 35843;
1989
  const JSClass*
1990
  GetJSClass();
1991
1992
  bool
1993
  Wrap(JSContext* aCx, mozilla::WebGLExtensionCompressedTexturePVRTC* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
1994
1995
  template <class T>
1996
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
1997
0
  {
1998
0
    JS::Rooted<JSObject*> reflector(aCx);
1999
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
2000
0
  }
2001
2002
  // We declare this as an array so that retrieving a pointer to this
2003
  // binding's property hooks only requires compile/link-time resolvable
2004
  // address arithmetic.  Declaring it as a pointer instead would require
2005
  // doing a run-time load to fetch a pointer to this binding's property
2006
  // hooks.  And then structures which embedded a pointer to this structure
2007
  // would require a run-time load for proper initialization, which would
2008
  // then induce static constructors.  Lots of static constructors.
2009
  extern const NativePropertyHooks sNativePropertyHooks[];
2010
2011
  void
2012
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
2013
2014
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
2015
0
  {
2016
0
    /* Get the interface prototype object for this class.  This will create the
2017
0
       object as needed. */
2018
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WEBGL_compressed_texture_pvrtc,
2019
0
                                       &CreateInterfaceObjects,
2020
0
                                       /* aDefineOnGlobal = */ true);
2021
0
2022
0
  }
2023
2024
} // namespace WEBGL_compressed_texture_pvrtc_Binding
2025
2026
2027
2028
namespace WEBGL_compressed_texture_s3tc_Binding {
2029
2030
  typedef mozilla::WebGLExtensionCompressedTextureS3TC NativeType;
2031
2032
  static const uint32_t COMPRESSED_RGB_S3TC_DXT1_EXT = 33776;
2033
  static const uint32_t COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777;
2034
  static const uint32_t COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778;
2035
  static const uint32_t COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779;
2036
  const JSClass*
2037
  GetJSClass();
2038
2039
  bool
2040
  Wrap(JSContext* aCx, mozilla::WebGLExtensionCompressedTextureS3TC* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
2041
2042
  template <class T>
2043
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
2044
0
  {
2045
0
    JS::Rooted<JSObject*> reflector(aCx);
2046
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
2047
0
  }
2048
2049
  // We declare this as an array so that retrieving a pointer to this
2050
  // binding's property hooks only requires compile/link-time resolvable
2051
  // address arithmetic.  Declaring it as a pointer instead would require
2052
  // doing a run-time load to fetch a pointer to this binding's property
2053
  // hooks.  And then structures which embedded a pointer to this structure
2054
  // would require a run-time load for proper initialization, which would
2055
  // then induce static constructors.  Lots of static constructors.
2056
  extern const NativePropertyHooks sNativePropertyHooks[];
2057
2058
  void
2059
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
2060
2061
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
2062
0
  {
2063
0
    /* Get the interface prototype object for this class.  This will create the
2064
0
       object as needed. */
2065
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WEBGL_compressed_texture_s3tc,
2066
0
                                       &CreateInterfaceObjects,
2067
0
                                       /* aDefineOnGlobal = */ true);
2068
0
2069
0
  }
2070
2071
} // namespace WEBGL_compressed_texture_s3tc_Binding
2072
2073
2074
2075
namespace WEBGL_compressed_texture_s3tc_srgb_Binding {
2076
2077
  typedef mozilla::WebGLExtensionCompressedTextureS3TC_SRGB NativeType;
2078
2079
  static const uint32_t COMPRESSED_SRGB_S3TC_DXT1_EXT = 35916;
2080
  static const uint32_t COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 35917;
2081
  static const uint32_t COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 35918;
2082
  static const uint32_t COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 35919;
2083
  const JSClass*
2084
  GetJSClass();
2085
2086
  bool
2087
  Wrap(JSContext* aCx, mozilla::WebGLExtensionCompressedTextureS3TC_SRGB* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
2088
2089
  template <class T>
2090
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
2091
0
  {
2092
0
    JS::Rooted<JSObject*> reflector(aCx);
2093
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
2094
0
  }
2095
2096
  // We declare this as an array so that retrieving a pointer to this
2097
  // binding's property hooks only requires compile/link-time resolvable
2098
  // address arithmetic.  Declaring it as a pointer instead would require
2099
  // doing a run-time load to fetch a pointer to this binding's property
2100
  // hooks.  And then structures which embedded a pointer to this structure
2101
  // would require a run-time load for proper initialization, which would
2102
  // then induce static constructors.  Lots of static constructors.
2103
  extern const NativePropertyHooks sNativePropertyHooks[];
2104
2105
  void
2106
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
2107
2108
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
2109
0
  {
2110
0
    /* Get the interface prototype object for this class.  This will create the
2111
0
       object as needed. */
2112
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WEBGL_compressed_texture_s3tc_srgb,
2113
0
                                       &CreateInterfaceObjects,
2114
0
                                       /* aDefineOnGlobal = */ true);
2115
0
2116
0
  }
2117
2118
} // namespace WEBGL_compressed_texture_s3tc_srgb_Binding
2119
2120
2121
2122
namespace WEBGL_debug_renderer_info_Binding {
2123
2124
  typedef mozilla::WebGLExtensionDebugRendererInfo NativeType;
2125
2126
  static const uint32_t UNMASKED_VENDOR_WEBGL = 37445;
2127
  static const uint32_t UNMASKED_RENDERER_WEBGL = 37446;
2128
  const JSClass*
2129
  GetJSClass();
2130
2131
  bool
2132
  Wrap(JSContext* aCx, mozilla::WebGLExtensionDebugRendererInfo* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
2133
2134
  template <class T>
2135
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
2136
0
  {
2137
0
    JS::Rooted<JSObject*> reflector(aCx);
2138
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
2139
0
  }
2140
2141
  // We declare this as an array so that retrieving a pointer to this
2142
  // binding's property hooks only requires compile/link-time resolvable
2143
  // address arithmetic.  Declaring it as a pointer instead would require
2144
  // doing a run-time load to fetch a pointer to this binding's property
2145
  // hooks.  And then structures which embedded a pointer to this structure
2146
  // would require a run-time load for proper initialization, which would
2147
  // then induce static constructors.  Lots of static constructors.
2148
  extern const NativePropertyHooks sNativePropertyHooks[];
2149
2150
  void
2151
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
2152
2153
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
2154
0
  {
2155
0
    /* Get the interface prototype object for this class.  This will create the
2156
0
       object as needed. */
2157
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WEBGL_debug_renderer_info,
2158
0
                                       &CreateInterfaceObjects,
2159
0
                                       /* aDefineOnGlobal = */ true);
2160
0
2161
0
  }
2162
2163
} // namespace WEBGL_debug_renderer_info_Binding
2164
2165
2166
2167
namespace WEBGL_debug_shaders_Binding {
2168
2169
  typedef mozilla::WebGLExtensionDebugShaders NativeType;
2170
2171
  const JSClass*
2172
  GetJSClass();
2173
2174
  bool
2175
  Wrap(JSContext* aCx, mozilla::WebGLExtensionDebugShaders* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
2176
2177
  template <class T>
2178
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
2179
0
  {
2180
0
    JS::Rooted<JSObject*> reflector(aCx);
2181
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
2182
0
  }
2183
2184
  // We declare this as an array so that retrieving a pointer to this
2185
  // binding's property hooks only requires compile/link-time resolvable
2186
  // address arithmetic.  Declaring it as a pointer instead would require
2187
  // doing a run-time load to fetch a pointer to this binding's property
2188
  // hooks.  And then structures which embedded a pointer to this structure
2189
  // would require a run-time load for proper initialization, which would
2190
  // then induce static constructors.  Lots of static constructors.
2191
  extern const NativePropertyHooks sNativePropertyHooks[];
2192
2193
  void
2194
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
2195
2196
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
2197
0
  {
2198
0
    /* Get the interface prototype object for this class.  This will create the
2199
0
       object as needed. */
2200
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WEBGL_debug_shaders,
2201
0
                                       &CreateInterfaceObjects,
2202
0
                                       /* aDefineOnGlobal = */ true);
2203
0
2204
0
  }
2205
2206
} // namespace WEBGL_debug_shaders_Binding
2207
2208
2209
2210
namespace WEBGL_depth_texture_Binding {
2211
2212
  typedef mozilla::WebGLExtensionDepthTexture NativeType;
2213
2214
  static const uint32_t UNSIGNED_INT_24_8_WEBGL = 34042;
2215
  const JSClass*
2216
  GetJSClass();
2217
2218
  bool
2219
  Wrap(JSContext* aCx, mozilla::WebGLExtensionDepthTexture* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
2220
2221
  template <class T>
2222
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
2223
0
  {
2224
0
    JS::Rooted<JSObject*> reflector(aCx);
2225
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
2226
0
  }
2227
2228
  // We declare this as an array so that retrieving a pointer to this
2229
  // binding's property hooks only requires compile/link-time resolvable
2230
  // address arithmetic.  Declaring it as a pointer instead would require
2231
  // doing a run-time load to fetch a pointer to this binding's property
2232
  // hooks.  And then structures which embedded a pointer to this structure
2233
  // would require a run-time load for proper initialization, which would
2234
  // then induce static constructors.  Lots of static constructors.
2235
  extern const NativePropertyHooks sNativePropertyHooks[];
2236
2237
  void
2238
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
2239
2240
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
2241
0
  {
2242
0
    /* Get the interface prototype object for this class.  This will create the
2243
0
       object as needed. */
2244
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WEBGL_depth_texture,
2245
0
                                       &CreateInterfaceObjects,
2246
0
                                       /* aDefineOnGlobal = */ true);
2247
0
2248
0
  }
2249
2250
} // namespace WEBGL_depth_texture_Binding
2251
2252
2253
2254
namespace WEBGL_draw_buffers_Binding {
2255
2256
  typedef mozilla::WebGLExtensionDrawBuffers NativeType;
2257
2258
  static const uint32_t COLOR_ATTACHMENT0_WEBGL = 36064;
2259
  static const uint32_t COLOR_ATTACHMENT1_WEBGL = 36065;
2260
  static const uint32_t COLOR_ATTACHMENT2_WEBGL = 36066;
2261
  static const uint32_t COLOR_ATTACHMENT3_WEBGL = 36067;
2262
  static const uint32_t COLOR_ATTACHMENT4_WEBGL = 36068;
2263
  static const uint32_t COLOR_ATTACHMENT5_WEBGL = 36069;
2264
  static const uint32_t COLOR_ATTACHMENT6_WEBGL = 36070;
2265
  static const uint32_t COLOR_ATTACHMENT7_WEBGL = 36071;
2266
  static const uint32_t COLOR_ATTACHMENT8_WEBGL = 36072;
2267
  static const uint32_t COLOR_ATTACHMENT9_WEBGL = 36073;
2268
  static const uint32_t COLOR_ATTACHMENT10_WEBGL = 36074;
2269
  static const uint32_t COLOR_ATTACHMENT11_WEBGL = 36075;
2270
  static const uint32_t COLOR_ATTACHMENT12_WEBGL = 36076;
2271
  static const uint32_t COLOR_ATTACHMENT13_WEBGL = 36077;
2272
  static const uint32_t COLOR_ATTACHMENT14_WEBGL = 36078;
2273
  static const uint32_t COLOR_ATTACHMENT15_WEBGL = 36079;
2274
  static const uint32_t DRAW_BUFFER0_WEBGL = 34853;
2275
  static const uint32_t DRAW_BUFFER1_WEBGL = 34854;
2276
  static const uint32_t DRAW_BUFFER2_WEBGL = 34855;
2277
  static const uint32_t DRAW_BUFFER3_WEBGL = 34856;
2278
  static const uint32_t DRAW_BUFFER4_WEBGL = 34857;
2279
  static const uint32_t DRAW_BUFFER5_WEBGL = 34858;
2280
  static const uint32_t DRAW_BUFFER6_WEBGL = 34859;
2281
  static const uint32_t DRAW_BUFFER7_WEBGL = 34860;
2282
  static const uint32_t DRAW_BUFFER8_WEBGL = 34861;
2283
  static const uint32_t DRAW_BUFFER9_WEBGL = 34862;
2284
  static const uint32_t DRAW_BUFFER10_WEBGL = 34863;
2285
  static const uint32_t DRAW_BUFFER11_WEBGL = 34864;
2286
  static const uint32_t DRAW_BUFFER12_WEBGL = 34865;
2287
  static const uint32_t DRAW_BUFFER13_WEBGL = 34866;
2288
  static const uint32_t DRAW_BUFFER14_WEBGL = 34867;
2289
  static const uint32_t DRAW_BUFFER15_WEBGL = 34868;
2290
  static const uint32_t MAX_COLOR_ATTACHMENTS_WEBGL = 36063;
2291
  static const uint32_t MAX_DRAW_BUFFERS_WEBGL = 34852;
2292
  const JSClass*
2293
  GetJSClass();
2294
2295
  bool
2296
  Wrap(JSContext* aCx, mozilla::WebGLExtensionDrawBuffers* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
2297
2298
  template <class T>
2299
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
2300
0
  {
2301
0
    JS::Rooted<JSObject*> reflector(aCx);
2302
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
2303
0
  }
2304
2305
  // We declare this as an array so that retrieving a pointer to this
2306
  // binding's property hooks only requires compile/link-time resolvable
2307
  // address arithmetic.  Declaring it as a pointer instead would require
2308
  // doing a run-time load to fetch a pointer to this binding's property
2309
  // hooks.  And then structures which embedded a pointer to this structure
2310
  // would require a run-time load for proper initialization, which would
2311
  // then induce static constructors.  Lots of static constructors.
2312
  extern const NativePropertyHooks sNativePropertyHooks[];
2313
2314
  void
2315
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
2316
2317
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
2318
0
  {
2319
0
    /* Get the interface prototype object for this class.  This will create the
2320
0
       object as needed. */
2321
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WEBGL_draw_buffers,
2322
0
                                       &CreateInterfaceObjects,
2323
0
                                       /* aDefineOnGlobal = */ true);
2324
0
2325
0
  }
2326
2327
} // namespace WEBGL_draw_buffers_Binding
2328
2329
2330
2331
namespace WEBGL_lose_context_Binding {
2332
2333
  typedef mozilla::WebGLExtensionLoseContext NativeType;
2334
2335
  const JSClass*
2336
  GetJSClass();
2337
2338
  bool
2339
  Wrap(JSContext* aCx, mozilla::WebGLExtensionLoseContext* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
2340
2341
  template <class T>
2342
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
2343
0
  {
2344
0
    JS::Rooted<JSObject*> reflector(aCx);
2345
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
2346
0
  }
2347
2348
  // We declare this as an array so that retrieving a pointer to this
2349
  // binding's property hooks only requires compile/link-time resolvable
2350
  // address arithmetic.  Declaring it as a pointer instead would require
2351
  // doing a run-time load to fetch a pointer to this binding's property
2352
  // hooks.  And then structures which embedded a pointer to this structure
2353
  // would require a run-time load for proper initialization, which would
2354
  // then induce static constructors.  Lots of static constructors.
2355
  extern const NativePropertyHooks sNativePropertyHooks[];
2356
2357
  void
2358
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
2359
2360
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
2361
0
  {
2362
0
    /* Get the interface prototype object for this class.  This will create the
2363
0
       object as needed. */
2364
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WEBGL_lose_context,
2365
0
                                       &CreateInterfaceObjects,
2366
0
                                       /* aDefineOnGlobal = */ true);
2367
0
2368
0
  }
2369
2370
} // namespace WEBGL_lose_context_Binding
2371
2372
2373
2374
namespace WebGLActiveInfo_Binding {
2375
2376
  typedef mozilla::WebGLActiveInfo NativeType;
2377
2378
  bool
2379
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
2380
2381
  const JSClass*
2382
  GetJSClass();
2383
2384
  bool
2385
  Wrap(JSContext* aCx, mozilla::WebGLActiveInfo* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
2386
2387
  template <class T>
2388
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
2389
0
  {
2390
0
    JS::Rooted<JSObject*> reflector(aCx);
2391
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
2392
0
  }
2393
2394
  // We declare this as an array so that retrieving a pointer to this
2395
  // binding's property hooks only requires compile/link-time resolvable
2396
  // address arithmetic.  Declaring it as a pointer instead would require
2397
  // doing a run-time load to fetch a pointer to this binding's property
2398
  // hooks.  And then structures which embedded a pointer to this structure
2399
  // would require a run-time load for proper initialization, which would
2400
  // then induce static constructors.  Lots of static constructors.
2401
  extern const NativePropertyHooks sNativePropertyHooks[];
2402
2403
  void
2404
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
2405
2406
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
2407
0
  {
2408
0
    /* Get the interface prototype object for this class.  This will create the
2409
0
       object as needed. */
2410
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WebGLActiveInfo,
2411
0
                                       &CreateInterfaceObjects,
2412
0
                                       /* aDefineOnGlobal = */ true);
2413
0
2414
0
  }
2415
2416
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
2417
0
  {
2418
0
    /* Get the interface object for this class.  This will create the object as
2419
0
       needed. */
2420
0
2421
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::WebGLActiveInfo,
2422
0
                                       &CreateInterfaceObjects,
2423
0
                                       aDefineOnGlobal);
2424
0
  }
2425
2426
  JSObject*
2427
  GetConstructorObject(JSContext* aCx);
2428
2429
} // namespace WebGLActiveInfo_Binding
2430
2431
2432
2433
namespace WebGLBuffer_Binding {
2434
2435
  typedef mozilla::WebGLBuffer NativeType;
2436
2437
  bool
2438
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
2439
2440
  const JSClass*
2441
  GetJSClass();
2442
2443
  bool
2444
  Wrap(JSContext* aCx, mozilla::WebGLBuffer* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
2445
2446
  template <class T>
2447
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
2448
0
  {
2449
0
    JS::Rooted<JSObject*> reflector(aCx);
2450
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
2451
0
  }
2452
2453
  // We declare this as an array so that retrieving a pointer to this
2454
  // binding's property hooks only requires compile/link-time resolvable
2455
  // address arithmetic.  Declaring it as a pointer instead would require
2456
  // doing a run-time load to fetch a pointer to this binding's property
2457
  // hooks.  And then structures which embedded a pointer to this structure
2458
  // would require a run-time load for proper initialization, which would
2459
  // then induce static constructors.  Lots of static constructors.
2460
  extern const NativePropertyHooks sNativePropertyHooks[];
2461
2462
  void
2463
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
2464
2465
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
2466
0
  {
2467
0
    /* Get the interface prototype object for this class.  This will create the
2468
0
       object as needed. */
2469
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WebGLBuffer,
2470
0
                                       &CreateInterfaceObjects,
2471
0
                                       /* aDefineOnGlobal = */ true);
2472
0
2473
0
  }
2474
2475
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
2476
0
  {
2477
0
    /* Get the interface object for this class.  This will create the object as
2478
0
       needed. */
2479
0
2480
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::WebGLBuffer,
2481
0
                                       &CreateInterfaceObjects,
2482
0
                                       aDefineOnGlobal);
2483
0
  }
2484
2485
  JSObject*
2486
  GetConstructorObject(JSContext* aCx);
2487
2488
} // namespace WebGLBuffer_Binding
2489
2490
2491
2492
namespace WebGLFramebuffer_Binding {
2493
2494
  typedef mozilla::WebGLFramebuffer NativeType;
2495
2496
  bool
2497
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
2498
2499
  const JSClass*
2500
  GetJSClass();
2501
2502
  bool
2503
  Wrap(JSContext* aCx, mozilla::WebGLFramebuffer* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
2504
2505
  template <class T>
2506
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
2507
0
  {
2508
0
    JS::Rooted<JSObject*> reflector(aCx);
2509
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
2510
0
  }
2511
2512
  // We declare this as an array so that retrieving a pointer to this
2513
  // binding's property hooks only requires compile/link-time resolvable
2514
  // address arithmetic.  Declaring it as a pointer instead would require
2515
  // doing a run-time load to fetch a pointer to this binding's property
2516
  // hooks.  And then structures which embedded a pointer to this structure
2517
  // would require a run-time load for proper initialization, which would
2518
  // then induce static constructors.  Lots of static constructors.
2519
  extern const NativePropertyHooks sNativePropertyHooks[];
2520
2521
  void
2522
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
2523
2524
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
2525
0
  {
2526
0
    /* Get the interface prototype object for this class.  This will create the
2527
0
       object as needed. */
2528
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WebGLFramebuffer,
2529
0
                                       &CreateInterfaceObjects,
2530
0
                                       /* aDefineOnGlobal = */ true);
2531
0
2532
0
  }
2533
2534
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
2535
0
  {
2536
0
    /* Get the interface object for this class.  This will create the object as
2537
0
       needed. */
2538
0
2539
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::WebGLFramebuffer,
2540
0
                                       &CreateInterfaceObjects,
2541
0
                                       aDefineOnGlobal);
2542
0
  }
2543
2544
  JSObject*
2545
  GetConstructorObject(JSContext* aCx);
2546
2547
} // namespace WebGLFramebuffer_Binding
2548
2549
2550
2551
namespace WebGLProgram_Binding {
2552
2553
  typedef mozilla::WebGLProgram NativeType;
2554
2555
  bool
2556
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
2557
2558
  const JSClass*
2559
  GetJSClass();
2560
2561
  bool
2562
  Wrap(JSContext* aCx, mozilla::WebGLProgram* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
2563
2564
  template <class T>
2565
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
2566
0
  {
2567
0
    JS::Rooted<JSObject*> reflector(aCx);
2568
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
2569
0
  }
2570
2571
  // We declare this as an array so that retrieving a pointer to this
2572
  // binding's property hooks only requires compile/link-time resolvable
2573
  // address arithmetic.  Declaring it as a pointer instead would require
2574
  // doing a run-time load to fetch a pointer to this binding's property
2575
  // hooks.  And then structures which embedded a pointer to this structure
2576
  // would require a run-time load for proper initialization, which would
2577
  // then induce static constructors.  Lots of static constructors.
2578
  extern const NativePropertyHooks sNativePropertyHooks[];
2579
2580
  void
2581
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
2582
2583
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
2584
0
  {
2585
0
    /* Get the interface prototype object for this class.  This will create the
2586
0
       object as needed. */
2587
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WebGLProgram,
2588
0
                                       &CreateInterfaceObjects,
2589
0
                                       /* aDefineOnGlobal = */ true);
2590
0
2591
0
  }
2592
2593
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
2594
0
  {
2595
0
    /* Get the interface object for this class.  This will create the object as
2596
0
       needed. */
2597
0
2598
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::WebGLProgram,
2599
0
                                       &CreateInterfaceObjects,
2600
0
                                       aDefineOnGlobal);
2601
0
  }
2602
2603
  JSObject*
2604
  GetConstructorObject(JSContext* aCx);
2605
2606
} // namespace WebGLProgram_Binding
2607
2608
2609
2610
namespace WebGLQuery_Binding {
2611
2612
  typedef mozilla::WebGLQuery NativeType;
2613
2614
  const JSClass*
2615
  GetJSClass();
2616
2617
  bool
2618
  Wrap(JSContext* aCx, mozilla::WebGLQuery* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
2619
2620
  template <class T>
2621
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
2622
0
  {
2623
0
    JS::Rooted<JSObject*> reflector(aCx);
2624
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
2625
0
  }
2626
2627
  // We declare this as an array so that retrieving a pointer to this
2628
  // binding's property hooks only requires compile/link-time resolvable
2629
  // address arithmetic.  Declaring it as a pointer instead would require
2630
  // doing a run-time load to fetch a pointer to this binding's property
2631
  // hooks.  And then structures which embedded a pointer to this structure
2632
  // would require a run-time load for proper initialization, which would
2633
  // then induce static constructors.  Lots of static constructors.
2634
  extern const NativePropertyHooks sNativePropertyHooks[];
2635
2636
  void
2637
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
2638
2639
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
2640
0
  {
2641
0
    /* Get the interface prototype object for this class.  This will create the
2642
0
       object as needed. */
2643
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WebGLQuery,
2644
0
                                       &CreateInterfaceObjects,
2645
0
                                       /* aDefineOnGlobal = */ true);
2646
0
2647
0
  }
2648
2649
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
2650
0
  {
2651
0
    /* Get the interface object for this class.  This will create the object as
2652
0
       needed. */
2653
0
2654
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::WebGLQuery,
2655
0
                                       &CreateInterfaceObjects,
2656
0
                                       aDefineOnGlobal);
2657
0
  }
2658
2659
  JSObject*
2660
  GetConstructorObject(JSContext* aCx);
2661
2662
} // namespace WebGLQuery_Binding
2663
2664
2665
2666
namespace WebGLRenderbuffer_Binding {
2667
2668
  typedef mozilla::WebGLRenderbuffer NativeType;
2669
2670
  bool
2671
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
2672
2673
  const JSClass*
2674
  GetJSClass();
2675
2676
  bool
2677
  Wrap(JSContext* aCx, mozilla::WebGLRenderbuffer* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
2678
2679
  template <class T>
2680
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
2681
0
  {
2682
0
    JS::Rooted<JSObject*> reflector(aCx);
2683
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
2684
0
  }
2685
2686
  // We declare this as an array so that retrieving a pointer to this
2687
  // binding's property hooks only requires compile/link-time resolvable
2688
  // address arithmetic.  Declaring it as a pointer instead would require
2689
  // doing a run-time load to fetch a pointer to this binding's property
2690
  // hooks.  And then structures which embedded a pointer to this structure
2691
  // would require a run-time load for proper initialization, which would
2692
  // then induce static constructors.  Lots of static constructors.
2693
  extern const NativePropertyHooks sNativePropertyHooks[];
2694
2695
  void
2696
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
2697
2698
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
2699
0
  {
2700
0
    /* Get the interface prototype object for this class.  This will create the
2701
0
       object as needed. */
2702
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WebGLRenderbuffer,
2703
0
                                       &CreateInterfaceObjects,
2704
0
                                       /* aDefineOnGlobal = */ true);
2705
0
2706
0
  }
2707
2708
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
2709
0
  {
2710
0
    /* Get the interface object for this class.  This will create the object as
2711
0
       needed. */
2712
0
2713
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::WebGLRenderbuffer,
2714
0
                                       &CreateInterfaceObjects,
2715
0
                                       aDefineOnGlobal);
2716
0
  }
2717
2718
  JSObject*
2719
  GetConstructorObject(JSContext* aCx);
2720
2721
} // namespace WebGLRenderbuffer_Binding
2722
2723
2724
2725
namespace WebGLRenderingContext_Binding {
2726
2727
  typedef mozilla::WebGLContext NativeType;
2728
2729
  static const uint32_t DEPTH_BUFFER_BIT = 256;
2730
  static const uint32_t STENCIL_BUFFER_BIT = 1024;
2731
  static const uint32_t COLOR_BUFFER_BIT = 16384;
2732
  static const uint32_t POINTS = 0;
2733
  static const uint32_t LINES = 1;
2734
  static const uint32_t LINE_LOOP = 2;
2735
  static const uint32_t LINE_STRIP = 3;
2736
  static const uint32_t TRIANGLES = 4;
2737
  static const uint32_t TRIANGLE_STRIP = 5;
2738
  static const uint32_t TRIANGLE_FAN = 6;
2739
  static const uint32_t ZERO = 0;
2740
  static const uint32_t ONE = 1;
2741
  static const uint32_t SRC_COLOR = 768;
2742
  static const uint32_t ONE_MINUS_SRC_COLOR = 769;
2743
  static const uint32_t SRC_ALPHA = 770;
2744
  static const uint32_t ONE_MINUS_SRC_ALPHA = 771;
2745
  static const uint32_t DST_ALPHA = 772;
2746
  static const uint32_t ONE_MINUS_DST_ALPHA = 773;
2747
  static const uint32_t DST_COLOR = 774;
2748
  static const uint32_t ONE_MINUS_DST_COLOR = 775;
2749
  static const uint32_t SRC_ALPHA_SATURATE = 776;
2750
  static const uint32_t FUNC_ADD = 32774;
2751
  static const uint32_t BLEND_EQUATION = 32777;
2752
  static const uint32_t BLEND_EQUATION_RGB = 32777;
2753
  static const uint32_t BLEND_EQUATION_ALPHA = 34877;
2754
  static const uint32_t FUNC_SUBTRACT = 32778;
2755
  static const uint32_t FUNC_REVERSE_SUBTRACT = 32779;
2756
  static const uint32_t BLEND_DST_RGB = 32968;
2757
  static const uint32_t BLEND_SRC_RGB = 32969;
2758
  static const uint32_t BLEND_DST_ALPHA = 32970;
2759
  static const uint32_t BLEND_SRC_ALPHA = 32971;
2760
  static const uint32_t CONSTANT_COLOR = 32769;
2761
  static const uint32_t ONE_MINUS_CONSTANT_COLOR = 32770;
2762
  static const uint32_t CONSTANT_ALPHA = 32771;
2763
  static const uint32_t ONE_MINUS_CONSTANT_ALPHA = 32772;
2764
  static const uint32_t BLEND_COLOR = 32773;
2765
  static const uint32_t ARRAY_BUFFER = 34962;
2766
  static const uint32_t ELEMENT_ARRAY_BUFFER = 34963;
2767
  static const uint32_t ARRAY_BUFFER_BINDING = 34964;
2768
  static const uint32_t ELEMENT_ARRAY_BUFFER_BINDING = 34965;
2769
  static const uint32_t STREAM_DRAW = 35040;
2770
  static const uint32_t STATIC_DRAW = 35044;
2771
  static const uint32_t DYNAMIC_DRAW = 35048;
2772
  static const uint32_t BUFFER_SIZE = 34660;
2773
  static const uint32_t BUFFER_USAGE = 34661;
2774
  static const uint32_t CURRENT_VERTEX_ATTRIB = 34342;
2775
  static const uint32_t FRONT = 1028;
2776
  static const uint32_t BACK = 1029;
2777
  static const uint32_t FRONT_AND_BACK = 1032;
2778
  static const uint32_t CULL_FACE = 2884;
2779
  static const uint32_t BLEND = 3042;
2780
  static const uint32_t DITHER = 3024;
2781
  static const uint32_t STENCIL_TEST = 2960;
2782
  static const uint32_t DEPTH_TEST = 2929;
2783
  static const uint32_t SCISSOR_TEST = 3089;
2784
  static const uint32_t POLYGON_OFFSET_FILL = 32823;
2785
  static const uint32_t SAMPLE_ALPHA_TO_COVERAGE = 32926;
2786
  static const uint32_t SAMPLE_COVERAGE = 32928;
2787
#ifdef XP_WIN
2788
#undef NO_ERROR
2789
#endif // XP_WIN
2790
  static const uint32_t NO_ERROR = 0;
2791
2792
  static const uint32_t INVALID_ENUM = 1280;
2793
  static const uint32_t INVALID_VALUE = 1281;
2794
  static const uint32_t INVALID_OPERATION = 1282;
2795
  static const uint32_t OUT_OF_MEMORY = 1285;
2796
  static const uint32_t CW = 2304;
2797
  static const uint32_t CCW = 2305;
2798
  static const uint32_t LINE_WIDTH = 2849;
2799
  static const uint32_t ALIASED_POINT_SIZE_RANGE = 33901;
2800
  static const uint32_t ALIASED_LINE_WIDTH_RANGE = 33902;
2801
  static const uint32_t CULL_FACE_MODE = 2885;
2802
  static const uint32_t FRONT_FACE = 2886;
2803
  static const uint32_t DEPTH_RANGE = 2928;
2804
  static const uint32_t DEPTH_WRITEMASK = 2930;
2805
  static const uint32_t DEPTH_CLEAR_VALUE = 2931;
2806
  static const uint32_t DEPTH_FUNC = 2932;
2807
  static const uint32_t STENCIL_CLEAR_VALUE = 2961;
2808
  static const uint32_t STENCIL_FUNC = 2962;
2809
  static const uint32_t STENCIL_FAIL = 2964;
2810
  static const uint32_t STENCIL_PASS_DEPTH_FAIL = 2965;
2811
  static const uint32_t STENCIL_PASS_DEPTH_PASS = 2966;
2812
  static const uint32_t STENCIL_REF = 2967;
2813
  static const uint32_t STENCIL_VALUE_MASK = 2963;
2814
  static const uint32_t STENCIL_WRITEMASK = 2968;
2815
  static const uint32_t STENCIL_BACK_FUNC = 34816;
2816
  static const uint32_t STENCIL_BACK_FAIL = 34817;
2817
  static const uint32_t STENCIL_BACK_PASS_DEPTH_FAIL = 34818;
2818
  static const uint32_t STENCIL_BACK_PASS_DEPTH_PASS = 34819;
2819
  static const uint32_t STENCIL_BACK_REF = 36003;
2820
  static const uint32_t STENCIL_BACK_VALUE_MASK = 36004;
2821
  static const uint32_t STENCIL_BACK_WRITEMASK = 36005;
2822
  static const uint32_t VIEWPORT = 2978;
2823
  static const uint32_t SCISSOR_BOX = 3088;
2824
  static const uint32_t COLOR_CLEAR_VALUE = 3106;
2825
  static const uint32_t COLOR_WRITEMASK = 3107;
2826
  static const uint32_t UNPACK_ALIGNMENT = 3317;
2827
  static const uint32_t PACK_ALIGNMENT = 3333;
2828
  static const uint32_t MAX_TEXTURE_SIZE = 3379;
2829
  static const uint32_t MAX_VIEWPORT_DIMS = 3386;
2830
  static const uint32_t SUBPIXEL_BITS = 3408;
2831
  static const uint32_t RED_BITS = 3410;
2832
  static const uint32_t GREEN_BITS = 3411;
2833
  static const uint32_t BLUE_BITS = 3412;
2834
  static const uint32_t ALPHA_BITS = 3413;
2835
  static const uint32_t DEPTH_BITS = 3414;
2836
  static const uint32_t STENCIL_BITS = 3415;
2837
  static const uint32_t POLYGON_OFFSET_UNITS = 10752;
2838
  static const uint32_t POLYGON_OFFSET_FACTOR = 32824;
2839
  static const uint32_t TEXTURE_BINDING_2D = 32873;
2840
  static const uint32_t SAMPLE_BUFFERS = 32936;
2841
  static const uint32_t SAMPLES = 32937;
2842
  static const uint32_t SAMPLE_COVERAGE_VALUE = 32938;
2843
  static const uint32_t SAMPLE_COVERAGE_INVERT = 32939;
2844
  static const uint32_t COMPRESSED_TEXTURE_FORMATS = 34467;
2845
  static const uint32_t DONT_CARE = 4352;
2846
  static const uint32_t FASTEST = 4353;
2847
  static const uint32_t NICEST = 4354;
2848
  static const uint32_t GENERATE_MIPMAP_HINT = 33170;
2849
  static const uint32_t BYTE = 5120;
2850
  static const uint32_t UNSIGNED_BYTE = 5121;
2851
  static const uint32_t SHORT = 5122;
2852
  static const uint32_t UNSIGNED_SHORT = 5123;
2853
  static const uint32_t INT = 5124;
2854
  static const uint32_t UNSIGNED_INT = 5125;
2855
  static const uint32_t FLOAT = 5126;
2856
  static const uint32_t DEPTH_COMPONENT = 6402;
2857
  static const uint32_t ALPHA = 6406;
2858
  static const uint32_t RGB = 6407;
2859
  static const uint32_t RGBA = 6408;
2860
  static const uint32_t LUMINANCE = 6409;
2861
  static const uint32_t LUMINANCE_ALPHA = 6410;
2862
  static const uint32_t UNSIGNED_SHORT_4_4_4_4 = 32819;
2863
  static const uint32_t UNSIGNED_SHORT_5_5_5_1 = 32820;
2864
  static const uint32_t UNSIGNED_SHORT_5_6_5 = 33635;
2865
  static const uint32_t FRAGMENT_SHADER = 35632;
2866
  static const uint32_t VERTEX_SHADER = 35633;
2867
  static const uint32_t MAX_VERTEX_ATTRIBS = 34921;
2868
  static const uint32_t MAX_VERTEX_UNIFORM_VECTORS = 36347;
2869
  static const uint32_t MAX_VARYING_VECTORS = 36348;
2870
  static const uint32_t MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661;
2871
  static const uint32_t MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660;
2872
  static const uint32_t MAX_TEXTURE_IMAGE_UNITS = 34930;
2873
  static const uint32_t MAX_FRAGMENT_UNIFORM_VECTORS = 36349;
2874
  static const uint32_t SHADER_TYPE = 35663;
2875
  static const uint32_t DELETE_STATUS = 35712;
2876
  static const uint32_t LINK_STATUS = 35714;
2877
  static const uint32_t VALIDATE_STATUS = 35715;
2878
  static const uint32_t ATTACHED_SHADERS = 35717;
2879
  static const uint32_t ACTIVE_UNIFORMS = 35718;
2880
  static const uint32_t ACTIVE_ATTRIBUTES = 35721;
2881
  static const uint32_t SHADING_LANGUAGE_VERSION = 35724;
2882
  static const uint32_t CURRENT_PROGRAM = 35725;
2883
  static const uint32_t NEVER = 512;
2884
  static const uint32_t LESS = 513;
2885
  static const uint32_t EQUAL = 514;
2886
  static const uint32_t LEQUAL = 515;
2887
  static const uint32_t GREATER = 516;
2888
  static const uint32_t NOTEQUAL = 517;
2889
  static const uint32_t GEQUAL = 518;
2890
  static const uint32_t ALWAYS = 519;
2891
  static const uint32_t KEEP = 7680;
2892
  static const uint32_t REPLACE = 7681;
2893
  static const uint32_t INCR = 7682;
2894
  static const uint32_t DECR = 7683;
2895
  static const uint32_t INVERT = 5386;
2896
  static const uint32_t INCR_WRAP = 34055;
2897
  static const uint32_t DECR_WRAP = 34056;
2898
  static const uint32_t VENDOR = 7936;
2899
  static const uint32_t RENDERER = 7937;
2900
  static const uint32_t VERSION = 7938;
2901
  static const uint32_t NEAREST = 9728;
2902
  static const uint32_t LINEAR = 9729;
2903
  static const uint32_t NEAREST_MIPMAP_NEAREST = 9984;
2904
  static const uint32_t LINEAR_MIPMAP_NEAREST = 9985;
2905
  static const uint32_t NEAREST_MIPMAP_LINEAR = 9986;
2906
  static const uint32_t LINEAR_MIPMAP_LINEAR = 9987;
2907
  static const uint32_t TEXTURE_MAG_FILTER = 10240;
2908
  static const uint32_t TEXTURE_MIN_FILTER = 10241;
2909
  static const uint32_t TEXTURE_WRAP_S = 10242;
2910
  static const uint32_t TEXTURE_WRAP_T = 10243;
2911
  static const uint32_t TEXTURE_2D = 3553;
2912
  static const uint32_t TEXTURE = 5890;
2913
  static const uint32_t TEXTURE_CUBE_MAP = 34067;
2914
  static const uint32_t TEXTURE_BINDING_CUBE_MAP = 34068;
2915
  static const uint32_t TEXTURE_CUBE_MAP_POSITIVE_X = 34069;
2916
  static const uint32_t TEXTURE_CUBE_MAP_NEGATIVE_X = 34070;
2917
  static const uint32_t TEXTURE_CUBE_MAP_POSITIVE_Y = 34071;
2918
  static const uint32_t TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072;
2919
  static const uint32_t TEXTURE_CUBE_MAP_POSITIVE_Z = 34073;
2920
  static const uint32_t TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074;
2921
  static const uint32_t MAX_CUBE_MAP_TEXTURE_SIZE = 34076;
2922
  static const uint32_t TEXTURE0 = 33984;
2923
  static const uint32_t TEXTURE1 = 33985;
2924
  static const uint32_t TEXTURE2 = 33986;
2925
  static const uint32_t TEXTURE3 = 33987;
2926
  static const uint32_t TEXTURE4 = 33988;
2927
  static const uint32_t TEXTURE5 = 33989;
2928
  static const uint32_t TEXTURE6 = 33990;
2929
  static const uint32_t TEXTURE7 = 33991;
2930
  static const uint32_t TEXTURE8 = 33992;
2931
  static const uint32_t TEXTURE9 = 33993;
2932
  static const uint32_t TEXTURE10 = 33994;
2933
  static const uint32_t TEXTURE11 = 33995;
2934
  static const uint32_t TEXTURE12 = 33996;
2935
  static const uint32_t TEXTURE13 = 33997;
2936
  static const uint32_t TEXTURE14 = 33998;
2937
  static const uint32_t TEXTURE15 = 33999;
2938
  static const uint32_t TEXTURE16 = 34000;
2939
  static const uint32_t TEXTURE17 = 34001;
2940
  static const uint32_t TEXTURE18 = 34002;
2941
  static const uint32_t TEXTURE19 = 34003;
2942
  static const uint32_t TEXTURE20 = 34004;
2943
  static const uint32_t TEXTURE21 = 34005;
2944
  static const uint32_t TEXTURE22 = 34006;
2945
  static const uint32_t TEXTURE23 = 34007;
2946
  static const uint32_t TEXTURE24 = 34008;
2947
  static const uint32_t TEXTURE25 = 34009;
2948
  static const uint32_t TEXTURE26 = 34010;
2949
  static const uint32_t TEXTURE27 = 34011;
2950
  static const uint32_t TEXTURE28 = 34012;
2951
  static const uint32_t TEXTURE29 = 34013;
2952
  static const uint32_t TEXTURE30 = 34014;
2953
  static const uint32_t TEXTURE31 = 34015;
2954
  static const uint32_t ACTIVE_TEXTURE = 34016;
2955
  static const uint32_t REPEAT = 10497;
2956
  static const uint32_t CLAMP_TO_EDGE = 33071;
2957
  static const uint32_t MIRRORED_REPEAT = 33648;
2958
  static const uint32_t FLOAT_VEC2 = 35664;
2959
  static const uint32_t FLOAT_VEC3 = 35665;
2960
  static const uint32_t FLOAT_VEC4 = 35666;
2961
  static const uint32_t INT_VEC2 = 35667;
2962
  static const uint32_t INT_VEC3 = 35668;
2963
  static const uint32_t INT_VEC4 = 35669;
2964
  static const uint32_t BOOL = 35670;
2965
  static const uint32_t BOOL_VEC2 = 35671;
2966
  static const uint32_t BOOL_VEC3 = 35672;
2967
  static const uint32_t BOOL_VEC4 = 35673;
2968
  static const uint32_t FLOAT_MAT2 = 35674;
2969
  static const uint32_t FLOAT_MAT3 = 35675;
2970
  static const uint32_t FLOAT_MAT4 = 35676;
2971
  static const uint32_t SAMPLER_2D = 35678;
2972
  static const uint32_t SAMPLER_CUBE = 35680;
2973
  static const uint32_t VERTEX_ATTRIB_ARRAY_ENABLED = 34338;
2974
  static const uint32_t VERTEX_ATTRIB_ARRAY_SIZE = 34339;
2975
  static const uint32_t VERTEX_ATTRIB_ARRAY_STRIDE = 34340;
2976
  static const uint32_t VERTEX_ATTRIB_ARRAY_TYPE = 34341;
2977
  static const uint32_t VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922;
2978
  static const uint32_t VERTEX_ATTRIB_ARRAY_POINTER = 34373;
2979
  static const uint32_t VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975;
2980
  static const uint32_t IMPLEMENTATION_COLOR_READ_TYPE = 35738;
2981
  static const uint32_t IMPLEMENTATION_COLOR_READ_FORMAT = 35739;
2982
  static const uint32_t COMPILE_STATUS = 35713;
2983
  static const uint32_t LOW_FLOAT = 36336;
2984
  static const uint32_t MEDIUM_FLOAT = 36337;
2985
  static const uint32_t HIGH_FLOAT = 36338;
2986
  static const uint32_t LOW_INT = 36339;
2987
  static const uint32_t MEDIUM_INT = 36340;
2988
  static const uint32_t HIGH_INT = 36341;
2989
  static const uint32_t FRAMEBUFFER = 36160;
2990
  static const uint32_t RENDERBUFFER = 36161;
2991
  static const uint32_t RGBA4 = 32854;
2992
  static const uint32_t RGB5_A1 = 32855;
2993
  static const uint32_t RGB565 = 36194;
2994
  static const uint32_t DEPTH_COMPONENT16 = 33189;
2995
  static const uint32_t STENCIL_INDEX8 = 36168;
2996
  static const uint32_t DEPTH_STENCIL = 34041;
2997
  static const uint32_t RENDERBUFFER_WIDTH = 36162;
2998
  static const uint32_t RENDERBUFFER_HEIGHT = 36163;
2999
  static const uint32_t RENDERBUFFER_INTERNAL_FORMAT = 36164;
3000
  static const uint32_t RENDERBUFFER_RED_SIZE = 36176;
3001
  static const uint32_t RENDERBUFFER_GREEN_SIZE = 36177;
3002
  static const uint32_t RENDERBUFFER_BLUE_SIZE = 36178;
3003
  static const uint32_t RENDERBUFFER_ALPHA_SIZE = 36179;
3004
  static const uint32_t RENDERBUFFER_DEPTH_SIZE = 36180;
3005
  static const uint32_t RENDERBUFFER_STENCIL_SIZE = 36181;
3006
  static const uint32_t FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 36048;
3007
  static const uint32_t FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 36049;
3008
  static const uint32_t FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 36050;
3009
  static const uint32_t FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 36051;
3010
  static const uint32_t COLOR_ATTACHMENT0 = 36064;
3011
  static const uint32_t DEPTH_ATTACHMENT = 36096;
3012
  static const uint32_t STENCIL_ATTACHMENT = 36128;
3013
  static const uint32_t DEPTH_STENCIL_ATTACHMENT = 33306;
3014
  static const uint32_t NONE = 0;
3015
  static const uint32_t FRAMEBUFFER_COMPLETE = 36053;
3016
  static const uint32_t FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054;
3017
  static const uint32_t FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055;
3018
  static const uint32_t FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 36057;
3019
  static const uint32_t FRAMEBUFFER_UNSUPPORTED = 36061;
3020
  static const uint32_t FRAMEBUFFER_BINDING = 36006;
3021
  static const uint32_t RENDERBUFFER_BINDING = 36007;
3022
  static const uint32_t MAX_RENDERBUFFER_SIZE = 34024;
3023
  static const uint32_t INVALID_FRAMEBUFFER_OPERATION = 1286;
3024
  static const uint32_t UNPACK_FLIP_Y_WEBGL = 37440;
3025
  static const uint32_t UNPACK_PREMULTIPLY_ALPHA_WEBGL = 37441;
3026
  static const uint32_t CONTEXT_LOST_WEBGL = 37442;
3027
  static const uint32_t UNPACK_COLORSPACE_CONVERSION_WEBGL = 37443;
3028
  static const uint32_t BROWSER_DEFAULT_WEBGL = 37444;
3029
  bool
3030
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
3031
3032
  const JSClass*
3033
  GetJSClass();
3034
3035
  bool
3036
  Wrap(JSContext* aCx, mozilla::WebGLContext* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
3037
3038
  template <class T>
3039
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
3040
0
  {
3041
0
    JS::Rooted<JSObject*> reflector(aCx);
3042
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
3043
0
  }
3044
3045
  // We declare this as an array so that retrieving a pointer to this
3046
  // binding's property hooks only requires compile/link-time resolvable
3047
  // address arithmetic.  Declaring it as a pointer instead would require
3048
  // doing a run-time load to fetch a pointer to this binding's property
3049
  // hooks.  And then structures which embedded a pointer to this structure
3050
  // would require a run-time load for proper initialization, which would
3051
  // then induce static constructors.  Lots of static constructors.
3052
  extern const NativePropertyHooks sNativePropertyHooks[];
3053
3054
  void
3055
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
3056
3057
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
3058
0
  {
3059
0
    /* Get the interface prototype object for this class.  This will create the
3060
0
       object as needed. */
3061
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WebGLRenderingContext,
3062
0
                                       &CreateInterfaceObjects,
3063
0
                                       /* aDefineOnGlobal = */ true);
3064
0
3065
0
  }
3066
3067
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
3068
0
  {
3069
0
    /* Get the interface object for this class.  This will create the object as
3070
0
       needed. */
3071
0
3072
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::WebGLRenderingContext,
3073
0
                                       &CreateInterfaceObjects,
3074
0
                                       aDefineOnGlobal);
3075
0
  }
3076
3077
  JSObject*
3078
  GetConstructorObject(JSContext* aCx);
3079
3080
} // namespace WebGLRenderingContext_Binding
3081
3082
3083
3084
namespace WebGLShader_Binding {
3085
3086
  typedef mozilla::WebGLShader NativeType;
3087
3088
  bool
3089
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
3090
3091
  const JSClass*
3092
  GetJSClass();
3093
3094
  bool
3095
  Wrap(JSContext* aCx, mozilla::WebGLShader* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
3096
3097
  template <class T>
3098
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
3099
0
  {
3100
0
    JS::Rooted<JSObject*> reflector(aCx);
3101
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
3102
0
  }
3103
3104
  // We declare this as an array so that retrieving a pointer to this
3105
  // binding's property hooks only requires compile/link-time resolvable
3106
  // address arithmetic.  Declaring it as a pointer instead would require
3107
  // doing a run-time load to fetch a pointer to this binding's property
3108
  // hooks.  And then structures which embedded a pointer to this structure
3109
  // would require a run-time load for proper initialization, which would
3110
  // then induce static constructors.  Lots of static constructors.
3111
  extern const NativePropertyHooks sNativePropertyHooks[];
3112
3113
  void
3114
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
3115
3116
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
3117
0
  {
3118
0
    /* Get the interface prototype object for this class.  This will create the
3119
0
       object as needed. */
3120
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WebGLShader,
3121
0
                                       &CreateInterfaceObjects,
3122
0
                                       /* aDefineOnGlobal = */ true);
3123
0
3124
0
  }
3125
3126
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
3127
0
  {
3128
0
    /* Get the interface object for this class.  This will create the object as
3129
0
       needed. */
3130
0
3131
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::WebGLShader,
3132
0
                                       &CreateInterfaceObjects,
3133
0
                                       aDefineOnGlobal);
3134
0
  }
3135
3136
  JSObject*
3137
  GetConstructorObject(JSContext* aCx);
3138
3139
} // namespace WebGLShader_Binding
3140
3141
3142
3143
namespace WebGLShaderPrecisionFormat_Binding {
3144
3145
  typedef mozilla::WebGLShaderPrecisionFormat NativeType;
3146
3147
  bool
3148
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
3149
3150
  const JSClass*
3151
  GetJSClass();
3152
3153
  bool
3154
  Wrap(JSContext* aCx, mozilla::WebGLShaderPrecisionFormat* aObject, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
3155
3156
  // We declare this as an array so that retrieving a pointer to this
3157
  // binding's property hooks only requires compile/link-time resolvable
3158
  // address arithmetic.  Declaring it as a pointer instead would require
3159
  // doing a run-time load to fetch a pointer to this binding's property
3160
  // hooks.  And then structures which embedded a pointer to this structure
3161
  // would require a run-time load for proper initialization, which would
3162
  // then induce static constructors.  Lots of static constructors.
3163
  extern const NativePropertyHooks sNativePropertyHooks[];
3164
3165
  void
3166
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
3167
3168
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
3169
0
  {
3170
0
    /* Get the interface prototype object for this class.  This will create the
3171
0
       object as needed. */
3172
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WebGLShaderPrecisionFormat,
3173
0
                                       &CreateInterfaceObjects,
3174
0
                                       /* aDefineOnGlobal = */ true);
3175
0
3176
0
  }
3177
3178
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
3179
0
  {
3180
0
    /* Get the interface object for this class.  This will create the object as
3181
0
       needed. */
3182
0
3183
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::WebGLShaderPrecisionFormat,
3184
0
                                       &CreateInterfaceObjects,
3185
0
                                       aDefineOnGlobal);
3186
0
  }
3187
3188
  JSObject*
3189
  GetConstructorObject(JSContext* aCx);
3190
3191
} // namespace WebGLShaderPrecisionFormat_Binding
3192
3193
3194
3195
namespace WebGLTexture_Binding {
3196
3197
  typedef mozilla::WebGLTexture NativeType;
3198
3199
  bool
3200
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
3201
3202
  const JSClass*
3203
  GetJSClass();
3204
3205
  bool
3206
  Wrap(JSContext* aCx, mozilla::WebGLTexture* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
3207
3208
  template <class T>
3209
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
3210
0
  {
3211
0
    JS::Rooted<JSObject*> reflector(aCx);
3212
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
3213
0
  }
3214
3215
  // We declare this as an array so that retrieving a pointer to this
3216
  // binding's property hooks only requires compile/link-time resolvable
3217
  // address arithmetic.  Declaring it as a pointer instead would require
3218
  // doing a run-time load to fetch a pointer to this binding's property
3219
  // hooks.  And then structures which embedded a pointer to this structure
3220
  // would require a run-time load for proper initialization, which would
3221
  // then induce static constructors.  Lots of static constructors.
3222
  extern const NativePropertyHooks sNativePropertyHooks[];
3223
3224
  void
3225
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
3226
3227
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
3228
0
  {
3229
0
    /* Get the interface prototype object for this class.  This will create the
3230
0
       object as needed. */
3231
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WebGLTexture,
3232
0
                                       &CreateInterfaceObjects,
3233
0
                                       /* aDefineOnGlobal = */ true);
3234
0
3235
0
  }
3236
3237
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
3238
0
  {
3239
0
    /* Get the interface object for this class.  This will create the object as
3240
0
       needed. */
3241
0
3242
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::WebGLTexture,
3243
0
                                       &CreateInterfaceObjects,
3244
0
                                       aDefineOnGlobal);
3245
0
  }
3246
3247
  JSObject*
3248
  GetConstructorObject(JSContext* aCx);
3249
3250
} // namespace WebGLTexture_Binding
3251
3252
3253
3254
namespace WebGLUniformLocation_Binding {
3255
3256
  typedef mozilla::WebGLUniformLocation NativeType;
3257
3258
  bool
3259
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
3260
3261
  const JSClass*
3262
  GetJSClass();
3263
3264
  bool
3265
  Wrap(JSContext* aCx, mozilla::WebGLUniformLocation* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
3266
3267
  template <class T>
3268
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
3269
0
  {
3270
0
    JS::Rooted<JSObject*> reflector(aCx);
3271
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
3272
0
  }
3273
3274
  // We declare this as an array so that retrieving a pointer to this
3275
  // binding's property hooks only requires compile/link-time resolvable
3276
  // address arithmetic.  Declaring it as a pointer instead would require
3277
  // doing a run-time load to fetch a pointer to this binding's property
3278
  // hooks.  And then structures which embedded a pointer to this structure
3279
  // would require a run-time load for proper initialization, which would
3280
  // then induce static constructors.  Lots of static constructors.
3281
  extern const NativePropertyHooks sNativePropertyHooks[];
3282
3283
  void
3284
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
3285
3286
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
3287
0
  {
3288
0
    /* Get the interface prototype object for this class.  This will create the
3289
0
       object as needed. */
3290
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WebGLUniformLocation,
3291
0
                                       &CreateInterfaceObjects,
3292
0
                                       /* aDefineOnGlobal = */ true);
3293
0
3294
0
  }
3295
3296
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
3297
0
  {
3298
0
    /* Get the interface object for this class.  This will create the object as
3299
0
       needed. */
3300
0
3301
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::WebGLUniformLocation,
3302
0
                                       &CreateInterfaceObjects,
3303
0
                                       aDefineOnGlobal);
3304
0
  }
3305
3306
  JSObject*
3307
  GetConstructorObject(JSContext* aCx);
3308
3309
} // namespace WebGLUniformLocation_Binding
3310
3311
3312
3313
namespace WebGLVertexArrayObject_Binding {
3314
3315
  typedef mozilla::WebGLVertexArray NativeType;
3316
3317
  const JSClass*
3318
  GetJSClass();
3319
3320
  bool
3321
  Wrap(JSContext* aCx, mozilla::WebGLVertexArray* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
3322
3323
  template <class T>
3324
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
3325
0
  {
3326
0
    JS::Rooted<JSObject*> reflector(aCx);
3327
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
3328
0
  }
Unexecuted instantiation: JSObject* mozilla::dom::WebGLVertexArrayObject_Binding::Wrap<mozilla::WebGLVertexArray>(JSContext*, mozilla::WebGLVertexArray*, JS::Handle<JSObject*>)
Unexecuted instantiation: JSObject* mozilla::dom::WebGLVertexArrayObject_Binding::Wrap<mozilla::dom::WebGLVertexArrayObject>(JSContext*, mozilla::dom::WebGLVertexArrayObject*, JS::Handle<JSObject*>)
3329
3330
  // We declare this as an array so that retrieving a pointer to this
3331
  // binding's property hooks only requires compile/link-time resolvable
3332
  // address arithmetic.  Declaring it as a pointer instead would require
3333
  // doing a run-time load to fetch a pointer to this binding's property
3334
  // hooks.  And then structures which embedded a pointer to this structure
3335
  // would require a run-time load for proper initialization, which would
3336
  // then induce static constructors.  Lots of static constructors.
3337
  extern const NativePropertyHooks sNativePropertyHooks[];
3338
3339
  void
3340
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
3341
3342
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
3343
0
  {
3344
0
    /* Get the interface prototype object for this class.  This will create the
3345
0
       object as needed. */
3346
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::WebGLVertexArrayObject,
3347
0
                                       &CreateInterfaceObjects,
3348
0
                                       /* aDefineOnGlobal = */ true);
3349
0
3350
0
  }
3351
3352
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
3353
0
  {
3354
0
    /* Get the interface object for this class.  This will create the object as
3355
0
       needed. */
3356
0
3357
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::WebGLVertexArrayObject,
3358
0
                                       &CreateInterfaceObjects,
3359
0
                                       aDefineOnGlobal);
3360
0
  }
3361
3362
  JSObject*
3363
  GetConstructorObject(JSContext* aCx);
3364
3365
} // namespace WebGLVertexArrayObject_Binding
3366
3367
3368
3369
} // namespace dom
3370
} // namespace mozilla
3371
3372
#endif // mozilla_dom_WebGLRenderingContextBinding_h