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