/work/obj-fuzz/dist/include/mozilla/dom/CredentialManagementBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM CredentialManagement.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_CredentialManagementBinding_h |
4 | | #define mozilla_dom_CredentialManagementBinding_h |
5 | | |
6 | | #include "GeckoProfiler.h" |
7 | | #include "WebAuthenticationBinding.h" |
8 | | #include "js/RootingAPI.h" |
9 | | #include "jspubtd.h" |
10 | | #include "mozilla/ErrorResult.h" |
11 | | #include "mozilla/dom/AbortSignal.h" |
12 | | #include "mozilla/dom/BindingDeclarations.h" |
13 | | #include "mozilla/dom/Nullable.h" |
14 | | #include "mozilla/dom/PrototypeList.h" |
15 | | |
16 | | namespace mozilla { |
17 | | namespace dom { |
18 | | |
19 | | class AbortSignal; |
20 | | class Credential; |
21 | | struct CredentialAtoms; |
22 | | struct CredentialCreationOptionsAtoms; |
23 | | struct CredentialRequestOptionsAtoms; |
24 | | class CredentialsContainer; |
25 | | struct CredentialsContainerAtoms; |
26 | | struct NativePropertyHooks; |
27 | | class ProtoAndIfaceCache; |
28 | | struct PublicKeyCredentialCreationOptions; |
29 | | struct PublicKeyCredentialRequestOptions; |
30 | | |
31 | | } // namespace dom |
32 | | } // namespace mozilla |
33 | | |
34 | | namespace mozilla { |
35 | | namespace dom { |
36 | | |
37 | | struct CredentialCreationOptions : public DictionaryBase |
38 | | { |
39 | | MOZ_INIT_OUTSIDE_CTOR PublicKeyCredentialCreationOptions mPublicKey; |
40 | | MOZ_INIT_OUTSIDE_CTOR Optional<OwningNonNull<mozilla::dom::AbortSignal>> mSignal; |
41 | | |
42 | | CredentialCreationOptions(); |
43 | | |
44 | | explicit inline CredentialCreationOptions(const FastDictionaryInitializer& ) |
45 | | : mPublicKey(FastDictionaryInitializer()) |
46 | 0 | { |
47 | 0 | // Do nothing here; this is used by our "Fast" subclass |
48 | 0 | } |
49 | | |
50 | | private: |
51 | | CredentialCreationOptions(const CredentialCreationOptions&) = delete; |
52 | | CredentialCreationOptions& operator=(const CredentialCreationOptions&) = delete; |
53 | | |
54 | | static bool |
55 | | InitIds(JSContext* cx, CredentialCreationOptionsAtoms* atomsCache); |
56 | | |
57 | | public: |
58 | | bool |
59 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
60 | | |
61 | | bool |
62 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
63 | | |
64 | | void |
65 | | TraceDictionary(JSTracer* trc); |
66 | | |
67 | | inline void |
68 | | TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags) |
69 | 0 | { |
70 | 0 | ImplCycleCollectionTraverse(aCallback, mSignal, "mSignal", aFlags); |
71 | 0 | } |
72 | | |
73 | | inline void |
74 | | UnlinkForCC() |
75 | 0 | { |
76 | 0 | ImplCycleCollectionUnlink(mSignal); |
77 | 0 | } |
78 | | }; |
79 | | |
80 | | namespace binding_detail { |
81 | | struct FastCredentialCreationOptions : public CredentialCreationOptions |
82 | | { |
83 | | inline FastCredentialCreationOptions() |
84 | | : CredentialCreationOptions(FastDictionaryInitializer()) |
85 | 0 | { |
86 | 0 | // Doesn't matter what int we pass to the parent constructor |
87 | 0 | } |
88 | | }; |
89 | | } // namespace binding_detail |
90 | | |
91 | | |
92 | | struct CredentialRequestOptions : public DictionaryBase |
93 | | { |
94 | | MOZ_INIT_OUTSIDE_CTOR PublicKeyCredentialRequestOptions mPublicKey; |
95 | | MOZ_INIT_OUTSIDE_CTOR Optional<OwningNonNull<mozilla::dom::AbortSignal>> mSignal; |
96 | | |
97 | | CredentialRequestOptions(); |
98 | | |
99 | | explicit inline CredentialRequestOptions(const FastDictionaryInitializer& ) |
100 | | : mPublicKey(FastDictionaryInitializer()) |
101 | 0 | { |
102 | 0 | // Do nothing here; this is used by our "Fast" subclass |
103 | 0 | } |
104 | | |
105 | | private: |
106 | | CredentialRequestOptions(const CredentialRequestOptions&) = delete; |
107 | | CredentialRequestOptions& operator=(const CredentialRequestOptions&) = delete; |
108 | | |
109 | | static bool |
110 | | InitIds(JSContext* cx, CredentialRequestOptionsAtoms* atomsCache); |
111 | | |
112 | | public: |
113 | | bool |
114 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
115 | | |
116 | | bool |
117 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
118 | | |
119 | | void |
120 | | TraceDictionary(JSTracer* trc); |
121 | | |
122 | | inline void |
123 | | TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags) |
124 | 0 | { |
125 | 0 | ImplCycleCollectionTraverse(aCallback, mSignal, "mSignal", aFlags); |
126 | 0 | } |
127 | | |
128 | | inline void |
129 | | UnlinkForCC() |
130 | 0 | { |
131 | 0 | ImplCycleCollectionUnlink(mSignal); |
132 | 0 | } |
133 | | }; |
134 | | |
135 | | namespace binding_detail { |
136 | | struct FastCredentialRequestOptions : public CredentialRequestOptions |
137 | | { |
138 | | inline FastCredentialRequestOptions() |
139 | | : CredentialRequestOptions(FastDictionaryInitializer()) |
140 | 0 | { |
141 | 0 | // Doesn't matter what int we pass to the parent constructor |
142 | 0 | } |
143 | | }; |
144 | | } // namespace binding_detail |
145 | | |
146 | | |
147 | | namespace Credential_Binding { |
148 | | |
149 | | typedef mozilla::dom::Credential NativeType; |
150 | | |
151 | | bool |
152 | | ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj); |
153 | | |
154 | | const JSClass* |
155 | | GetJSClass(); |
156 | | |
157 | | bool |
158 | | Wrap(JSContext* aCx, mozilla::dom::Credential* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
159 | | |
160 | | template <class T> |
161 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
162 | 0 | { |
163 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
164 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
165 | 0 | } |
166 | | |
167 | | // We declare this as an array so that retrieving a pointer to this |
168 | | // binding's property hooks only requires compile/link-time resolvable |
169 | | // address arithmetic. Declaring it as a pointer instead would require |
170 | | // doing a run-time load to fetch a pointer to this binding's property |
171 | | // hooks. And then structures which embedded a pointer to this structure |
172 | | // would require a run-time load for proper initialization, which would |
173 | | // then induce static constructors. Lots of static constructors. |
174 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
175 | | |
176 | | void |
177 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
178 | | |
179 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
180 | 0 | { |
181 | 0 | /* Get the interface prototype object for this class. This will create the |
182 | 0 | object as needed. */ |
183 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::Credential, |
184 | 0 | &CreateInterfaceObjects, |
185 | 0 | /* aDefineOnGlobal = */ true); |
186 | 0 |
|
187 | 0 | } |
188 | | |
189 | | JSObject* |
190 | | GetProtoObject(JSContext* aCx); |
191 | | |
192 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
193 | 0 | { |
194 | 0 | /* Get the interface object for this class. This will create the object as |
195 | 0 | needed. */ |
196 | 0 |
|
197 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::Credential, |
198 | 0 | &CreateInterfaceObjects, |
199 | 0 | aDefineOnGlobal); |
200 | 0 | } |
201 | | |
202 | | JSObject* |
203 | | GetConstructorObject(JSContext* aCx); |
204 | | |
205 | | } // namespace Credential_Binding |
206 | | |
207 | | |
208 | | |
209 | | namespace CredentialsContainer_Binding { |
210 | | |
211 | | typedef mozilla::dom::CredentialsContainer NativeType; |
212 | | |
213 | | bool |
214 | | ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj); |
215 | | |
216 | | const JSClass* |
217 | | GetJSClass(); |
218 | | |
219 | | bool |
220 | | Wrap(JSContext* aCx, mozilla::dom::CredentialsContainer* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
221 | | |
222 | | template <class T> |
223 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
224 | 0 | { |
225 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
226 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
227 | 0 | } |
228 | | |
229 | | // We declare this as an array so that retrieving a pointer to this |
230 | | // binding's property hooks only requires compile/link-time resolvable |
231 | | // address arithmetic. Declaring it as a pointer instead would require |
232 | | // doing a run-time load to fetch a pointer to this binding's property |
233 | | // hooks. And then structures which embedded a pointer to this structure |
234 | | // would require a run-time load for proper initialization, which would |
235 | | // then induce static constructors. Lots of static constructors. |
236 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
237 | | |
238 | | void |
239 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
240 | | |
241 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
242 | 0 | { |
243 | 0 | /* Get the interface prototype object for this class. This will create the |
244 | 0 | object as needed. */ |
245 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::CredentialsContainer, |
246 | 0 | &CreateInterfaceObjects, |
247 | 0 | /* aDefineOnGlobal = */ true); |
248 | 0 |
|
249 | 0 | } |
250 | | |
251 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
252 | 0 | { |
253 | 0 | /* Get the interface object for this class. This will create the object as |
254 | 0 | needed. */ |
255 | 0 |
|
256 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::CredentialsContainer, |
257 | 0 | &CreateInterfaceObjects, |
258 | 0 | aDefineOnGlobal); |
259 | 0 | } |
260 | | |
261 | | JSObject* |
262 | | GetConstructorObject(JSContext* aCx); |
263 | | |
264 | | } // namespace CredentialsContainer_Binding |
265 | | |
266 | | |
267 | | |
268 | | } // namespace dom |
269 | | } // namespace mozilla |
270 | | |
271 | | #endif // mozilla_dom_CredentialManagementBinding_h |