Coverage Report

Created: 2018-09-25 14:53

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