Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/GamepadBinding.h
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM Gamepad.webidl BY Codegen.py - DO NOT EDIT */
2
3
#ifndef mozilla_dom_GamepadBinding_h
4
#define mozilla_dom_GamepadBinding_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 Gamepad;
18
struct GamepadAtoms;
19
class GamepadButton;
20
struct GamepadButtonAtoms;
21
struct NativePropertyHooks;
22
class ProtoAndIfaceCache;
23
24
} // namespace dom
25
} // namespace mozilla
26
27
namespace mozilla {
28
namespace dom {
29
30
enum class GamepadHand : uint8_t {
31
  _empty,
32
  Left,
33
  Right,
34
  EndGuard_
35
};
36
37
namespace GamepadHandValues {
38
extern const EnumEntry strings[4];
39
} // namespace GamepadHandValues
40
41
bool
42
ToJSValue(JSContext* aCx, GamepadHand aArgument, JS::MutableHandle<JS::Value> aValue);
43
44
45
enum class GamepadMappingType : uint8_t {
46
  _empty,
47
  Standard,
48
  EndGuard_
49
};
50
51
namespace GamepadMappingTypeValues {
52
extern const EnumEntry strings[3];
53
} // namespace GamepadMappingTypeValues
54
55
bool
56
ToJSValue(JSContext* aCx, GamepadMappingType aArgument, JS::MutableHandle<JS::Value> aValue);
57
58
59
namespace Gamepad_Binding {
60
61
  typedef mozilla::dom::Gamepad NativeType;
62
63
  bool
64
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
65
66
  const JSClass*
67
  GetJSClass();
68
69
  bool
70
  Wrap(JSContext* aCx, mozilla::dom::Gamepad* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
71
72
  template <class T>
73
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
74
0
  {
75
0
    JS::Rooted<JSObject*> reflector(aCx);
76
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
77
0
  }
78
79
  // We declare this as an array so that retrieving a pointer to this
80
  // binding's property hooks only requires compile/link-time resolvable
81
  // address arithmetic.  Declaring it as a pointer instead would require
82
  // doing a run-time load to fetch a pointer to this binding's property
83
  // hooks.  And then structures which embedded a pointer to this structure
84
  // would require a run-time load for proper initialization, which would
85
  // then induce static constructors.  Lots of static constructors.
86
  extern const NativePropertyHooks sNativePropertyHooks[];
87
88
  void
89
  ClearCachedButtonsValue(mozilla::dom::Gamepad* aObject);
90
91
  void
92
  ClearCachedAxesValue(mozilla::dom::Gamepad* aObject);
93
94
  void
95
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
96
97
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
98
0
  {
99
0
    /* Get the interface prototype object for this class.  This will create the
100
0
       object as needed. */
101
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::Gamepad,
102
0
                                       &CreateInterfaceObjects,
103
0
                                       /* aDefineOnGlobal = */ true);
104
0
105
0
  }
106
107
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
108
0
  {
109
0
    /* Get the interface object for this class.  This will create the object as
110
0
       needed. */
111
0
112
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::Gamepad,
113
0
                                       &CreateInterfaceObjects,
114
0
                                       aDefineOnGlobal);
115
0
  }
116
117
  JSObject*
118
  GetConstructorObject(JSContext* aCx);
119
120
} // namespace Gamepad_Binding
121
122
123
124
namespace GamepadButton_Binding {
125
126
  typedef mozilla::dom::GamepadButton NativeType;
127
128
  bool
129
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
130
131
  const JSClass*
132
  GetJSClass();
133
134
  bool
135
  Wrap(JSContext* aCx, mozilla::dom::GamepadButton* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
136
137
  template <class T>
138
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
139
0
  {
140
0
    JS::Rooted<JSObject*> reflector(aCx);
141
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
142
0
  }
143
144
  // We declare this as an array so that retrieving a pointer to this
145
  // binding's property hooks only requires compile/link-time resolvable
146
  // address arithmetic.  Declaring it as a pointer instead would require
147
  // doing a run-time load to fetch a pointer to this binding's property
148
  // hooks.  And then structures which embedded a pointer to this structure
149
  // would require a run-time load for proper initialization, which would
150
  // then induce static constructors.  Lots of static constructors.
151
  extern const NativePropertyHooks sNativePropertyHooks[];
152
153
  void
154
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
155
156
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
157
0
  {
158
0
    /* Get the interface prototype object for this class.  This will create the
159
0
       object as needed. */
160
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::GamepadButton,
161
0
                                       &CreateInterfaceObjects,
162
0
                                       /* aDefineOnGlobal = */ true);
163
0
164
0
  }
165
166
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
167
0
  {
168
0
    /* Get the interface object for this class.  This will create the object as
169
0
       needed. */
170
0
171
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::GamepadButton,
172
0
                                       &CreateInterfaceObjects,
173
0
                                       aDefineOnGlobal);
174
0
  }
175
176
  JSObject*
177
  GetConstructorObject(JSContext* aCx);
178
179
} // namespace GamepadButton_Binding
180
181
182
183
} // namespace dom
184
} // namespace mozilla
185
186
#endif // mozilla_dom_GamepadBinding_h