Coverage Report

Created: 2018-09-25 14:53

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