Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/DOMRectBinding.h
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM DOMRect.webidl BY Codegen.py - DO NOT EDIT */
2
3
#ifndef mozilla_dom_DOMRectBinding_h
4
#define mozilla_dom_DOMRectBinding_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 DOMRect;
18
struct DOMRectAtoms;
19
struct DOMRectInitAtoms;
20
class DOMRectReadOnly;
21
struct DOMRectReadOnlyAtoms;
22
struct NativePropertyHooks;
23
class ProtoAndIfaceCache;
24
25
} // namespace dom
26
} // namespace mozilla
27
28
namespace mozilla {
29
namespace dom {
30
31
struct DOMRectInit : public DictionaryBase
32
{
33
  MOZ_INIT_OUTSIDE_CTOR double mHeight;
34
  MOZ_INIT_OUTSIDE_CTOR double mWidth;
35
  MOZ_INIT_OUTSIDE_CTOR double mX;
36
  MOZ_INIT_OUTSIDE_CTOR double mY;
37
38
  DOMRectInit();
39
40
  explicit inline DOMRectInit(const FastDictionaryInitializer& )
41
0
  {
42
0
    // Do nothing here; this is used by our "Fast" subclass
43
0
  }
44
45
  explicit inline DOMRectInit(const DOMRectInit& aOther)
46
0
  {
47
0
    *this = aOther;
48
0
  }
49
50
  bool
51
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
52
53
  bool
54
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
55
56
  void
57
  TraceDictionary(JSTracer* trc);
58
59
  DOMRectInit&
60
  operator=(const DOMRectInit& aOther);
61
62
private:
63
  static bool
64
  InitIds(JSContext* cx, DOMRectInitAtoms* atomsCache);
65
};
66
67
namespace binding_detail {
68
struct FastDOMRectInit : public DOMRectInit
69
{
70
  inline FastDOMRectInit()
71
    : DOMRectInit(FastDictionaryInitializer())
72
0
  {
73
0
    // Doesn't matter what int we pass to the parent constructor
74
0
  }
75
};
76
} // namespace binding_detail
77
78
79
namespace DOMRect_Binding {
80
81
  typedef mozilla::dom::DOMRect NativeType;
82
83
  const JSClass*
84
  GetJSClass();
85
86
  bool
87
  Wrap(JSContext* aCx, mozilla::dom::DOMRect* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
88
89
  template <class T>
90
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
91
0
  {
92
0
    JS::Rooted<JSObject*> reflector(aCx);
93
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
94
0
  }
95
96
  // We declare this as an array so that retrieving a pointer to this
97
  // binding's property hooks only requires compile/link-time resolvable
98
  // address arithmetic.  Declaring it as a pointer instead would require
99
  // doing a run-time load to fetch a pointer to this binding's property
100
  // hooks.  And then structures which embedded a pointer to this structure
101
  // would require a run-time load for proper initialization, which would
102
  // then induce static constructors.  Lots of static constructors.
103
  extern const NativePropertyHooks sNativePropertyHooks[];
104
105
  void
106
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
107
108
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
109
0
  {
110
0
    /* Get the interface prototype object for this class.  This will create the
111
0
       object as needed. */
112
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::DOMRect,
113
0
                                       &CreateInterfaceObjects,
114
0
                                       /* aDefineOnGlobal = */ true);
115
0
116
0
  }
117
118
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
119
0
  {
120
0
    /* Get the interface object for this class.  This will create the object as
121
0
       needed. */
122
0
123
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::DOMRect,
124
0
                                       &CreateInterfaceObjects,
125
0
                                       aDefineOnGlobal);
126
0
  }
127
128
  JSObject*
129
  GetConstructorObject(JSContext* aCx);
130
131
} // namespace DOMRect_Binding
132
133
134
135
namespace DOMRectReadOnly_Binding {
136
137
  typedef mozilla::dom::DOMRectReadOnly NativeType;
138
139
  MOZ_CAN_RUN_SCRIPT bool
140
  CollectJSONAttributes(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::DOMRectReadOnly* self, JS::Rooted<JSObject*>& result);
141
142
  const JSClass*
143
  GetJSClass();
144
145
  bool
146
  Wrap(JSContext* aCx, mozilla::dom::DOMRectReadOnly* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
147
148
  template <class T>
149
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
150
0
  {
151
0
    JS::Rooted<JSObject*> reflector(aCx);
152
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
153
0
  }
154
155
  // We declare this as an array so that retrieving a pointer to this
156
  // binding's property hooks only requires compile/link-time resolvable
157
  // address arithmetic.  Declaring it as a pointer instead would require
158
  // doing a run-time load to fetch a pointer to this binding's property
159
  // hooks.  And then structures which embedded a pointer to this structure
160
  // would require a run-time load for proper initialization, which would
161
  // then induce static constructors.  Lots of static constructors.
162
  extern const NativePropertyHooks sNativePropertyHooks[];
163
164
  void
165
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
166
167
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
168
0
  {
169
0
    /* Get the interface prototype object for this class.  This will create the
170
0
       object as needed. */
171
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::DOMRectReadOnly,
172
0
                                       &CreateInterfaceObjects,
173
0
                                       /* aDefineOnGlobal = */ true);
174
0
175
0
  }
176
177
  JSObject*
178
  GetProtoObject(JSContext* aCx);
179
180
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
181
0
  {
182
0
    /* Get the interface object for this class.  This will create the object as
183
0
       needed. */
184
0
185
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::DOMRectReadOnly,
186
0
                                       &CreateInterfaceObjects,
187
0
                                       aDefineOnGlobal);
188
0
  }
189
190
  JSObject*
191
  GetConstructorObject(JSContext* aCx);
192
193
} // namespace DOMRectReadOnly_Binding
194
195
196
197
} // namespace dom
198
} // namespace mozilla
199
200
#endif // mozilla_dom_DOMRectBinding_h