Coverage Report

Created: 2018-09-25 14:53

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