/work/obj-fuzz/dist/include/mozilla/dom/PromiseDebuggingBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM PromiseDebugging.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_PromiseDebuggingBinding_h |
4 | | #define mozilla_dom_PromiseDebuggingBinding_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/CallbackInterface.h" |
12 | | #include "mozilla/dom/Nullable.h" |
13 | | #include "mozilla/dom/PrototypeList.h" |
14 | | #include "mozilla/dom/ToJSValue.h" |
15 | | |
16 | | namespace mozilla { |
17 | | namespace dom { |
18 | | |
19 | | struct NativePropertyHooks; |
20 | | class PromiseDebugging; |
21 | | struct PromiseDebuggingAtoms; |
22 | | struct PromiseDebuggingStateHolderAtoms; |
23 | | class ProtoAndIfaceCache; |
24 | | class UncaughtRejectionObserver; |
25 | | struct UncaughtRejectionObserverAtoms; |
26 | | |
27 | | } // namespace dom |
28 | | } // namespace mozilla |
29 | | |
30 | | namespace mozilla { |
31 | | namespace dom { |
32 | | |
33 | | enum class PromiseDebuggingState : uint8_t { |
34 | | Pending, |
35 | | Fulfilled, |
36 | | Rejected, |
37 | | EndGuard_ |
38 | | }; |
39 | | |
40 | | namespace PromiseDebuggingStateValues { |
41 | | extern const EnumEntry strings[4]; |
42 | | } // namespace PromiseDebuggingStateValues |
43 | | |
44 | | bool |
45 | | ToJSValue(JSContext* aCx, PromiseDebuggingState aArgument, JS::MutableHandle<JS::Value> aValue); |
46 | | |
47 | | |
48 | | struct PromiseDebuggingStateHolder : public DictionaryBase |
49 | | { |
50 | | MOZ_INIT_OUTSIDE_CTOR JS::Value mReason; |
51 | | MOZ_INIT_OUTSIDE_CTOR PromiseDebuggingState mState; |
52 | | MOZ_INIT_OUTSIDE_CTOR JS::Value mValue; |
53 | | |
54 | | PromiseDebuggingStateHolder(); |
55 | | |
56 | | explicit inline PromiseDebuggingStateHolder(const FastDictionaryInitializer& ) |
57 | | : mReason(JS::UndefinedValue()), |
58 | | mValue(JS::UndefinedValue()) |
59 | 0 | { |
60 | 0 | // Do nothing here; this is used by our "Fast" subclass |
61 | 0 | } |
62 | | |
63 | | private: |
64 | | PromiseDebuggingStateHolder(const PromiseDebuggingStateHolder&) = delete; |
65 | | PromiseDebuggingStateHolder& operator=(const PromiseDebuggingStateHolder&) = delete; |
66 | | |
67 | | static bool |
68 | | InitIds(JSContext* cx, PromiseDebuggingStateHolderAtoms* atomsCache); |
69 | | |
70 | | public: |
71 | | bool |
72 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
73 | | |
74 | | bool |
75 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
76 | | |
77 | | void |
78 | | TraceDictionary(JSTracer* trc); |
79 | | }; |
80 | | |
81 | | namespace binding_detail { |
82 | | struct FastPromiseDebuggingStateHolder : public PromiseDebuggingStateHolder |
83 | | { |
84 | | inline FastPromiseDebuggingStateHolder() |
85 | | : PromiseDebuggingStateHolder(FastDictionaryInitializer()) |
86 | 0 | { |
87 | 0 | // Doesn't matter what int we pass to the parent constructor |
88 | 0 | } |
89 | | }; |
90 | | } // namespace binding_detail |
91 | | |
92 | | |
93 | | namespace PromiseDebugging_Binding { |
94 | | |
95 | | typedef mozilla::dom::PromiseDebugging NativeType; |
96 | | |
97 | | bool |
98 | | ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj); |
99 | | |
100 | | // We declare this as an array so that retrieving a pointer to this |
101 | | // binding's property hooks only requires compile/link-time resolvable |
102 | | // address arithmetic. Declaring it as a pointer instead would require |
103 | | // doing a run-time load to fetch a pointer to this binding's property |
104 | | // hooks. And then structures which embedded a pointer to this structure |
105 | | // would require a run-time load for proper initialization, which would |
106 | | // then induce static constructors. Lots of static constructors. |
107 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
108 | | |
109 | | void |
110 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
111 | | |
112 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
113 | 0 | { |
114 | 0 | /* Get the interface object for this class. This will create the object as |
115 | 0 | needed. */ |
116 | 0 |
|
117 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::PromiseDebugging, |
118 | 0 | &CreateInterfaceObjects, |
119 | 0 | aDefineOnGlobal); |
120 | 0 | } |
121 | | |
122 | | JSObject* |
123 | | GetConstructorObject(JSContext* aCx); |
124 | | |
125 | | } // namespace PromiseDebugging_Binding |
126 | | |
127 | | |
128 | | |
129 | | class UncaughtRejectionObserver : public CallbackInterface |
130 | | { |
131 | | public: |
132 | | explicit inline UncaughtRejectionObserver(JSContext* aCx, JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aCallbackGlobal, nsIGlobalObject* aIncumbentGlobal) |
133 | | : CallbackInterface(aCx, aCallback, aCallbackGlobal, aIncumbentGlobal) |
134 | 0 | { |
135 | 0 | } |
136 | | |
137 | | explicit inline UncaughtRejectionObserver(JSObject* aCallback, JSObject* aCallbackGlobal, const FastCallbackConstructor& ) |
138 | | : CallbackInterface(aCallback, aCallbackGlobal, FastCallbackConstructor()) |
139 | 0 | { |
140 | 0 | } |
141 | | |
142 | | explicit inline UncaughtRejectionObserver(JSObject* aCallback, JSObject* aCallbackGlobal, JSObject* aAsyncStack, nsIGlobalObject* aIncumbentGlobal) |
143 | | : CallbackInterface(aCallback, aCallbackGlobal, aAsyncStack, aIncumbentGlobal) |
144 | 0 | { |
145 | 0 | } |
146 | | |
147 | | void OnLeftUncaught(JS::Handle<JSObject*> p, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JS::Realm* aRealm = nullptr); |
148 | | |
149 | | void OnConsumed(JS::Handle<JSObject*> p, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JS::Realm* aRealm = nullptr); |
150 | | |
151 | | inline bool |
152 | | operator==(const UncaughtRejectionObserver& aOther) const |
153 | 0 | { |
154 | 0 | return CallbackInterface::operator==(aOther); |
155 | 0 | } |
156 | | |
157 | | private: |
158 | | static bool |
159 | | InitIds(JSContext* cx, UncaughtRejectionObserverAtoms* atomsCache); |
160 | | }; |
161 | | |
162 | | |
163 | | namespace binding_detail { |
164 | | class FastUncaughtRejectionObserver : public UncaughtRejectionObserver |
165 | | { |
166 | | public: |
167 | | explicit inline FastUncaughtRejectionObserver(JSObject* aCallback, JSObject* aCallbackGlobal) |
168 | | : UncaughtRejectionObserver(aCallback, aCallbackGlobal, FastCallbackConstructor()) |
169 | 0 | { |
170 | 0 | } |
171 | | |
172 | | inline void |
173 | | Trace(JSTracer* aTracer) |
174 | 0 | { |
175 | 0 | UncaughtRejectionObserver::Trace(aTracer); |
176 | 0 | } |
177 | | |
178 | | inline void |
179 | | FinishSlowJSInitIfMoreThanOneOwner(JSContext* aCx) |
180 | 0 | { |
181 | 0 | UncaughtRejectionObserver::FinishSlowJSInitIfMoreThanOneOwner(aCx); |
182 | 0 | } |
183 | | }; |
184 | | } // namespace binding_detail |
185 | | |
186 | | |
187 | | } // namespace dom |
188 | | } // namespace mozilla |
189 | | |
190 | | #endif // mozilla_dom_PromiseDebuggingBinding_h |