1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
7 #ifndef TestBindingHeader_h
8 #define TestBindingHeader_h
10 #include "mozilla/dom/BindingUtils.h"
11 #include "mozilla/dom/Date.h"
12 #include "mozilla/dom/MozMap.h"
13 #include "mozilla/dom/TypedArray.h"
14 #include "mozilla/ErrorResult.h"
16 #include "nsGenericHTMLElement.h"
17 #include "nsWrapperCache.h"
19 // Forward declare this before we include TestCodeGenBinding.h, because that header relies on including
20 // this one for it, for ParentDict. Hopefully it won't begin to rely on it in more fundamental ways.
23 class TestExternalInterface
;
25 } // namespace mozilla
27 // We don't export TestCodeGenBinding.h, but it's right in our parent dir.
28 #include "../TestCodeGenBinding.h"
30 extern bool TestFuncControlledMember(JSContext
*, JSObject
*);
35 // IID for nsRenamedInterface
36 #define NS_RENAMED_INTERFACE_IID \
37 { 0xd4b19ef3, 0xe68b, 0x4e3f, \
38 { 0x94, 0xbc, 0xc9, 0xde, 0x3a, 0x69, 0xb0, 0xe8 } }
40 class nsRenamedInterface
: public nsISupports
,
44 NS_DECLARE_STATIC_IID_ACCESSOR(NS_RENAMED_INTERFACE_IID
)
47 // We need a GetParentObject to make binding codegen happy
48 virtual nsISupports
* GetParentObject();
51 NS_DEFINE_STATIC_IID_ACCESSOR(nsRenamedInterface
, NS_RENAMED_INTERFACE_IID
)
53 // IID for the IndirectlyImplementedInterface
54 #define NS_INDIRECTLY_IMPLEMENTED_INTERFACE_IID \
55 { 0xfed55b69, 0x7012, 0x4849, \
56 { 0xaf, 0x56, 0x4b, 0xa9, 0xee, 0x41, 0x30, 0x89 } }
58 class IndirectlyImplementedInterface
: public nsISupports
,
62 NS_DECLARE_STATIC_IID_ACCESSOR(NS_INDIRECTLY_IMPLEMENTED_INTERFACE_IID
)
65 // We need a GetParentObject to make binding codegen happy
66 virtual nsISupports
* GetParentObject();
68 bool IndirectlyImplementedProperty();
69 void IndirectlyImplementedProperty(bool);
70 void IndirectlyImplementedMethod();
73 NS_DEFINE_STATIC_IID_ACCESSOR(IndirectlyImplementedInterface
, NS_INDIRECTLY_IMPLEMENTED_INTERFACE_IID
)
75 // IID for the TestExternalInterface
76 #define NS_TEST_EXTERNAL_INTERFACE_IID \
77 { 0xd5ba0c99, 0x9b1d, 0x4e71, \
78 { 0x8a, 0x94, 0x56, 0x38, 0x6c, 0xa3, 0xda, 0x3d } }
79 class TestExternalInterface
: public nsISupports
82 NS_DECLARE_STATIC_IID_ACCESSOR(NS_TEST_EXTERNAL_INTERFACE_IID
)
86 NS_DEFINE_STATIC_IID_ACCESSOR(TestExternalInterface
, NS_TEST_EXTERNAL_INTERFACE_IID
)
88 class TestNonWrapperCacheInterface
: public nsISupports
93 virtual JSObject
* WrapObject(JSContext
* cx
);
96 class OnlyForUseInConstructor
: public nsISupports
,
101 // We need a GetParentObject to make binding codegen happy
102 virtual nsISupports
* GetParentObject();
105 class TestInterface
: public nsISupports
,
106 public nsWrapperCache
111 // We need a GetParentObject to make binding codegen happy
112 virtual nsISupports
* GetParentObject();
114 // And now our actual WebIDL API
117 already_AddRefed
<TestInterface
>
118 Constructor(const GlobalObject
&, ErrorResult
&);
120 already_AddRefed
<TestInterface
>
121 Constructor(const GlobalObject
&, const nsAString
&, ErrorResult
&);
123 already_AddRefed
<TestInterface
>
124 Constructor(const GlobalObject
&, uint32_t, const Nullable
<bool>&,
127 already_AddRefed
<TestInterface
>
128 Constructor(const GlobalObject
&, TestInterface
*, ErrorResult
&);
130 already_AddRefed
<TestInterface
>
131 Constructor(const GlobalObject
&, uint32_t, IndirectlyImplementedInterface
&, ErrorResult
&);
134 already_AddRefed
<TestInterface
>
135 Constructor(const GlobalObject
&, Date
&, ErrorResult
&);
137 already_AddRefed<TestInterface>
138 Constructor(const GlobalObject&, uint32_t, uint32_t,
139 const TestInterfaceOrOnlyForUseInConstructor&, ErrorResult&);
143 already_AddRefed
<TestInterface
> Test(const GlobalObject
&, ErrorResult
&);
145 already_AddRefed
<TestInterface
> Test(const GlobalObject
&, const nsAString
&,
148 already_AddRefed
<TestInterface
> Test(const GlobalObject
&, const nsACString
&,
152 already_AddRefed
<TestInterface
> Test2(const GlobalObject
&,
153 const DictForConstructor
&,
154 JS::Handle
<JS::Value
>,
155 JS::Handle
<JSObject
*>,
156 JS::Handle
<JSObject
*>,
157 const Sequence
<Dict
>&,
158 JS::Handle
<JS::Value
>,
159 const Optional
<JS::Handle
<JSObject
*> >&,
160 const Optional
<JS::Handle
<JSObject
*> >&,
164 already_AddRefed
<TestInterface
> Test3(const GlobalObject
&,
165 const LongOrAnyMozMap
&,
169 int8_t ReadonlyByte();
170 int8_t WritableByte();
171 void SetWritableByte(int8_t);
172 void PassByte(int8_t);
173 int8_t ReceiveByte();
174 void PassOptionalByte(const Optional
<int8_t>&);
175 void PassOptionalByteBeforeRequired(const Optional
<int8_t>&, int8_t);
176 void PassOptionalByteWithDefault(int8_t);
177 void PassOptionalByteWithDefaultBeforeRequired(int8_t, int8_t);
178 void PassNullableByte(const Nullable
<int8_t>&);
179 void PassOptionalNullableByte(const Optional
< Nullable
<int8_t> >&);
180 void PassVariadicByte(const Sequence
<int8_t>&);
182 int8_t CachedConstantByte();
183 int8_t CachedWritableByte();
184 void SetCachedWritableByte(int8_t);
186 void UnsafePrerenderMethod();
187 int32_t UnsafePrerenderWritable();
188 void SetUnsafePrerenderWritable(int32_t);
189 int32_t UnsafePrerenderReadonly();
190 int16_t ReadonlyShort();
191 int16_t WritableShort();
192 void SetWritableShort(int16_t);
193 void PassShort(int16_t);
194 int16_t ReceiveShort();
195 void PassOptionalShort(const Optional
<int16_t>&);
196 void PassOptionalShortWithDefault(int16_t);
198 int32_t ReadonlyLong();
199 int32_t WritableLong();
200 void SetWritableLong(int32_t);
201 void PassLong(int32_t);
202 int16_t ReceiveLong();
203 void PassOptionalLong(const Optional
<int32_t>&);
204 void PassOptionalLongWithDefault(int32_t);
206 int64_t ReadonlyLongLong();
207 int64_t WritableLongLong();
208 void SetWritableLongLong(int64_t);
209 void PassLongLong(int64_t);
210 int64_t ReceiveLongLong();
211 void PassOptionalLongLong(const Optional
<int64_t>&);
212 void PassOptionalLongLongWithDefault(int64_t);
214 uint8_t ReadonlyOctet();
215 uint8_t WritableOctet();
216 void SetWritableOctet(uint8_t);
217 void PassOctet(uint8_t);
218 uint8_t ReceiveOctet();
219 void PassOptionalOctet(const Optional
<uint8_t>&);
220 void PassOptionalOctetWithDefault(uint8_t);
222 uint16_t ReadonlyUnsignedShort();
223 uint16_t WritableUnsignedShort();
224 void SetWritableUnsignedShort(uint16_t);
225 void PassUnsignedShort(uint16_t);
226 uint16_t ReceiveUnsignedShort();
227 void PassOptionalUnsignedShort(const Optional
<uint16_t>&);
228 void PassOptionalUnsignedShortWithDefault(uint16_t);
230 uint32_t ReadonlyUnsignedLong();
231 uint32_t WritableUnsignedLong();
232 void SetWritableUnsignedLong(uint32_t);
233 void PassUnsignedLong(uint32_t);
234 uint32_t ReceiveUnsignedLong();
235 void PassOptionalUnsignedLong(const Optional
<uint32_t>&);
236 void PassOptionalUnsignedLongWithDefault(uint32_t);
238 uint64_t ReadonlyUnsignedLongLong();
239 uint64_t WritableUnsignedLongLong();
240 void SetWritableUnsignedLongLong(uint64_t);
241 void PassUnsignedLongLong(uint64_t);
242 uint64_t ReceiveUnsignedLongLong();
243 void PassOptionalUnsignedLongLong(const Optional
<uint64_t>&);
244 void PassOptionalUnsignedLongLongWithDefault(uint64_t);
246 float WritableFloat() const;
247 void SetWritableFloat(float);
248 float WritableUnrestrictedFloat() const;
249 void SetWritableUnrestrictedFloat(float);
250 Nullable
<float> GetWritableNullableFloat() const;
251 void SetWritableNullableFloat(Nullable
<float>);
252 Nullable
<float> GetWritableNullableUnrestrictedFloat() const;
253 void SetWritableNullableUnrestrictedFloat(Nullable
<float>);
254 double WritableDouble() const;
255 void SetWritableDouble(double);
256 double WritableUnrestrictedDouble() const;
257 void SetWritableUnrestrictedDouble(double);
258 Nullable
<double> GetWritableNullableDouble() const;
259 void SetWritableNullableDouble(Nullable
<double>);
260 Nullable
<double> GetWritableNullableUnrestrictedDouble() const;
261 void SetWritableNullableUnrestrictedDouble(Nullable
<double>);
262 void PassFloat(float, float, Nullable
<float>, Nullable
<float>,
263 double, double, Nullable
<double>, Nullable
<double>,
264 const Sequence
<float>&, const Sequence
<float>&,
265 const Sequence
<Nullable
<float> >&,
266 const Sequence
<Nullable
<float> >&,
267 const Sequence
<double>&, const Sequence
<double>&,
268 const Sequence
<Nullable
<double> >&,
269 const Sequence
<Nullable
<double> >&);
270 void PassLenientFloat(float, float, Nullable
<float>, Nullable
<float>,
271 double, double, Nullable
<double>, Nullable
<double>,
272 const Sequence
<float>&, const Sequence
<float>&,
273 const Sequence
<Nullable
<float> >&,
274 const Sequence
<Nullable
<float> >&,
275 const Sequence
<double>&, const Sequence
<double>&,
276 const Sequence
<Nullable
<double> >&,
277 const Sequence
<Nullable
<double> >&);
278 float LenientFloatAttr() const;
279 void SetLenientFloatAttr(float);
280 double LenientDoubleAttr() const;
281 void SetLenientDoubleAttr(double);
283 void PassUnrestricted(float arg1
,
293 already_AddRefed
<TestInterface
> ReceiveSelf();
294 already_AddRefed
<TestInterface
> ReceiveNullableSelf();
295 TestInterface
* ReceiveWeakSelf();
296 TestInterface
* ReceiveWeakNullableSelf();
297 void PassSelf(TestInterface
&);
298 void PassNullableSelf(TestInterface
*);
299 already_AddRefed
<TestInterface
> NonNullSelf();
300 void SetNonNullSelf(TestInterface
&);
301 already_AddRefed
<TestInterface
> GetNullableSelf();
302 already_AddRefed
<TestInterface
> CachedSelf();
303 void SetNullableSelf(TestInterface
*);
304 void PassOptionalSelf(const Optional
<TestInterface
*> &);
305 void PassOptionalNonNullSelf(const Optional
<NonNull
<TestInterface
> >&);
306 void PassOptionalSelfWithDefault(TestInterface
*);
308 already_AddRefed
<TestNonWrapperCacheInterface
> ReceiveNonWrapperCacheInterface();
309 already_AddRefed
<TestNonWrapperCacheInterface
> ReceiveNullableNonWrapperCacheInterface();
310 void ReceiveNonWrapperCacheInterfaceSequence(nsTArray
<nsRefPtr
<TestNonWrapperCacheInterface
> >&);
311 void ReceiveNullableNonWrapperCacheInterfaceSequence(nsTArray
<nsRefPtr
<TestNonWrapperCacheInterface
> >&);
312 void ReceiveNonWrapperCacheInterfaceNullableSequence(Nullable
<nsTArray
<nsRefPtr
<TestNonWrapperCacheInterface
> > >&);
313 void ReceiveNullableNonWrapperCacheInterfaceNullableSequence(Nullable
<nsTArray
<nsRefPtr
<TestNonWrapperCacheInterface
> > >&);
315 already_AddRefed
<IndirectlyImplementedInterface
> ReceiveOther();
316 already_AddRefed
<IndirectlyImplementedInterface
> ReceiveNullableOther();
317 IndirectlyImplementedInterface
* ReceiveWeakOther();
318 IndirectlyImplementedInterface
* ReceiveWeakNullableOther();
319 void PassOther(IndirectlyImplementedInterface
&);
320 void PassNullableOther(IndirectlyImplementedInterface
*);
321 already_AddRefed
<IndirectlyImplementedInterface
> NonNullOther();
322 void SetNonNullOther(IndirectlyImplementedInterface
&);
323 already_AddRefed
<IndirectlyImplementedInterface
> GetNullableOther();
324 void SetNullableOther(IndirectlyImplementedInterface
*);
325 void PassOptionalOther(const Optional
<IndirectlyImplementedInterface
*>&);
326 void PassOptionalNonNullOther(const Optional
<NonNull
<IndirectlyImplementedInterface
> >&);
327 void PassOptionalOtherWithDefault(IndirectlyImplementedInterface
*);
329 already_AddRefed
<TestExternalInterface
> ReceiveExternal();
330 already_AddRefed
<TestExternalInterface
> ReceiveNullableExternal();
331 TestExternalInterface
* ReceiveWeakExternal();
332 TestExternalInterface
* ReceiveWeakNullableExternal();
333 void PassExternal(TestExternalInterface
*);
334 void PassNullableExternal(TestExternalInterface
*);
335 already_AddRefed
<TestExternalInterface
> NonNullExternal();
336 void SetNonNullExternal(TestExternalInterface
*);
337 already_AddRefed
<TestExternalInterface
> GetNullableExternal();
338 void SetNullableExternal(TestExternalInterface
*);
339 void PassOptionalExternal(const Optional
<TestExternalInterface
*>&);
340 void PassOptionalNonNullExternal(const Optional
<TestExternalInterface
*>&);
341 void PassOptionalExternalWithDefault(TestExternalInterface
*);
343 already_AddRefed
<TestCallbackInterface
> ReceiveCallbackInterface();
344 already_AddRefed
<TestCallbackInterface
> ReceiveNullableCallbackInterface();
345 TestCallbackInterface
* ReceiveWeakCallbackInterface();
346 TestCallbackInterface
* ReceiveWeakNullableCallbackInterface();
347 void PassCallbackInterface(TestCallbackInterface
&);
348 void PassNullableCallbackInterface(TestCallbackInterface
*);
349 already_AddRefed
<TestCallbackInterface
> NonNullCallbackInterface();
350 void SetNonNullCallbackInterface(TestCallbackInterface
&);
351 already_AddRefed
<TestCallbackInterface
> GetNullableCallbackInterface();
352 void SetNullableCallbackInterface(TestCallbackInterface
*);
353 void PassOptionalCallbackInterface(const Optional
<nsRefPtr
<TestCallbackInterface
> >&);
354 void PassOptionalNonNullCallbackInterface(const Optional
<OwningNonNull
<TestCallbackInterface
> >&);
355 void PassOptionalCallbackInterfaceWithDefault(TestCallbackInterface
*);
357 already_AddRefed
<IndirectlyImplementedInterface
> ReceiveConsequentialInterface();
358 void PassConsequentialInterface(IndirectlyImplementedInterface
&);
361 void GetReadonlySequence(nsTArray
<int32_t>&);
362 void GetReadonlySequenceOfDictionaries(JSContext
*, nsTArray
<Dict
>&);
363 void GetReadonlyNullableSequenceOfDictionaries(JSContext
*, Nullable
<nsTArray
<Dict
> >&);
364 void GetReadonlyFrozenSequence(JSContext
*, nsTArray
<Dict
>&);
365 void GetReadonlyFrozenNullableSequence(JSContext
*, Nullable
<nsTArray
<Dict
>>&);
366 void ReceiveSequence(nsTArray
<int32_t>&);
367 void ReceiveNullableSequence(Nullable
< nsTArray
<int32_t> >&);
368 void ReceiveSequenceOfNullableInts(nsTArray
< Nullable
<int32_t> >&);
369 void ReceiveNullableSequenceOfNullableInts(Nullable
< nsTArray
< Nullable
<int32_t> > >&);
370 void PassSequence(const Sequence
<int32_t> &);
371 void PassNullableSequence(const Nullable
< Sequence
<int32_t> >&);
372 void PassSequenceOfNullableInts(const Sequence
<Nullable
<int32_t> >&);
373 void PassOptionalSequenceOfNullableInts(const Optional
<Sequence
<Nullable
<int32_t> > > &);
374 void PassOptionalNullableSequenceOfNullableInts(const Optional
<Nullable
<Sequence
<Nullable
<int32_t> > > > &);
375 void ReceiveCastableObjectSequence(nsTArray
< nsRefPtr
<TestInterface
> > &);
376 void ReceiveCallbackObjectSequence(nsTArray
< nsRefPtr
<TestCallbackInterface
> > &);
377 void ReceiveNullableCastableObjectSequence(nsTArray
< nsRefPtr
<TestInterface
> > &);
378 void ReceiveNullableCallbackObjectSequence(nsTArray
< nsRefPtr
<TestCallbackInterface
> > &);
379 void ReceiveCastableObjectNullableSequence(Nullable
< nsTArray
< nsRefPtr
<TestInterface
> > >&);
380 void ReceiveNullableCastableObjectNullableSequence(Nullable
< nsTArray
< nsRefPtr
<TestInterface
> > >&);
381 void ReceiveWeakCastableObjectSequence(nsTArray
<nsRefPtr
<TestInterface
>> &);
382 void ReceiveWeakNullableCastableObjectSequence(nsTArray
<nsRefPtr
<TestInterface
>> &);
383 void ReceiveWeakCastableObjectNullableSequence(Nullable
< nsTArray
<nsRefPtr
<TestInterface
>> >&);
384 void ReceiveWeakNullableCastableObjectNullableSequence(Nullable
< nsTArray
<nsRefPtr
<TestInterface
>> >&);
385 void PassCastableObjectSequence(const Sequence
< OwningNonNull
<TestInterface
> >&);
386 void PassNullableCastableObjectSequence(const Sequence
< nsRefPtr
<TestInterface
> > &);
387 void PassCastableObjectNullableSequence(const Nullable
< Sequence
< OwningNonNull
<TestInterface
> > >&);
388 void PassNullableCastableObjectNullableSequence(const Nullable
< Sequence
< nsRefPtr
<TestInterface
> > >&);
389 void PassOptionalSequence(const Optional
<Sequence
<int32_t> >&);
390 void PassOptionalSequenceWithDefaultValue(const Sequence
<int32_t> &);
391 void PassOptionalNullableSequence(const Optional
<Nullable
<Sequence
<int32_t> > >&);
392 void PassOptionalNullableSequenceWithDefaultValue(const Nullable
< Sequence
<int32_t> >&);
393 void PassOptionalNullableSequenceWithDefaultValue2(const Nullable
< Sequence
<int32_t> >&);
394 void PassOptionalObjectSequence(const Optional
<Sequence
<OwningNonNull
<TestInterface
> > >&);
395 void PassExternalInterfaceSequence(const Sequence
<nsRefPtr
<TestExternalInterface
> >&);
396 void PassNullableExternalInterfaceSequence(const Sequence
<nsRefPtr
<TestExternalInterface
> >&);
398 void ReceiveStringSequence(nsTArray
<nsString
>&);
399 void PassStringSequence(const Sequence
<nsString
>&);
401 void ReceiveByteStringSequence(nsTArray
<nsCString
>&);
402 void PassByteStringSequence(const Sequence
<nsCString
>&);
404 void ReceiveAnySequence(JSContext
*, nsTArray
<JS::Value
>&);
405 void ReceiveNullableAnySequence(JSContext
*, Nullable
<nsTArray
<JS::Value
> >&);
406 void ReceiveAnySequenceSequence(JSContext
*, nsTArray
<nsTArray
<JS::Value
> >&);
408 void ReceiveObjectSequence(JSContext
*, nsTArray
<JSObject
*>&);
409 void ReceiveNullableObjectSequence(JSContext
*, nsTArray
<JSObject
*>&);
411 void PassSequenceOfSequences(const Sequence
< Sequence
<int32_t> >&);
412 void ReceiveSequenceOfSequences(nsTArray
< nsTArray
<int32_t> >&);
415 void PassMozMap(const MozMap
<int32_t> &);
416 void PassNullableMozMap(const Nullable
< MozMap
<int32_t> >&);
417 void PassMozMapOfNullableInts(const MozMap
<Nullable
<int32_t> >&);
418 void PassOptionalMozMapOfNullableInts(const Optional
<MozMap
<Nullable
<int32_t> > > &);
419 void PassOptionalNullableMozMapOfNullableInts(const Optional
<Nullable
<MozMap
<Nullable
<int32_t> > > > &);
420 void PassCastableObjectMozMap(const MozMap
< OwningNonNull
<TestInterface
> >&);
421 void PassNullableCastableObjectMozMap(const MozMap
< nsRefPtr
<TestInterface
> > &);
422 void PassCastableObjectNullableMozMap(const Nullable
< MozMap
< OwningNonNull
<TestInterface
> > >&);
423 void PassNullableCastableObjectNullableMozMap(const Nullable
< MozMap
< nsRefPtr
<TestInterface
> > >&);
424 void PassOptionalMozMap(const Optional
<MozMap
<int32_t> >&);
425 void PassOptionalNullableMozMap(const Optional
<Nullable
<MozMap
<int32_t> > >&);
426 void PassOptionalNullableMozMapWithDefaultValue(const Nullable
< MozMap
<int32_t> >&);
427 void PassOptionalObjectMozMap(const Optional
<MozMap
<OwningNonNull
<TestInterface
> > >&);
428 void PassExternalInterfaceMozMap(const MozMap
<nsRefPtr
<TestExternalInterface
> >&);
429 void PassNullableExternalInterfaceMozMap(const MozMap
<nsRefPtr
<TestExternalInterface
> >&);
430 void PassStringMozMap(const MozMap
<nsString
>&);
431 void PassByteStringMozMap(const MozMap
<nsCString
>&);
432 void PassMozMapOfMozMaps(const MozMap
< MozMap
<int32_t> >&);
433 void ReceiveMozMap(MozMap
<int32_t>&);
434 void ReceiveNullableMozMap(Nullable
<MozMap
<int32_t>>&);
435 void ReceiveMozMapOfNullableInts(MozMap
<Nullable
<int32_t>>&);
436 void ReceiveNullableMozMapOfNullableInts(Nullable
<MozMap
<Nullable
<int32_t>>>&);
437 void ReceiveMozMapOfMozMaps(MozMap
<MozMap
<int32_t>>&);
438 void ReceiveAnyMozMap(JSContext
*, MozMap
<JS::Value
>&);
441 void PassArrayBuffer(const ArrayBuffer
&);
442 void PassNullableArrayBuffer(const Nullable
<ArrayBuffer
>&);
443 void PassOptionalArrayBuffer(const Optional
<ArrayBuffer
>&);
444 void PassOptionalNullableArrayBuffer(const Optional
<Nullable
<ArrayBuffer
> >&);
445 void PassOptionalNullableArrayBufferWithDefaultValue(const Nullable
<ArrayBuffer
>&);
446 void PassArrayBufferView(const ArrayBufferView
&);
447 void PassInt8Array(const Int8Array
&);
448 void PassInt16Array(const Int16Array
&);
449 void PassInt32Array(const Int32Array
&);
450 void PassUint8Array(const Uint8Array
&);
451 void PassUint16Array(const Uint16Array
&);
452 void PassUint32Array(const Uint32Array
&);
453 void PassUint8ClampedArray(const Uint8ClampedArray
&);
454 void PassFloat32Array(const Float32Array
&);
455 void PassFloat64Array(const Float64Array
&);
456 void PassSequenceOfArrayBuffers(const Sequence
<ArrayBuffer
>&);
457 void PassSequenceOfNullableArrayBuffers(const Sequence
<Nullable
<ArrayBuffer
> >&);
458 void PassMozMapOfArrayBuffers(const MozMap
<ArrayBuffer
>&);
459 void PassMozMapOfNullableArrayBuffers(const MozMap
<Nullable
<ArrayBuffer
> >&);
460 void PassVariadicTypedArray(const Sequence
<Float32Array
>&);
461 void PassVariadicNullableTypedArray(const Sequence
<Nullable
<Float32Array
> >&);
462 void ReceiveUint8Array(JSContext
*, JS::MutableHandle
<JSObject
*>);
463 void SetUint8ArrayAttr(const Uint8Array
&);
464 void GetUint8ArrayAttr(JSContext
*, JS::MutableHandle
<JSObject
*>);
467 void PassString(const nsAString
&);
468 void PassNullableString(const nsAString
&);
469 void PassOptionalString(const Optional
<nsAString
>&);
470 void PassOptionalStringWithDefaultValue(const nsAString
&);
471 void PassOptionalNullableString(const Optional
<nsAString
>&);
472 void PassOptionalNullableStringWithDefaultValue(const nsAString
&);
473 void PassVariadicString(const Sequence
<nsString
>&);
474 void ReceiveString(DOMString
&);
477 void PassByteString(const nsCString
&);
478 void PassNullableByteString(const nsCString
&);
479 void PassOptionalByteString(const Optional
<nsCString
>&);
480 void PassOptionalNullableByteString(const Optional
<nsCString
>&);
481 void PassVariadicByteString(const Sequence
<nsCString
>&);
484 void PassUSVS(const nsAString
&);
485 void PassNullableUSVS(const nsAString
&);
486 void PassOptionalUSVS(const Optional
<nsAString
>&);
487 void PassOptionalUSVSWithDefaultValue(const nsAString
&);
488 void PassOptionalNullableUSVS(const Optional
<nsAString
>&);
489 void PassOptionalNullableUSVSWithDefaultValue(const nsAString
&);
490 void PassVariadicUSVS(const Sequence
<nsString
>&);
491 void ReceiveUSVS(DOMString
&);
494 void PassEnum(TestEnum
);
495 void PassNullableEnum(const Nullable
<TestEnum
>&);
496 void PassOptionalEnum(const Optional
<TestEnum
>&);
497 void PassEnumWithDefault(TestEnum
);
498 void PassOptionalNullableEnum(const Optional
<Nullable
<TestEnum
> >&);
499 void PassOptionalNullableEnumWithDefaultValue(const Nullable
<TestEnum
>&);
500 void PassOptionalNullableEnumWithDefaultValue2(const Nullable
<TestEnum
>&);
501 TestEnum
ReceiveEnum();
502 Nullable
<TestEnum
> ReceiveNullableEnum();
503 TestEnum
EnumAttribute();
504 TestEnum
ReadonlyEnumAttribute();
505 void SetEnumAttribute(TestEnum
);
508 void PassCallback(TestCallback
&);
509 void PassNullableCallback(TestCallback
*);
510 void PassOptionalCallback(const Optional
<OwningNonNull
<TestCallback
> >&);
511 void PassOptionalNullableCallback(const Optional
<nsRefPtr
<TestCallback
> >&);
512 void PassOptionalNullableCallbackWithDefaultValue(TestCallback
*);
513 already_AddRefed
<TestCallback
> ReceiveCallback();
514 already_AddRefed
<TestCallback
> ReceiveNullableCallback();
515 void PassNullableTreatAsNullCallback(TestTreatAsNullCallback
*);
516 void PassOptionalNullableTreatAsNullCallback(const Optional
<nsRefPtr
<TestTreatAsNullCallback
> >&);
517 void PassOptionalNullableTreatAsNullCallbackWithDefaultValue(TestTreatAsNullCallback
*);
518 void SetTreatAsNullCallback(TestTreatAsNullCallback
&);
519 already_AddRefed
<TestTreatAsNullCallback
> TreatAsNullCallback();
520 void SetNullableTreatAsNullCallback(TestTreatAsNullCallback
*);
521 already_AddRefed
<TestTreatAsNullCallback
> GetNullableTreatAsNullCallback();
524 void PassAny(JSContext
*, JS::Handle
<JS::Value
>);
525 void PassVariadicAny(JSContext
*, const Sequence
<JS::Value
>&);
526 void PassOptionalAny(JSContext
*, JS::Handle
<JS::Value
>);
527 void PassAnyDefaultNull(JSContext
*, JS::Handle
<JS::Value
>);
528 void PassSequenceOfAny(JSContext
*, const Sequence
<JS::Value
>&);
529 void PassNullableSequenceOfAny(JSContext
*, const Nullable
<Sequence
<JS::Value
> >&);
530 void PassOptionalSequenceOfAny(JSContext
*, const Optional
<Sequence
<JS::Value
> >&);
531 void PassOptionalNullableSequenceOfAny(JSContext
*, const Optional
<Nullable
<Sequence
<JS::Value
> > >&);
532 void PassOptionalSequenceOfAnyWithDefaultValue(JSContext
*, const Nullable
<Sequence
<JS::Value
> >&);
533 void PassSequenceOfSequenceOfAny(JSContext
*, const Sequence
<Sequence
<JS::Value
> >&);
534 void PassSequenceOfNullableSequenceOfAny(JSContext
*, const Sequence
<Nullable
<Sequence
<JS::Value
> > >&);
535 void PassNullableSequenceOfNullableSequenceOfAny(JSContext
*, const Nullable
<Sequence
<Nullable
<Sequence
<JS::Value
> > > >&);
536 void PassOptionalNullableSequenceOfNullableSequenceOfAny(JSContext
*, const Optional
<Nullable
<Sequence
<Nullable
<Sequence
<JS::Value
> > > > >&);
537 void PassMozMapOfAny(JSContext
*, const MozMap
<JS::Value
>&);
538 void PassNullableMozMapOfAny(JSContext
*, const Nullable
<MozMap
<JS::Value
> >&);
539 void PassOptionalMozMapOfAny(JSContext
*, const Optional
<MozMap
<JS::Value
> >&);
540 void PassOptionalNullableMozMapOfAny(JSContext
*, const Optional
<Nullable
<MozMap
<JS::Value
> > >&);
541 void PassOptionalMozMapOfAnyWithDefaultValue(JSContext
*, const Nullable
<MozMap
<JS::Value
> >&);
542 void PassMozMapOfMozMapOfAny(JSContext
*, const MozMap
<MozMap
<JS::Value
> >&);
543 void PassMozMapOfNullableMozMapOfAny(JSContext
*, const MozMap
<Nullable
<MozMap
<JS::Value
> > >&);
544 void PassNullableMozMapOfNullableMozMapOfAny(JSContext
*, const Nullable
<MozMap
<Nullable
<MozMap
<JS::Value
> > > >&);
545 void PassOptionalNullableMozMapOfNullableMozMapOfAny(JSContext
*, const Optional
<Nullable
<MozMap
<Nullable
<MozMap
<JS::Value
>>>>>&);
546 void PassOptionalNullableMozMapOfNullableSequenceOfAny(JSContext
*, const Optional
<Nullable
<MozMap
<Nullable
<Sequence
<JS::Value
>>>>>&);
547 void PassOptionalNullableSequenceOfNullableMozMapOfAny(JSContext
*, const Optional
<Nullable
<Sequence
<Nullable
<MozMap
<JS::Value
>>>>>&);
548 void ReceiveAny(JSContext
*, JS::MutableHandle
<JS::Value
>);
551 void PassObject(JSContext
*, JS::Handle
<JSObject
*>);
552 void PassVariadicObject(JSContext
*, const Sequence
<JSObject
*>&);
553 void PassNullableObject(JSContext
*, JS::Handle
<JSObject
*>);
554 void PassVariadicNullableObject(JSContext
*, const Sequence
<JSObject
*>&);
555 void PassOptionalObject(JSContext
*, const Optional
<JS::Handle
<JSObject
*> >&);
556 void PassOptionalNullableObject(JSContext
*, const Optional
<JS::Handle
<JSObject
*> >&);
557 void PassOptionalNullableObjectWithDefaultValue(JSContext
*, JS::Handle
<JSObject
*>);
558 void PassSequenceOfObject(JSContext
*, const Sequence
<JSObject
*>&);
559 void PassSequenceOfNullableObject(JSContext
*, const Sequence
<JSObject
*>&);
560 void PassNullableSequenceOfObject(JSContext
*, const Nullable
<Sequence
<JSObject
*> >&);
561 void PassOptionalNullableSequenceOfNullableSequenceOfObject(JSContext
*, const Optional
<Nullable
<Sequence
<Nullable
<Sequence
<JSObject
*> > > > >&);
562 void PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(JSContext
*, const Optional
<Nullable
<Sequence
<Nullable
<Sequence
<JSObject
*> > > > >&);
563 void PassMozMapOfObject(JSContext
*, const MozMap
<JSObject
*>&);
564 void ReceiveObject(JSContext
*, JS::MutableHandle
<JSObject
*>);
565 void ReceiveNullableObject(JSContext
*, JS::MutableHandle
<JSObject
*>);
568 void PassUnion(JSContext
*, const ObjectOrLong
& arg
);
569 void PassUnionWithNullable(JSContext
* cx
, const ObjectOrNullOrLong
& arg
)
571 OwningObjectOrLong returnValue
;
573 } else if (arg
.IsObject()) {
574 JS::Rooted
<JSObject
*> obj(cx
, arg
.GetAsObject());
576 returnValue
.SetAsObject() = obj
;
578 int32_t i
= arg
.GetAsLong();
580 returnValue
.SetAsLong() = i
;
584 void PassUnion2(const LongOrBoolean
& arg
);
585 void PassUnion3(JSContext
*, const ObjectOrLongOrBoolean
& arg
);
586 void PassUnion4(const NodeOrLongOrBoolean
& arg
);
587 void PassUnion5(JSContext
*, const ObjectOrBoolean
& arg
);
588 void PassUnion6(JSContext
*, const ObjectOrString
& arg
);
589 void PassUnion7(JSContext
*, const ObjectOrStringOrLong
& arg
);
590 void PassUnion8(JSContext
*, const ObjectOrStringOrBoolean
& arg
);
591 void PassUnion9(JSContext
*, const ObjectOrStringOrLongOrBoolean
& arg
);
592 void PassUnion10(const EventInitOrLong
& arg
);
593 void PassUnion11(JSContext
*, const CustomEventInitOrLong
& arg
);
594 void PassUnion12(const EventInitOrLong
& arg
);
595 void PassUnion13(JSContext
*, const ObjectOrLongOrNull
& arg
);
596 void PassUnion14(JSContext
*, const ObjectOrLongOrNull
& arg
);
597 void PassUnion15(const LongSequenceOrLong
&);
598 void PassUnion16(const Optional
<LongSequenceOrLong
>&);
599 void PassUnion17(const LongSequenceOrNullOrLong
&);
600 void PassUnion18(JSContext
*, const ObjectSequenceOrLong
&);
601 void PassUnion19(JSContext
*, const Optional
<ObjectSequenceOrLong
>&);
602 void PassUnion20(JSContext
*, const ObjectSequenceOrLong
&);
603 void PassUnion21(const LongMozMapOrLong
&);
604 void PassUnion22(JSContext
*, const ObjectMozMapOrLong
&);
605 void PassUnion23(const ImageDataSequenceOrLong
&);
606 void PassUnion24(const ImageDataOrNullSequenceOrLong
&);
607 void PassUnion25(const ImageDataSequenceSequenceOrLong
&);
608 void PassUnion26(const ImageDataOrNullSequenceSequenceOrLong
&);
609 void PassUnion27(const StringSequenceOrEventInit
&);
610 void PassUnion28(const EventInitOrStringSequence
&);
611 void PassUnionWithCallback(const EventHandlerNonNullOrNullOrLong
& arg
);
612 void PassUnionWithByteString(const ByteStringOrLong
&);
613 void PassUnionWithMozMap(const StringMozMapOrString
&);
614 void PassUnionWithMozMapAndSequence(const StringMozMapOrStringSequence
&);
615 void PassUnionWithSequenceAndMozMap(const StringSequenceOrStringMozMap
&);
616 void PassUnionWithUSVS(const USVStringOrLong
&);
618 void PassNullableUnion(JSContext
*, const Nullable
<ObjectOrLong
>&);
619 void PassOptionalUnion(JSContext
*, const Optional
<ObjectOrLong
>&);
620 void PassOptionalNullableUnion(JSContext
*, const Optional
<Nullable
<ObjectOrLong
> >&);
621 void PassOptionalNullableUnionWithDefaultValue(JSContext
*, const Nullable
<ObjectOrLong
>&);
622 //void PassUnionWithInterfaces(const TestInterfaceOrTestExternalInterface& arg);
623 //void PassUnionWithInterfacesAndNullable(const TestInterfaceOrNullOrTestExternalInterface& arg);
624 void PassUnionWithArrayBuffer(const ArrayBufferOrLong
&);
625 void PassUnionWithString(JSContext
*, const StringOrObject
&);
626 //void PassUnionWithEnum(JSContext*, const TestEnumOrObject&);
627 //void PassUnionWithCallback(JSContext*, const TestCallbackOrLong&);
628 void PassUnionWithObject(JSContext
*, const ObjectOrLong
&);
630 void PassUnionWithDefaultValue1(const DoubleOrString
& arg
);
631 void PassUnionWithDefaultValue2(const DoubleOrString
& arg
);
632 void PassUnionWithDefaultValue3(const DoubleOrString
& arg
);
633 void PassUnionWithDefaultValue4(const FloatOrString
& arg
);
634 void PassUnionWithDefaultValue5(const FloatOrString
& arg
);
635 void PassUnionWithDefaultValue6(const FloatOrString
& arg
);
636 void PassUnionWithDefaultValue7(const UnrestrictedDoubleOrString
& arg
);
637 void PassUnionWithDefaultValue8(const UnrestrictedDoubleOrString
& arg
);
638 void PassUnionWithDefaultValue9(const UnrestrictedDoubleOrString
& arg
);
639 void PassUnionWithDefaultValue10(const UnrestrictedDoubleOrString
& arg
);
640 void PassUnionWithDefaultValue11(const UnrestrictedFloatOrString
& arg
);
641 void PassUnionWithDefaultValue12(const UnrestrictedFloatOrString
& arg
);
642 void PassUnionWithDefaultValue13(const UnrestrictedFloatOrString
& arg
);
643 void PassUnionWithDefaultValue14(const UnrestrictedFloatOrString
& arg
);
645 void PassNullableUnionWithDefaultValue1(const Nullable
<DoubleOrString
>& arg
);
646 void PassNullableUnionWithDefaultValue2(const Nullable
<DoubleOrString
>& arg
);
647 void PassNullableUnionWithDefaultValue3(const Nullable
<DoubleOrString
>& arg
);
648 void PassNullableUnionWithDefaultValue4(const Nullable
<FloatOrString
>& arg
);
649 void PassNullableUnionWithDefaultValue5(const Nullable
<FloatOrString
>& arg
);
650 void PassNullableUnionWithDefaultValue6(const Nullable
<FloatOrString
>& arg
);
651 void PassNullableUnionWithDefaultValue7(const Nullable
<UnrestrictedDoubleOrString
>& arg
);
652 void PassNullableUnionWithDefaultValue8(const Nullable
<UnrestrictedDoubleOrString
>& arg
);
653 void PassNullableUnionWithDefaultValue9(const Nullable
<UnrestrictedDoubleOrString
>& arg
);
654 void PassNullableUnionWithDefaultValue10(const Nullable
<UnrestrictedFloatOrString
>& arg
);
655 void PassNullableUnionWithDefaultValue11(const Nullable
<UnrestrictedFloatOrString
>& arg
);
656 void PassNullableUnionWithDefaultValue12(const Nullable
<UnrestrictedFloatOrString
>& arg
);
658 void PassSequenceOfUnions(const Sequence
<OwningCanvasPatternOrCanvasGradient
>&);
659 void PassSequenceOfUnions2(JSContext
*, const Sequence
<OwningObjectOrLong
>&);
660 void PassVariadicUnion(const Sequence
<OwningCanvasPatternOrCanvasGradient
>&);
662 void PassSequenceOfNullableUnions(const Sequence
<Nullable
<OwningCanvasPatternOrCanvasGradient
>>&);
663 void PassVariadicNullableUnion(const Sequence
<Nullable
<OwningCanvasPatternOrCanvasGradient
>>&);
664 void PassMozMapOfUnions(const MozMap
<OwningCanvasPatternOrCanvasGradient
>&);
665 void PassMozMapOfUnions2(JSContext
*, const MozMap
<OwningObjectOrLong
>&);
667 void ReceiveUnion(OwningCanvasPatternOrCanvasGradient
&);
668 void ReceiveUnion2(JSContext
*, OwningObjectOrLong
&);
669 void ReceiveUnionContainingNull(OwningCanvasPatternOrNullOrCanvasGradient
&);
670 void ReceiveNullableUnion(Nullable
<OwningCanvasPatternOrCanvasGradient
>&);
671 void ReceiveNullableUnion2(JSContext
*, Nullable
<OwningObjectOrLong
>&);
672 void GetWritableUnion(OwningCanvasPatternOrCanvasGradient
&);
673 void SetWritableUnion(const CanvasPatternOrCanvasGradient
&);
674 void GetWritableUnionContainingNull(OwningCanvasPatternOrNullOrCanvasGradient
&);
675 void SetWritableUnionContainingNull(const CanvasPatternOrNullOrCanvasGradient
&);
676 void GetWritableNullableUnion(Nullable
<OwningCanvasPatternOrCanvasGradient
>&);
677 void SetWritableNullableUnion(const Nullable
<CanvasPatternOrCanvasGradient
>&);
681 void PassNullableDate(const Nullable
<Date
>&);
682 void PassOptionalDate(const Optional
<Date
>&);
683 void PassOptionalNullableDate(const Optional
<Nullable
<Date
> >&);
684 void PassOptionalNullableDateWithDefaultValue(const Nullable
<Date
>&);
685 void PassDateSequence(const Sequence
<Date
>&);
686 void PassDateMozMap(const MozMap
<Date
>&);
687 void PassNullableDateSequence(const Sequence
<Nullable
<Date
> >&);
689 Nullable
<Date
> ReceiveNullableDate();
692 void MethodRenamedTo();
693 void OtherMethodRenamedTo();
694 void MethodRenamedTo(int8_t);
695 int8_t AttributeGetterRenamedTo();
696 int8_t AttributeRenamedTo();
697 void SetAttributeRenamedTo(int8_t);
698 int8_t OtherAttributeRenamedTo();
699 void SetOtherAttributeRenamedTo(int8_t);
702 void PassDictionary(JSContext
*, const Dict
&);
703 void GetReadonlyDictionary(JSContext
*, Dict
&);
704 void GetReadonlyNullableDictionary(JSContext
*, Nullable
<Dict
>&);
705 void GetWritableDictionary(JSContext
*, Dict
&);
706 void SetWritableDictionary(JSContext
*, const Dict
&);
707 void GetReadonlyFrozenDictionary(JSContext
*, Dict
&);
708 void GetReadonlyFrozenNullableDictionary(JSContext
*, Nullable
<Dict
>&);
709 void GetWritableFrozenDictionary(JSContext
*, Dict
&);
710 void SetWritableFrozenDictionary(JSContext
*, const Dict
&);
711 void ReceiveDictionary(JSContext
*, Dict
&);
712 void ReceiveNullableDictionary(JSContext
*, Nullable
<Dict
>&);
713 void PassOtherDictionary(const GrandparentDict
&);
714 void PassSequenceOfDictionaries(JSContext
*, const Sequence
<Dict
>&);
715 void PassMozMapOfDictionaries(const MozMap
<GrandparentDict
>&);
716 void PassDictionaryOrLong(JSContext
*, const Dict
&);
717 void PassDictionaryOrLong(int32_t);
718 void PassDictContainingDict(JSContext
*, const DictContainingDict
&);
719 void PassDictContainingSequence(JSContext
*, const DictContainingSequence
&);
720 void ReceiveDictContainingSequence(JSContext
*, DictContainingSequence
&);
721 void PassVariadicDictionary(JSContext
*, const Sequence
<Dict
>&);
724 void ExerciseTypedefInterfaces1(TestInterface
&);
725 already_AddRefed
<TestInterface
> ExerciseTypedefInterfaces2(TestInterface
*);
726 void ExerciseTypedefInterfaces3(TestInterface
&);
728 // Static methods and attributes
729 static void StaticMethod(const GlobalObject
&, bool);
730 static void StaticMethodWithContext(const GlobalObject
&, JS::Value
);
731 static bool StaticAttribute(const GlobalObject
&);
732 static void SetStaticAttribute(const GlobalObject
&, bool);
734 // Overload resolution tests
735 bool Overload1(TestInterface
&);
736 TestInterface
* Overload1(const nsAString
&, TestInterface
&);
737 void Overload2(TestInterface
&);
738 void Overload2(JSContext
*, const Dict
&);
739 void Overload2(bool);
740 void Overload2(const nsAString
&);
741 void Overload2(Date
);
742 void Overload3(TestInterface
&);
743 void Overload3(const TestCallback
&);
744 void Overload3(bool);
745 void Overload4(TestInterface
&);
746 void Overload4(TestCallbackInterface
&);
747 void Overload4(const nsAString
&);
748 void Overload5(int32_t);
749 void Overload5(TestEnum
);
750 void Overload6(int32_t);
751 void Overload6(bool);
752 void Overload7(int32_t);
753 void Overload7(bool);
754 void Overload7(const nsCString
&);
755 void Overload8(int32_t);
756 void Overload8(TestInterface
&);
757 void Overload9(const Nullable
<int32_t>&);
758 void Overload9(const nsAString
&);
759 void Overload10(const Nullable
<int32_t>&);
760 void Overload10(JSContext
*, JS::Handle
<JSObject
*>);
761 void Overload11(int32_t);
762 void Overload11(const nsAString
&);
763 void Overload12(int32_t);
764 void Overload12(const Nullable
<bool>&);
765 void Overload13(const Nullable
<int32_t>&);
766 void Overload13(bool);
767 void Overload14(const Optional
<int32_t>&);
768 void Overload14(TestInterface
&);
769 void Overload15(int32_t);
770 void Overload15(const Optional
<NonNull
<TestInterface
> >&);
771 void Overload16(int32_t);
772 void Overload16(const Optional
<TestInterface
*>&);
773 void Overload17(const Sequence
<int32_t>&);
774 void Overload17(const MozMap
<int32_t>&);
775 void Overload18(const MozMap
<nsString
>&);
776 void Overload18(const Sequence
<nsString
>&);
777 void Overload19(const Sequence
<int32_t>&);
778 void Overload19(JSContext
*, const Dict
&);
779 void Overload20(JSContext
*, const Dict
&);
780 void Overload20(const Sequence
<int32_t>&);
783 void PassVariadicThirdArg(const nsAString
&, int32_t,
784 const Sequence
<OwningNonNull
<TestInterface
> >&);
786 // Conditionally exposed methods/attributes
813 int32_t AttrWithLenientThis();
814 void SetAttrWithLenientThis(int32_t);
815 uint32_t UnforgeableAttr();
816 uint32_t UnforgeableAttr2();
817 uint32_t UnforgeableMethod();
818 uint32_t UnforgeableMethod2();
819 void Stringify(nsString
&);
820 void PassRenamedInterface(nsRenamedInterface
&);
821 TestInterface
* PutForwardsAttr();
822 TestInterface
* PutForwardsAttr2();
823 TestInterface
* PutForwardsAttr3();
824 void GetJsonifierShouldSkipThis(JSContext
*, JS::MutableHandle
<JS::Value
>);
825 void SetJsonifierShouldSkipThis(JSContext
*, JS::Rooted
<JS::Value
>&);
826 TestParentInterface
* JsonifierShouldSkipThis2();
827 void SetJsonifierShouldSkipThis2(TestParentInterface
&);
828 TestCallbackInterface
* JsonifierShouldSkipThis3();
829 void SetJsonifierShouldSkipThis3(TestCallbackInterface
&);
830 void ThrowingMethod(ErrorResult
& aRv
);
831 bool GetThrowingAttr(ErrorResult
& aRv
) const;
832 void SetThrowingAttr(bool arg
, ErrorResult
& aRv
);
833 bool GetThrowingGetterAttr(ErrorResult
& aRv
) const;
834 void SetThrowingGetterAttr(bool arg
);
835 bool ThrowingSetterAttr() const;
836 void SetThrowingSetterAttr(bool arg
, ErrorResult
& aRv
);
837 int16_t LegacyCall(JS::Value
, uint32_t, TestInterface
&);
838 void PassArgsWithDefaults(JSContext
*, const Optional
<int32_t>&,
839 TestInterface
*, const Dict
&, double,
840 const Optional
<float>&);
842 void SetDashed_attribute(int8_t);
843 int8_t Dashed_attribute();
844 void Dashed_method();
846 // Methods and properties imported via "implements"
847 bool ImplementedProperty();
848 void SetImplementedProperty(bool);
849 void ImplementedMethod();
850 bool ImplementedParentProperty();
851 void SetImplementedParentProperty(bool);
852 void ImplementedParentMethod();
853 bool IndirectlyImplementedProperty();
854 void SetIndirectlyImplementedProperty(bool);
855 void IndirectlyImplementedMethod();
856 uint32_t DiamondImplementedProperty();
858 // Test EnforceRange/Clamp
859 void DontEnforceRangeOrClamp(int8_t);
860 void DoEnforceRange(int8_t);
861 void DoClamp(int8_t);
862 void SetEnforcedByte(int8_t);
863 int8_t EnforcedByte();
864 void SetClampedByte(int8_t);
865 int8_t ClampedByte();
868 // We add signatures here that _could_ start matching if the codegen
869 // got data types wrong. That way if it ever does we'll have a call
870 // to these private deleted methods and compilation will fail.
871 void SetReadonlyByte(int8_t) = delete;
873 void SetWritableByte(T
) = delete;
875 void PassByte(T
) = delete;
876 void PassNullableByte(Nullable
<int8_t>&) = delete;
878 void PassOptionalByte(const Optional
<T
>&) = delete;
880 void PassOptionalByteWithDefault(T
) = delete;
881 void PassVariadicByte(Sequence
<int8_t>&) = delete;
883 void SetReadonlyShort(int16_t) = delete;
885 void SetWritableShort(T
) = delete;
887 void PassShort(T
) = delete;
889 void PassOptionalShort(const Optional
<T
>&) = delete;
891 void PassOptionalShortWithDefault(T
) = delete;
893 void SetReadonlyLong(int32_t) = delete;
895 void SetWritableLong(T
) = delete;
897 void PassLong(T
) = delete;
899 void PassOptionalLong(const Optional
<T
>&) = delete;
901 void PassOptionalLongWithDefault(T
) = delete;
903 void SetReadonlyLongLong(int64_t) = delete;
905 void SetWritableLongLong(T
) = delete;
907 void PassLongLong(T
) = delete;
909 void PassOptionalLongLong(const Optional
<T
>&) = delete;
911 void PassOptionalLongLongWithDefault(T
) = delete;
913 void SetReadonlyOctet(uint8_t) = delete;
915 void SetWritableOctet(T
) = delete;
917 void PassOctet(T
) = delete;
919 void PassOptionalOctet(const Optional
<T
>&) = delete;
921 void PassOptionalOctetWithDefault(T
) = delete;
923 void SetReadonlyUnsignedShort(uint16_t) = delete;
925 void SetWritableUnsignedShort(T
) = delete;
927 void PassUnsignedShort(T
) = delete;
929 void PassOptionalUnsignedShort(const Optional
<T
>&) = delete;
931 void PassOptionalUnsignedShortWithDefault(T
) = delete;
933 void SetReadonlyUnsignedLong(uint32_t) = delete;
935 void SetWritableUnsignedLong(T
) = delete;
937 void PassUnsignedLong(T
) = delete;
939 void PassOptionalUnsignedLong(const Optional
<T
>&) = delete;
941 void PassOptionalUnsignedLongWithDefault(T
) = delete;
943 void SetReadonlyUnsignedLongLong(uint64_t) = delete;
945 void SetWritableUnsignedLongLong(T
) = delete;
947 void PassUnsignedLongLong(T
) = delete;
949 void PassOptionalUnsignedLongLong(const Optional
<T
>&) = delete;
951 void PassOptionalUnsignedLongLongWithDefault(T
) = delete;
953 // Enforce that only const things are passed for sequences
954 void PassSequence(Sequence
<int32_t> &) = delete;
955 void PassNullableSequence(Nullable
< Sequence
<int32_t> >&) = delete;
956 void PassOptionalNullableSequenceWithDefaultValue(Nullable
< Sequence
<int32_t> >&) = delete;
957 void PassSequenceOfAny(JSContext
*, Sequence
<JS::Value
>&) = delete;
958 void PassNullableSequenceOfAny(JSContext
*, Nullable
<Sequence
<JS::Value
> >&) = delete;
959 void PassOptionalSequenceOfAny(JSContext
*, Optional
<Sequence
<JS::Value
> >&) = delete;
960 void PassOptionalNullableSequenceOfAny(JSContext
*, Optional
<Nullable
<Sequence
<JS::Value
> > >&) = delete;
961 void PassOptionalSequenceOfAnyWithDefaultValue(JSContext
*, Nullable
<Sequence
<JS::Value
> >&) = delete;
962 void PassSequenceOfSequenceOfAny(JSContext
*, Sequence
<Sequence
<JS::Value
> >&) = delete;
963 void PassSequenceOfNullableSequenceOfAny(JSContext
*, Sequence
<Nullable
<Sequence
<JS::Value
> > >&) = delete;
964 void PassNullableSequenceOfNullableSequenceOfAny(JSContext
*, Nullable
<Sequence
<Nullable
<Sequence
<JS::Value
> > > >&) = delete;
965 void PassOptionalNullableSequenceOfNullableSequenceOfAny(JSContext
*, Optional
<Nullable
<Sequence
<Nullable
<Sequence
<JS::Value
> > > > >&) = delete;
966 void PassSequenceOfObject(JSContext
*, Sequence
<JSObject
*>&) = delete;
967 void PassSequenceOfNullableObject(JSContext
*, Sequence
<JSObject
*>&) = delete;
968 void PassOptionalNullableSequenceOfNullableSequenceOfObject(JSContext
*, Optional
<Nullable
<Sequence
<Nullable
<Sequence
<JSObject
*> > > > >&) = delete;
969 void PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(JSContext
*, Optional
<Nullable
<Sequence
<Nullable
<Sequence
<JSObject
*> > > > >&) = delete;
971 // Enforce that only const things are passed for optional
972 void PassOptionalByte(Optional
<int8_t>&) = delete;
973 void PassOptionalNullableByte(Optional
<Nullable
<int8_t> >&) = delete;
974 void PassOptionalShort(Optional
<int16_t>&) = delete;
975 void PassOptionalLong(Optional
<int32_t>&) = delete;
976 void PassOptionalLongLong(Optional
<int64_t>&) = delete;
977 void PassOptionalOctet(Optional
<uint8_t>&) = delete;
978 void PassOptionalUnsignedShort(Optional
<uint16_t>&) = delete;
979 void PassOptionalUnsignedLong(Optional
<uint32_t>&) = delete;
980 void PassOptionalUnsignedLongLong(Optional
<uint64_t>&) = delete;
981 void PassOptionalSelf(Optional
<TestInterface
*> &) = delete;
982 void PassOptionalNonNullSelf(Optional
<NonNull
<TestInterface
> >&) = delete;
983 void PassOptionalOther(Optional
<IndirectlyImplementedInterface
*>&);
984 void PassOptionalNonNullOther(Optional
<NonNull
<IndirectlyImplementedInterface
> >&);
985 void PassOptionalExternal(Optional
<TestExternalInterface
*>&) = delete;
986 void PassOptionalNonNullExternal(Optional
<TestExternalInterface
*>&) = delete;
987 void PassOptionalSequence(Optional
<Sequence
<int32_t> >&) = delete;
988 void PassOptionalNullableSequence(Optional
<Nullable
<Sequence
<int32_t> > >&) = delete;
989 void PassOptionalObjectSequence(Optional
<Sequence
<OwningNonNull
<TestInterface
> > >&) = delete;
990 void PassOptionalArrayBuffer(Optional
<ArrayBuffer
>&) = delete;
991 void PassOptionalNullableArrayBuffer(Optional
<ArrayBuffer
*>&) = delete;
992 void PassOptionalEnum(Optional
<TestEnum
>&) = delete;
993 void PassOptionalCallback(JSContext
*, Optional
<OwningNonNull
<TestCallback
> >&) = delete;
994 void PassOptionalNullableCallback(JSContext
*, Optional
<nsRefPtr
<TestCallback
> >&) = delete;
995 void PassOptionalAny(Optional
<JS::Handle
<JS::Value
> >&) = delete;
997 // And test that string stuff is always const
998 void PassString(nsAString
&) = delete;
999 void PassNullableString(nsAString
&) = delete;
1000 void PassOptionalString(Optional
<nsAString
>&) = delete;
1001 void PassOptionalStringWithDefaultValue(nsAString
&) = delete;
1002 void PassOptionalNullableString(Optional
<nsAString
>&) = delete;
1003 void PassOptionalNullableStringWithDefaultValue(nsAString
&) = delete;
1004 void PassVariadicString(Sequence
<nsString
>&) = delete;
1006 // cstrings should be const as well
1007 void PassByteString(nsCString
&) = delete;
1008 void PassNullableByteString(nsCString
&) = delete;
1009 void PassOptionalByteString(Optional
<nsCString
>&) = delete;
1010 void PassOptionalNullableByteString(Optional
<nsCString
>&) = delete;
1011 void PassVariadicByteString(Sequence
<nsCString
>&) = delete;
1013 // Make sure dictionary arguments are always const
1014 void PassDictionary(JSContext
*, Dict
&) = delete;
1015 void PassOtherDictionary(GrandparentDict
&) = delete;
1016 void PassSequenceOfDictionaries(JSContext
*, Sequence
<Dict
>&) = delete;
1017 void PassDictionaryOrLong(JSContext
*, Dict
&) = delete;
1018 void PassDictContainingDict(JSContext
*, DictContainingDict
&) = delete;
1019 void PassDictContainingSequence(DictContainingSequence
&) = delete;
1021 // Make sure various nullable things are always const
1022 void PassNullableEnum(Nullable
<TestEnum
>&) = delete;
1024 // Make sure unions are always const
1025 void PassUnion(JSContext
*, ObjectOrLong
& arg
) = delete;
1026 void PassUnionWithNullable(JSContext
*, ObjectOrNullOrLong
& arg
) = delete;
1027 void PassNullableUnion(JSContext
*, Nullable
<ObjectOrLong
>&) = delete;
1028 void PassOptionalUnion(JSContext
*, Optional
<ObjectOrLong
>&) = delete;
1029 void PassOptionalNullableUnion(JSContext
*, Optional
<Nullable
<ObjectOrLong
> >&) = delete;
1030 void PassOptionalNullableUnionWithDefaultValue(JSContext
*, Nullable
<ObjectOrLong
>&) = delete;
1032 // Make sure various date stuff is const as needed
1033 void PassNullableDate(Nullable
<Date
>&) = delete;
1034 void PassOptionalDate(Optional
<Date
>&) = delete;
1035 void PassOptionalNullableDate(Optional
<Nullable
<Date
> >&) = delete;
1036 void PassOptionalNullableDateWithDefaultValue(Nullable
<Date
>&) = delete;
1037 void PassDateSequence(Sequence
<Date
>&) = delete;
1038 void PassNullableDateSequence(Sequence
<Nullable
<Date
> >&) = delete;
1040 // Make sure variadics are const as needed
1041 void PassVariadicAny(JSContext
*, Sequence
<JS::Value
>&) = delete;
1042 void PassVariadicObject(JSContext
*, Sequence
<JSObject
*>&) = delete;
1043 void PassVariadicNullableObject(JSContext
*, Sequence
<JSObject
*>&) = delete;
1045 // Ensure NonNull does not leak in
1046 void PassSelf(NonNull
<TestInterface
>&) = delete;
1047 void PassSelf(OwningNonNull
<TestInterface
>&) = delete;
1048 void PassSelf(const NonNull
<TestInterface
>&) = delete;
1049 void PassSelf(const OwningNonNull
<TestInterface
>&) = delete;
1050 void PassOther(NonNull
<IndirectlyImplementedInterface
>&) = delete;
1051 void PassOther(const NonNull
<IndirectlyImplementedInterface
>&) = delete;
1052 void PassOther(OwningNonNull
<IndirectlyImplementedInterface
>&) = delete;
1053 void PassOther(const OwningNonNull
<IndirectlyImplementedInterface
>&) = delete;
1054 void PassCallbackInterface(OwningNonNull
<TestCallbackInterface
>&) = delete;
1055 void PassCallbackInterface(const OwningNonNull
<TestCallbackInterface
>&) = delete;
1056 void PassCallbackInterface(NonNull
<TestCallbackInterface
>&) = delete;
1057 void PassCallbackInterface(const NonNull
<TestCallbackInterface
>&) = delete;
1058 void PassCallback(OwningNonNull
<TestCallback
>&) = delete;
1059 void PassCallback(const OwningNonNull
<TestCallback
>&) = delete;
1060 void PassCallback(NonNull
<TestCallback
>&) = delete;
1061 void PassCallback(const NonNull
<TestCallback
>&) = delete;
1062 void PassString(const NonNull
<nsAString
>&) = delete;
1063 void PassString(NonNull
<nsAString
>&) = delete;
1064 void PassString(const OwningNonNull
<nsAString
>&) = delete;
1065 void PassString(OwningNonNull
<nsAString
>&) = delete;
1068 class TestIndexedGetterInterface
: public nsISupports
,
1069 public nsWrapperCache
1074 // We need a GetParentObject to make binding codegen happy
1075 virtual nsISupports
* GetParentObject();
1077 uint32_t IndexedGetter(uint32_t, bool&);
1078 uint32_t IndexedGetter(uint32_t&) = delete;
1079 uint32_t Item(uint32_t&);
1080 uint32_t Item(uint32_t, bool&) = delete;
1082 void LegacyCall(JS::Handle
<JS::Value
>);
1085 class TestNamedGetterInterface
: public nsISupports
,
1086 public nsWrapperCache
1091 // We need a GetParentObject to make binding codegen happy
1092 virtual nsISupports
* GetParentObject();
1094 void NamedGetter(const nsAString
&, bool&, nsAString
&);
1095 bool NameIsEnumerable(const nsAString
&);
1096 void GetSupportedNames(unsigned, nsTArray
<nsString
>&);
1099 class TestIndexedGetterAndSetterAndNamedGetterInterface
: public nsISupports
,
1100 public nsWrapperCache
1105 // We need a GetParentObject to make binding codegen happy
1106 virtual nsISupports
* GetParentObject();
1108 void NamedGetter(const nsAString
&, bool&, nsAString
&);
1109 bool NameIsEnumerable(const nsAString
&);
1110 void GetSupportedNames(unsigned, nsTArray
<nsString
>&);
1111 int32_t IndexedGetter(uint32_t, bool&);
1112 void IndexedSetter(uint32_t, int32_t);
1116 class TestIndexedAndNamedGetterInterface
: public nsISupports
,
1117 public nsWrapperCache
1122 // We need a GetParentObject to make binding codegen happy
1123 virtual nsISupports
* GetParentObject();
1125 uint32_t IndexedGetter(uint32_t, bool&);
1126 void NamedGetter(const nsAString
&, bool&, nsAString
&);
1127 bool NameIsEnumerable(const nsAString
&);
1128 void NamedItem(const nsAString
&, nsAString
&);
1130 void GetSupportedNames(unsigned, nsTArray
<nsString
>&);
1133 class TestIndexedSetterInterface
: public nsISupports
,
1134 public nsWrapperCache
1139 // We need a GetParentObject to make binding codegen happy
1140 virtual nsISupports
* GetParentObject();
1142 void IndexedSetter(uint32_t, const nsAString
&);
1143 void IndexedGetter(uint32_t, bool&, nsString
&);
1145 void SetItem(uint32_t, const nsAString
&);
1148 class TestNamedSetterInterface
: public nsISupports
,
1149 public nsWrapperCache
1154 // We need a GetParentObject to make binding codegen happy
1155 virtual nsISupports
* GetParentObject();
1157 void NamedSetter(const nsAString
&, TestIndexedSetterInterface
&);
1158 TestIndexedSetterInterface
* NamedGetter(const nsAString
&, bool&);
1159 bool NameIsEnumerable(const nsAString
&);
1160 void GetSupportedNames(unsigned, nsTArray
<nsString
>&);
1163 class TestIndexedAndNamedSetterInterface
: public nsISupports
,
1164 public nsWrapperCache
1169 // We need a GetParentObject to make binding codegen happy
1170 virtual nsISupports
* GetParentObject();
1172 void IndexedSetter(uint32_t, TestIndexedSetterInterface
&);
1173 TestIndexedSetterInterface
* IndexedGetter(uint32_t, bool&);
1175 void NamedSetter(const nsAString
&, TestIndexedSetterInterface
&);
1176 TestIndexedSetterInterface
* NamedGetter(const nsAString
&, bool&);
1177 bool NameIsEnumerable(const nsAString
&);
1178 void SetNamedItem(const nsAString
&, TestIndexedSetterInterface
&);
1179 void GetSupportedNames(unsigned, nsTArray
<nsString
>&);
1182 class TestIndexedAndNamedGetterAndSetterInterface
: public TestIndexedSetterInterface
1185 uint32_t IndexedGetter(uint32_t, bool&);
1186 uint32_t Item(uint32_t);
1187 void NamedGetter(const nsAString
&, bool&, nsAString
&);
1188 bool NameIsEnumerable(const nsAString
&);
1189 void NamedItem(const nsAString
&, nsAString
&);
1190 void IndexedSetter(uint32_t, int32_t&);
1191 void IndexedSetter(uint32_t, const nsAString
&) = delete;
1192 void NamedSetter(const nsAString
&, const nsAString
&);
1193 void Stringify(nsAString
&);
1195 void GetSupportedNames(unsigned, nsTArray
<nsString
>&);
1198 class TestCppKeywordNamedMethodsInterface
: public nsISupports
,
1199 public nsWrapperCache
1204 // We need a GetParentObject to make binding codegen happy
1205 virtual nsISupports
* GetParentObject();
1212 class TestIndexedDeleterInterface
: public nsISupports
,
1213 public nsWrapperCache
1218 // We need a GetParentObject to make binding codegen happy
1219 virtual nsISupports
* GetParentObject();
1221 void IndexedDeleter(uint32_t, bool&);
1222 void IndexedDeleter(uint32_t) = delete;
1223 long IndexedGetter(uint32_t, bool&);
1225 void DelItem(uint32_t);
1226 void DelItem(uint32_t, bool&) = delete;
1229 class TestIndexedDeleterWithRetvalInterface
: public nsISupports
,
1230 public nsWrapperCache
1235 // We need a GetParentObject to make binding codegen happy
1236 virtual nsISupports
* GetParentObject();
1238 bool IndexedDeleter(uint32_t, bool&);
1239 bool IndexedDeleter(uint32_t) = delete;
1240 long IndexedGetter(uint32_t, bool&);
1242 bool DelItem(uint32_t);
1243 bool DelItem(uint32_t, bool&) = delete;
1246 class TestNamedDeleterInterface
: public nsISupports
,
1247 public nsWrapperCache
1252 // We need a GetParentObject to make binding codegen happy
1253 virtual nsISupports
* GetParentObject();
1255 void NamedDeleter(const nsAString
&, bool&);
1256 long NamedGetter(const nsAString
&, bool&);
1257 bool NameIsEnumerable(const nsAString
&);
1258 void GetSupportedNames(unsigned, nsTArray
<nsString
>&);
1261 class TestNamedDeleterWithRetvalInterface
: public nsISupports
,
1262 public nsWrapperCache
1267 // We need a GetParentObject to make binding codegen happy
1268 virtual nsISupports
* GetParentObject();
1270 bool NamedDeleter(const nsAString
&, bool&);
1271 bool NamedDeleter(const nsAString
&) = delete;
1272 long NamedGetter(const nsAString
&, bool&);
1273 bool NameIsEnumerable(const nsAString
&);
1274 bool DelNamedItem(const nsAString
&);
1275 bool DelNamedItem(const nsAString
&, bool&) = delete;
1276 void GetSupportedNames(unsigned, nsTArray
<nsString
>&);
1279 class TestIndexedAndNamedDeleterInterface
: public nsISupports
,
1280 public nsWrapperCache
1285 // We need a GetParentObject to make binding codegen happy
1286 virtual nsISupports
* GetParentObject();
1288 void IndexedDeleter(uint32_t, bool&);
1289 long IndexedGetter(uint32_t, bool&);
1292 void NamedDeleter(const nsAString
&, bool&);
1293 void NamedDeleter(const nsAString
&) = delete;
1294 long NamedGetter(const nsAString
&, bool&);
1295 bool NameIsEnumerable(const nsAString
&);
1296 void DelNamedItem(const nsAString
&);
1297 void DelNamedItem(const nsAString
&, bool&) = delete;
1298 void GetSupportedNames(unsigned, nsTArray
<nsString
>&);
1301 class TestParentInterface
: public nsISupports
,
1302 public nsWrapperCache
1307 // We need a GetParentObject to make binding codegen happy
1308 virtual nsISupports
* GetParentObject();
1311 class TestChildInterface
: public TestParentInterface
1316 } // namespace mozilla
1318 #endif /* TestBindingHeader_h */