Coverage Report

Created: 2018-09-25 14:53

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