Coverage Report

Created: 2018-09-25 14:53

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