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