Coverage Report

Created: 2018-09-25 14:53

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