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