Coverage Report

Created: 2018-09-25 14:53

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