/work/obj-fuzz/dist/include/mozilla/dom/AudioBufferBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM AudioBuffer.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_AudioBufferBinding_h |
4 | | #define mozilla_dom_AudioBufferBinding_h |
5 | | |
6 | | #include "GeckoProfiler.h" |
7 | | #include "js/RootingAPI.h" |
8 | | #include "jspubtd.h" |
9 | | #include "mozilla/ErrorResult.h" |
10 | | #include "mozilla/dom/BindingDeclarations.h" |
11 | | #include "mozilla/dom/Nullable.h" |
12 | | #include "mozilla/dom/PrototypeList.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace dom { |
16 | | |
17 | | class AudioBuffer; |
18 | | struct AudioBufferAtoms; |
19 | | struct AudioBufferOptionsAtoms; |
20 | | struct NativePropertyHooks; |
21 | | class ProtoAndIfaceCache; |
22 | | |
23 | | } // namespace dom |
24 | | } // namespace mozilla |
25 | | |
26 | | namespace mozilla { |
27 | | namespace dom { |
28 | | |
29 | | struct AudioBufferOptions : public DictionaryBase |
30 | | { |
31 | | MOZ_INIT_OUTSIDE_CTOR uint32_t mLength; |
32 | | MOZ_INIT_OUTSIDE_CTOR uint32_t mNumberOfChannels; |
33 | | MOZ_INIT_OUTSIDE_CTOR float mSampleRate; |
34 | | |
35 | | AudioBufferOptions(); |
36 | | |
37 | | explicit inline AudioBufferOptions(const FastDictionaryInitializer& ) |
38 | 0 | { |
39 | 0 | // Do nothing here; this is used by our "Fast" subclass |
40 | 0 | } |
41 | | |
42 | | explicit inline AudioBufferOptions(const AudioBufferOptions& aOther) |
43 | 0 | { |
44 | 0 | *this = aOther; |
45 | 0 | } |
46 | | |
47 | | bool |
48 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
49 | | |
50 | | bool |
51 | | Init(const nsAString& aJSON); |
52 | | |
53 | | bool |
54 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
55 | | |
56 | | bool |
57 | | ToJSON(nsAString& aJSON) const; |
58 | | |
59 | | void |
60 | | TraceDictionary(JSTracer* trc); |
61 | | |
62 | | AudioBufferOptions& |
63 | | operator=(const AudioBufferOptions& aOther); |
64 | | |
65 | | private: |
66 | | static bool |
67 | | InitIds(JSContext* cx, AudioBufferOptionsAtoms* atomsCache); |
68 | | }; |
69 | | |
70 | | namespace binding_detail { |
71 | | struct FastAudioBufferOptions : public AudioBufferOptions |
72 | | { |
73 | | inline FastAudioBufferOptions() |
74 | | : AudioBufferOptions(FastDictionaryInitializer()) |
75 | 0 | { |
76 | 0 | // Doesn't matter what int we pass to the parent constructor |
77 | 0 | } |
78 | | }; |
79 | | } // namespace binding_detail |
80 | | |
81 | | |
82 | | namespace AudioBuffer_Binding { |
83 | | |
84 | | typedef mozilla::dom::AudioBuffer NativeType; |
85 | | |
86 | | bool |
87 | | ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj); |
88 | | |
89 | | const JSClass* |
90 | | GetJSClass(); |
91 | | |
92 | | bool |
93 | | Wrap(JSContext* aCx, mozilla::dom::AudioBuffer* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
94 | | |
95 | | template <class T> |
96 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
97 | 0 | { |
98 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
99 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
100 | 0 | } |
101 | | |
102 | | // We declare this as an array so that retrieving a pointer to this |
103 | | // binding's property hooks only requires compile/link-time resolvable |
104 | | // address arithmetic. Declaring it as a pointer instead would require |
105 | | // doing a run-time load to fetch a pointer to this binding's property |
106 | | // hooks. And then structures which embedded a pointer to this structure |
107 | | // would require a run-time load for proper initialization, which would |
108 | | // then induce static constructors. Lots of static constructors. |
109 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
110 | | |
111 | | void |
112 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
113 | | |
114 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
115 | 0 | { |
116 | 0 | /* Get the interface prototype object for this class. This will create the |
117 | 0 | object as needed. */ |
118 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::AudioBuffer, |
119 | 0 | &CreateInterfaceObjects, |
120 | 0 | /* aDefineOnGlobal = */ true); |
121 | 0 |
|
122 | 0 | } |
123 | | |
124 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
125 | 0 | { |
126 | 0 | /* Get the interface object for this class. This will create the object as |
127 | 0 | needed. */ |
128 | 0 |
|
129 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::AudioBuffer, |
130 | 0 | &CreateInterfaceObjects, |
131 | 0 | aDefineOnGlobal); |
132 | 0 | } |
133 | | |
134 | | JSObject* |
135 | | GetConstructorObject(JSContext* aCx); |
136 | | |
137 | | } // namespace AudioBuffer_Binding |
138 | | |
139 | | |
140 | | |
141 | | } // namespace dom |
142 | | } // namespace mozilla |
143 | | |
144 | | #endif // mozilla_dom_AudioBufferBinding_h |