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