script_bindings/home/runner/work/servo/servo/target/debug/build/script_bindings-d55f55d5af1efaee/out/Bindings/
BluetoothRemoteGATTServiceBinding.rs

1/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */
2
3#![allow(non_camel_case_types,non_upper_case_globals,unsafe_op_in_unsafe_fn,unused_imports,unused_variables,unused_assignments,unused_mut,clippy::approx_constant,clippy::enum_variant_names,clippy::let_unit_value,clippy::needless_return,clippy::too_many_arguments,clippy::unnecessary_cast,clippy::upper_case_acronyms)]
4
5use crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull;
6use crate::codegen::GenericBindings::EventTargetBinding::EventTarget_Binding;
7use crate::import::base::*;
8
9pub use self::BluetoothRemoteGATTService_Binding::{Wrap, BluetoothRemoteGATTServiceMethods, GetProtoObject, DefineDOMInterface};
10pub mod BluetoothRemoteGATTService_Binding {
11use crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull;
12use crate::codegen::GenericBindings::EventTargetBinding::EventTarget_Binding;
13use crate::import::module::*;
14
15unsafe extern "C" fn get_device<D: DomTypes>
16(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
17    let mut result = false;
18    wrap_panic(&mut || result = (|| {
19        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
20        let this = &*(this as *const D::BluetoothRemoteGATTService);
21        let result: DomRoot<D::BluetoothDevice> = this.Device();
22
23        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
24        return true;
25    })());
26    result
27}
28
29
30static device_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
31
32pub(crate) fn init_device_getterinfo<D: DomTypes>() {
33    device_getterinfo.set(JSJitInfo {
34    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
35        getter: Some(get_device::<D>)
36    },
37    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
38        protoID: PrototypeList::ID::BluetoothRemoteGATTService as u16,
39    },
40    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
41    _bitfield_align_1: [],
42    _bitfield_1: __BindgenBitfieldUnit::new(
43        new_jsjitinfo_bitfield_1!(
44            JSJitInfo_OpType::Getter as u8,
45            JSJitInfo_AliasSet::AliasNone as u8,
46            JSValueType::JSVAL_TYPE_OBJECT as u8,
47            true,
48            true,
49            false,
50            false,
51            false,
52            false,
53            0,
54        ).to_ne_bytes()
55    ),
56});
57}
58unsafe extern "C" fn get_uuid<D: DomTypes>
59(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
60    let mut result = false;
61    wrap_panic(&mut || result = (|| {
62        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
63        let this = &*(this as *const D::BluetoothRemoteGATTService);
64        let result: DOMString = this.Uuid();
65
66        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
67        return true;
68    })());
69    result
70}
71
72
73static uuid_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
74
75pub(crate) fn init_uuid_getterinfo<D: DomTypes>() {
76    uuid_getterinfo.set(JSJitInfo {
77    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
78        getter: Some(get_uuid::<D>)
79    },
80    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
81        protoID: PrototypeList::ID::BluetoothRemoteGATTService as u16,
82    },
83    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
84    _bitfield_align_1: [],
85    _bitfield_1: __BindgenBitfieldUnit::new(
86        new_jsjitinfo_bitfield_1!(
87            JSJitInfo_OpType::Getter as u8,
88            JSJitInfo_AliasSet::AliasEverything as u8,
89            JSValueType::JSVAL_TYPE_STRING as u8,
90            true,
91            false,
92            false,
93            false,
94            false,
95            false,
96            0,
97        ).to_ne_bytes()
98    ),
99});
100}
101unsafe extern "C" fn get_isPrimary<D: DomTypes>
102(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
103    let mut result = false;
104    wrap_panic(&mut || result = (|| {
105        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
106        let this = &*(this as *const D::BluetoothRemoteGATTService);
107        let result: bool = this.IsPrimary();
108
109        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
110        return true;
111    })());
112    result
113}
114
115
116static isPrimary_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
117
118pub(crate) fn init_isPrimary_getterinfo<D: DomTypes>() {
119    isPrimary_getterinfo.set(JSJitInfo {
120    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
121        getter: Some(get_isPrimary::<D>)
122    },
123    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
124        protoID: PrototypeList::ID::BluetoothRemoteGATTService as u16,
125    },
126    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
127    _bitfield_align_1: [],
128    _bitfield_1: __BindgenBitfieldUnit::new(
129        new_jsjitinfo_bitfield_1!(
130            JSJitInfo_OpType::Getter as u8,
131            JSJitInfo_AliasSet::AliasEverything as u8,
132            JSValueType::JSVAL_TYPE_BOOLEAN as u8,
133            true,
134            false,
135            false,
136            false,
137            false,
138            false,
139            0,
140        ).to_ne_bytes()
141    ),
142});
143}
144unsafe extern "C" fn getCharacteristic<D: DomTypes>
145(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
146    let mut result = false;
147    wrap_panic(&mut || result = (|| {
148        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
149        let this = &*(this as *const D::BluetoothRemoteGATTService);
150        let args = &*args;
151        let argc = args.argc_;
152
153        if argc < 1 {
154            throw_type_error(cx.raw_cx(), "Not enough arguments to \"BluetoothRemoteGATTService.getCharacteristic\".");
155            return false;
156        }
157        let arg0: GenericUnionTypes::StringOrUnsignedLong = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
158            Ok(ConversionResult::Success(value)) => value,
159            Ok(ConversionResult::Failure(error)) => {
160                throw_type_error(cx.raw_cx(), &error);
161        return false;
162
163            }
164            _ => {
165                return false;
166
167            },
168        }
169        ;
170        let result: Rc<D::Promise> = this.GetCharacteristic(arg0, CanGc::note());
171
172        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
173        return true;
174    })());
175    result
176}
177
178unsafe extern "C" fn getCharacteristic_promise_wrapper<D: DomTypes>
179(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
180    let mut result = false;
181    wrap_panic(&mut || result = (|| {
182        let ok = getCharacteristic::<D>(cx, _obj, this, args);
183        if ok {
184          return true;
185        }
186        return exception_to_promise(cx, (*args).rval(), CanGc::note());
187
188    })());
189    result
190}
191
192
193static getCharacteristic_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
194
195pub(crate) fn init_getCharacteristic_methodinfo<D: DomTypes>() {
196    getCharacteristic_methodinfo.set(JSJitInfo {
197    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
198        method: Some(getCharacteristic_promise_wrapper::<D>)
199    },
200    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
201        protoID: PrototypeList::ID::BluetoothRemoteGATTService as u16,
202    },
203    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
204    _bitfield_align_1: [],
205    _bitfield_1: __BindgenBitfieldUnit::new(
206        new_jsjitinfo_bitfield_1!(
207            JSJitInfo_OpType::Method as u8,
208            JSJitInfo_AliasSet::AliasEverything as u8,
209            JSValueType::JSVAL_TYPE_OBJECT as u8,
210            false,
211            false,
212            false,
213            false,
214            false,
215            false,
216            0,
217        ).to_ne_bytes()
218    ),
219});
220}
221unsafe extern "C" fn getCharacteristics<D: DomTypes>
222(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
223    let mut result = false;
224    wrap_panic(&mut || result = (|| {
225        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
226        let this = &*(this as *const D::BluetoothRemoteGATTService);
227        let args = &*args;
228        let argc = args.argc_;
229        let arg0: Option<GenericUnionTypes::StringOrUnsignedLong> = if args.get(0).is_undefined() {
230            None
231        } else {
232            Some(match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
233                Ok(ConversionResult::Success(value)) => value,
234                Ok(ConversionResult::Failure(error)) => {
235                    throw_type_error(cx.raw_cx(), &error);
236            return false;
237
238                }
239                _ => {
240                    return false;
241
242                },
243            }
244            )
245        };
246        let result: Rc<D::Promise> = this.GetCharacteristics(arg0, CanGc::note());
247
248        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
249        return true;
250    })());
251    result
252}
253
254unsafe extern "C" fn getCharacteristics_promise_wrapper<D: DomTypes>
255(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
256    let mut result = false;
257    wrap_panic(&mut || result = (|| {
258        let ok = getCharacteristics::<D>(cx, _obj, this, args);
259        if ok {
260          return true;
261        }
262        return exception_to_promise(cx, (*args).rval(), CanGc::note());
263
264    })());
265    result
266}
267
268
269static getCharacteristics_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
270
271pub(crate) fn init_getCharacteristics_methodinfo<D: DomTypes>() {
272    getCharacteristics_methodinfo.set(JSJitInfo {
273    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
274        method: Some(getCharacteristics_promise_wrapper::<D>)
275    },
276    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
277        protoID: PrototypeList::ID::BluetoothRemoteGATTService as u16,
278    },
279    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
280    _bitfield_align_1: [],
281    _bitfield_1: __BindgenBitfieldUnit::new(
282        new_jsjitinfo_bitfield_1!(
283            JSJitInfo_OpType::Method as u8,
284            JSJitInfo_AliasSet::AliasEverything as u8,
285            JSValueType::JSVAL_TYPE_OBJECT as u8,
286            false,
287            false,
288            false,
289            false,
290            false,
291            false,
292            0,
293        ).to_ne_bytes()
294    ),
295});
296}
297unsafe extern "C" fn getIncludedService<D: DomTypes>
298(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
299    let mut result = false;
300    wrap_panic(&mut || result = (|| {
301        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
302        let this = &*(this as *const D::BluetoothRemoteGATTService);
303        let args = &*args;
304        let argc = args.argc_;
305
306        if argc < 1 {
307            throw_type_error(cx.raw_cx(), "Not enough arguments to \"BluetoothRemoteGATTService.getIncludedService\".");
308            return false;
309        }
310        let arg0: GenericUnionTypes::StringOrUnsignedLong = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
311            Ok(ConversionResult::Success(value)) => value,
312            Ok(ConversionResult::Failure(error)) => {
313                throw_type_error(cx.raw_cx(), &error);
314        return false;
315
316            }
317            _ => {
318                return false;
319
320            },
321        }
322        ;
323        let result: Rc<D::Promise> = this.GetIncludedService(arg0, CanGc::note());
324
325        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
326        return true;
327    })());
328    result
329}
330
331unsafe extern "C" fn getIncludedService_promise_wrapper<D: DomTypes>
332(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
333    let mut result = false;
334    wrap_panic(&mut || result = (|| {
335        let ok = getIncludedService::<D>(cx, _obj, this, args);
336        if ok {
337          return true;
338        }
339        return exception_to_promise(cx, (*args).rval(), CanGc::note());
340
341    })());
342    result
343}
344
345
346static getIncludedService_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
347
348pub(crate) fn init_getIncludedService_methodinfo<D: DomTypes>() {
349    getIncludedService_methodinfo.set(JSJitInfo {
350    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
351        method: Some(getIncludedService_promise_wrapper::<D>)
352    },
353    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
354        protoID: PrototypeList::ID::BluetoothRemoteGATTService as u16,
355    },
356    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
357    _bitfield_align_1: [],
358    _bitfield_1: __BindgenBitfieldUnit::new(
359        new_jsjitinfo_bitfield_1!(
360            JSJitInfo_OpType::Method as u8,
361            JSJitInfo_AliasSet::AliasEverything as u8,
362            JSValueType::JSVAL_TYPE_OBJECT as u8,
363            false,
364            false,
365            false,
366            false,
367            false,
368            false,
369            0,
370        ).to_ne_bytes()
371    ),
372});
373}
374unsafe extern "C" fn getIncludedServices<D: DomTypes>
375(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
376    let mut result = false;
377    wrap_panic(&mut || result = (|| {
378        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
379        let this = &*(this as *const D::BluetoothRemoteGATTService);
380        let args = &*args;
381        let argc = args.argc_;
382        let arg0: Option<GenericUnionTypes::StringOrUnsignedLong> = if args.get(0).is_undefined() {
383            None
384        } else {
385            Some(match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
386                Ok(ConversionResult::Success(value)) => value,
387                Ok(ConversionResult::Failure(error)) => {
388                    throw_type_error(cx.raw_cx(), &error);
389            return false;
390
391                }
392                _ => {
393                    return false;
394
395                },
396            }
397            )
398        };
399        let result: Rc<D::Promise> = this.GetIncludedServices(arg0, CanGc::note());
400
401        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
402        return true;
403    })());
404    result
405}
406
407unsafe extern "C" fn getIncludedServices_promise_wrapper<D: DomTypes>
408(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
409    let mut result = false;
410    wrap_panic(&mut || result = (|| {
411        let ok = getIncludedServices::<D>(cx, _obj, this, args);
412        if ok {
413          return true;
414        }
415        return exception_to_promise(cx, (*args).rval(), CanGc::note());
416
417    })());
418    result
419}
420
421
422static getIncludedServices_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
423
424pub(crate) fn init_getIncludedServices_methodinfo<D: DomTypes>() {
425    getIncludedServices_methodinfo.set(JSJitInfo {
426    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
427        method: Some(getIncludedServices_promise_wrapper::<D>)
428    },
429    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
430        protoID: PrototypeList::ID::BluetoothRemoteGATTService as u16,
431    },
432    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
433    _bitfield_align_1: [],
434    _bitfield_1: __BindgenBitfieldUnit::new(
435        new_jsjitinfo_bitfield_1!(
436            JSJitInfo_OpType::Method as u8,
437            JSJitInfo_AliasSet::AliasEverything as u8,
438            JSValueType::JSVAL_TYPE_OBJECT as u8,
439            false,
440            false,
441            false,
442            false,
443            false,
444            false,
445            0,
446        ).to_ne_bytes()
447    ),
448});
449}
450unsafe extern "C" fn get_onserviceadded<D: DomTypes>
451(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
452    let mut result = false;
453    wrap_panic(&mut || result = (|| {
454        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
455        let this = &*(this as *const D::BluetoothRemoteGATTService);
456        let result: Option<Rc<crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull<D>>> = this.GetOnserviceadded();
457
458        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
459        return true;
460    })());
461    result
462}
463
464unsafe extern "C" fn set_onserviceadded<D: DomTypes>
465(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
466    let mut result = false;
467    wrap_panic(&mut || result = {
468        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
469        let this = &*(this as *const D::BluetoothRemoteGATTService);
470        let arg0: Option<Rc<EventHandlerNonNull<D>>> = if HandleValue::from_raw(args.get(0)).get().is_object() {
471            Some(EventHandlerNonNull::<D>::new(SafeJSContext::from_ptr(cx.raw_cx()), HandleValue::from_raw(args.get(0)).get().to_object()))
472        } else {
473            None
474        };
475        let result: () = this.SetOnserviceadded(arg0);
476
477        true
478    });
479    result
480}
481
482
483static onserviceadded_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
484
485pub(crate) fn init_onserviceadded_getterinfo<D: DomTypes>() {
486    onserviceadded_getterinfo.set(JSJitInfo {
487    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
488        getter: Some(get_onserviceadded::<D>)
489    },
490    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
491        protoID: PrototypeList::ID::BluetoothRemoteGATTService as u16,
492    },
493    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
494    _bitfield_align_1: [],
495    _bitfield_1: __BindgenBitfieldUnit::new(
496        new_jsjitinfo_bitfield_1!(
497            JSJitInfo_OpType::Getter as u8,
498            JSJitInfo_AliasSet::AliasEverything as u8,
499            JSValueType::JSVAL_TYPE_UNKNOWN as u8,
500            true,
501            false,
502            false,
503            false,
504            false,
505            false,
506            0,
507        ).to_ne_bytes()
508    ),
509});
510}
511static onserviceadded_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
512
513pub(crate) fn init_onserviceadded_setterinfo<D: DomTypes>() {
514    onserviceadded_setterinfo.set(JSJitInfo {
515    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
516        setter: Some(set_onserviceadded::<D>)
517    },
518    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
519        protoID: PrototypeList::ID::BluetoothRemoteGATTService as u16,
520    },
521    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
522    _bitfield_align_1: [],
523    _bitfield_1: __BindgenBitfieldUnit::new(
524        new_jsjitinfo_bitfield_1!(
525            JSJitInfo_OpType::Setter as u8,
526            JSJitInfo_AliasSet::AliasEverything as u8,
527            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
528            false,
529            false,
530            false,
531            false,
532            false,
533            false,
534            0,
535        ).to_ne_bytes()
536    ),
537});
538}
539unsafe extern "C" fn get_onservicechanged<D: DomTypes>
540(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
541    let mut result = false;
542    wrap_panic(&mut || result = (|| {
543        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
544        let this = &*(this as *const D::BluetoothRemoteGATTService);
545        let result: Option<Rc<crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull<D>>> = this.GetOnservicechanged();
546
547        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
548        return true;
549    })());
550    result
551}
552
553unsafe extern "C" fn set_onservicechanged<D: DomTypes>
554(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
555    let mut result = false;
556    wrap_panic(&mut || result = {
557        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
558        let this = &*(this as *const D::BluetoothRemoteGATTService);
559        let arg0: Option<Rc<EventHandlerNonNull<D>>> = if HandleValue::from_raw(args.get(0)).get().is_object() {
560            Some(EventHandlerNonNull::<D>::new(SafeJSContext::from_ptr(cx.raw_cx()), HandleValue::from_raw(args.get(0)).get().to_object()))
561        } else {
562            None
563        };
564        let result: () = this.SetOnservicechanged(arg0);
565
566        true
567    });
568    result
569}
570
571
572static onservicechanged_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
573
574pub(crate) fn init_onservicechanged_getterinfo<D: DomTypes>() {
575    onservicechanged_getterinfo.set(JSJitInfo {
576    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
577        getter: Some(get_onservicechanged::<D>)
578    },
579    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
580        protoID: PrototypeList::ID::BluetoothRemoteGATTService as u16,
581    },
582    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
583    _bitfield_align_1: [],
584    _bitfield_1: __BindgenBitfieldUnit::new(
585        new_jsjitinfo_bitfield_1!(
586            JSJitInfo_OpType::Getter as u8,
587            JSJitInfo_AliasSet::AliasEverything as u8,
588            JSValueType::JSVAL_TYPE_UNKNOWN as u8,
589            true,
590            false,
591            false,
592            false,
593            false,
594            false,
595            0,
596        ).to_ne_bytes()
597    ),
598});
599}
600static onservicechanged_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
601
602pub(crate) fn init_onservicechanged_setterinfo<D: DomTypes>() {
603    onservicechanged_setterinfo.set(JSJitInfo {
604    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
605        setter: Some(set_onservicechanged::<D>)
606    },
607    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
608        protoID: PrototypeList::ID::BluetoothRemoteGATTService as u16,
609    },
610    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
611    _bitfield_align_1: [],
612    _bitfield_1: __BindgenBitfieldUnit::new(
613        new_jsjitinfo_bitfield_1!(
614            JSJitInfo_OpType::Setter as u8,
615            JSJitInfo_AliasSet::AliasEverything as u8,
616            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
617            false,
618            false,
619            false,
620            false,
621            false,
622            false,
623            0,
624        ).to_ne_bytes()
625    ),
626});
627}
628unsafe extern "C" fn get_onserviceremoved<D: DomTypes>
629(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
630    let mut result = false;
631    wrap_panic(&mut || result = (|| {
632        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
633        let this = &*(this as *const D::BluetoothRemoteGATTService);
634        let result: Option<Rc<crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull<D>>> = this.GetOnserviceremoved();
635
636        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
637        return true;
638    })());
639    result
640}
641
642unsafe extern "C" fn set_onserviceremoved<D: DomTypes>
643(cx: *mut RawJSContext, obj: RawHandleObject, this: *mut libc::c_void, args: JSJitSetterCallArgs) -> bool{
644    let mut result = false;
645    wrap_panic(&mut || result = {
646        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
647        let this = &*(this as *const D::BluetoothRemoteGATTService);
648        let arg0: Option<Rc<EventHandlerNonNull<D>>> = if HandleValue::from_raw(args.get(0)).get().is_object() {
649            Some(EventHandlerNonNull::<D>::new(SafeJSContext::from_ptr(cx.raw_cx()), HandleValue::from_raw(args.get(0)).get().to_object()))
650        } else {
651            None
652        };
653        let result: () = this.SetOnserviceremoved(arg0);
654
655        true
656    });
657    result
658}
659
660
661static onserviceremoved_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
662
663pub(crate) fn init_onserviceremoved_getterinfo<D: DomTypes>() {
664    onserviceremoved_getterinfo.set(JSJitInfo {
665    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
666        getter: Some(get_onserviceremoved::<D>)
667    },
668    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
669        protoID: PrototypeList::ID::BluetoothRemoteGATTService as u16,
670    },
671    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
672    _bitfield_align_1: [],
673    _bitfield_1: __BindgenBitfieldUnit::new(
674        new_jsjitinfo_bitfield_1!(
675            JSJitInfo_OpType::Getter as u8,
676            JSJitInfo_AliasSet::AliasEverything as u8,
677            JSValueType::JSVAL_TYPE_UNKNOWN as u8,
678            true,
679            false,
680            false,
681            false,
682            false,
683            false,
684            0,
685        ).to_ne_bytes()
686    ),
687});
688}
689static onserviceremoved_setterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
690
691pub(crate) fn init_onserviceremoved_setterinfo<D: DomTypes>() {
692    onserviceremoved_setterinfo.set(JSJitInfo {
693    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
694        setter: Some(set_onserviceremoved::<D>)
695    },
696    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
697        protoID: PrototypeList::ID::BluetoothRemoteGATTService as u16,
698    },
699    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 1 },
700    _bitfield_align_1: [],
701    _bitfield_1: __BindgenBitfieldUnit::new(
702        new_jsjitinfo_bitfield_1!(
703            JSJitInfo_OpType::Setter as u8,
704            JSJitInfo_AliasSet::AliasEverything as u8,
705            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
706            false,
707            false,
708            false,
709            false,
710            false,
711            false,
712            0,
713        ).to_ne_bytes()
714    ),
715});
716}
717unsafe extern "C" fn _finalize<D: DomTypes>
718(_cx: *mut GCContext, obj: *mut JSObject){
719    wrap_panic(&mut || {
720
721        let this = native_from_object_static::<D::BluetoothRemoteGATTService>(obj).unwrap();
722        finalize_common(this);
723    })
724}
725
726unsafe extern "C" fn _trace<D: DomTypes>
727(trc: *mut JSTracer, obj: *mut JSObject){
728    wrap_panic(&mut || {
729
730        let this = native_from_object_static::<D::BluetoothRemoteGATTService>(obj).unwrap();
731        if this.is_null() { return; } // GC during obj creation
732        (*this).trace(trc);
733    })
734}
735
736
737static CLASS_OPS: ThreadUnsafeOnceLock<JSClassOps> = ThreadUnsafeOnceLock::new();
738
739pub(crate) fn init_class_ops<D: DomTypes>() {
740    CLASS_OPS.set(JSClassOps {
741        addProperty: None,
742        delProperty: None,
743        enumerate: None,
744        newEnumerate: None,
745        resolve: None,
746        mayResolve: None,
747        finalize: Some(_finalize::<D>),
748        call: None,
749        construct: None,
750        trace: Some(_trace::<D>),
751    });
752}
753
754pub static Class: ThreadUnsafeOnceLock<DOMJSClass> = ThreadUnsafeOnceLock::new();
755
756pub(crate) fn init_domjs_class<D: DomTypes>() {
757    init_class_ops::<D>();
758    Class.set(DOMJSClass {
759        base: JSClass {
760            name: c"BluetoothRemoteGATTService".as_ptr(),
761            flags: JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE |
762                   (((1) & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT)
763                   /* JSCLASS_HAS_RESERVED_SLOTS(1) */,
764            cOps: unsafe { CLASS_OPS.get() },
765            spec: ptr::null(),
766            ext: ptr::null(),
767            oOps: ptr::null(),
768        },
769        dom_class:
770DOMClass {
771    interface_chain: [ PrototypeList::ID::EventTarget, PrototypeList::ID::BluetoothRemoteGATTService, PrototypeList::ID::Last, PrototypeList::ID::Last, PrototypeList::ID::Last, PrototypeList::ID::Last ],
772    depth: 1,
773    type_id: crate::codegen::InheritTypes::TopTypeId { eventtarget: (crate::codegen::InheritTypes::EventTargetTypeId::BluetoothRemoteGATTService) },
774    malloc_size_of: malloc_size_of_including_raw_self::<D::BluetoothRemoteGATTService> as unsafe fn(&mut _, _) -> _,
775    global: Globals::EMPTY,
776},
777    });
778}
779
780#[cfg_attr(crown, allow(crown::unrooted_must_root))] pub unsafe fn Wrap<D: DomTypes>
781(cx: SafeJSContext, scope: &D::GlobalScope, given_proto: Option<HandleObject>, object: Box<D::BluetoothRemoteGATTService>, _can_gc: CanGc) -> DomRoot<D::BluetoothRemoteGATTService>{
782
783    let raw = Root::new(MaybeUnreflectedDom::from_box(object));
784
785    let scope = scope.reflector().get_jsobject();
786    assert!(!scope.get().is_null());
787    assert!(((*get_object_class(scope.get())).flags & JSCLASS_IS_GLOBAL) != 0);
788    let _ac = JSAutoRealm::new(cx.raw_cx(), scope.get());
789
790    rooted!(&in(cx) let mut canonical_proto = ptr::null_mut::<JSObject>());
791    GetProtoObject::<D>(cx, scope, canonical_proto.handle_mut());
792    assert!(!canonical_proto.is_null());
793
794
795    rooted!(&in(cx) let mut proto = ptr::null_mut::<JSObject>());
796    if let Some(given) = given_proto {
797        proto.set(*given);
798        if get_context_realm(cx.raw_cx()) != get_object_realm(*given) {
799            assert!(JS_WrapObject(cx.raw_cx(), proto.handle_mut()));
800        }
801    } else {
802        proto.set(*canonical_proto);
803    }
804    rooted!(&in(cx) let obj = JS_NewObjectWithGivenProto(
805        cx.raw_cx(),
806        &Class.get().base,
807        proto.handle(),
808    ));
809    assert!(!obj.is_null());
810    JS_SetReservedSlot(
811        obj.get(),
812        DOM_OBJECT_SLOT,
813        &PrivateValue(raw.as_ptr() as *const libc::c_void),
814    );
815
816    let root = raw.reflect_with(obj.get());
817
818
819
820    DomRoot::from_ref(&*root)
821}
822
823pub trait BluetoothRemoteGATTServiceMethods<D: DomTypes> {
824    fn Device(&self, ) -> DomRoot<D::BluetoothDevice>;
825    fn Uuid(&self, ) -> DOMString;
826    fn IsPrimary(&self, ) -> bool;
827    fn GetCharacteristic(&self, r#characteristic: GenericUnionTypes::StringOrUnsignedLong, r#_can_gc: CanGc) -> Rc<D::Promise>;
828    fn GetCharacteristics(&self, r#characteristic: Option<GenericUnionTypes::StringOrUnsignedLong>, r#_can_gc: CanGc) -> Rc<D::Promise>;
829    fn GetIncludedService(&self, r#service: GenericUnionTypes::StringOrUnsignedLong, r#_can_gc: CanGc) -> Rc<D::Promise>;
830    fn GetIncludedServices(&self, r#service: Option<GenericUnionTypes::StringOrUnsignedLong>, r#_can_gc: CanGc) -> Rc<D::Promise>;
831    fn GetOnserviceadded(&self, ) -> Option<Rc<crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull<D>>>;
832    fn SetOnserviceadded(&self, r#value: Option<Rc<EventHandlerNonNull<D>>>);
833    fn GetOnservicechanged(&self, ) -> Option<Rc<crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull<D>>>;
834    fn SetOnservicechanged(&self, r#value: Option<Rc<EventHandlerNonNull<D>>>);
835    fn GetOnserviceremoved(&self, ) -> Option<Rc<crate::codegen::GenericBindings::EventHandlerBinding::EventHandlerNonNull<D>>>;
836    fn SetOnserviceremoved(&self, r#value: Option<Rc<EventHandlerNonNull<D>>>);
837}
838static sMethods_specs: ThreadUnsafeOnceLock<&[&[JSFunctionSpec]]> = ThreadUnsafeOnceLock::new();
839
840pub(crate) fn init_sMethods_specs<D: DomTypes>() {
841    sMethods_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
842    JSFunctionSpec {
843        name: JSPropertySpec_Name { string_: c"getCharacteristic".as_ptr() },
844        call: JSNativeWrapper { op: Some(generic_method::<true>), info: unsafe { getCharacteristic_methodinfo.get() } as *const _ as *const JSJitInfo },
845        nargs: 1,
846        flags: (JSPROP_ENUMERATE) as u16,
847        selfHostedName: ptr::null()
848    },
849    JSFunctionSpec {
850        name: JSPropertySpec_Name { string_: c"getCharacteristics".as_ptr() },
851        call: JSNativeWrapper { op: Some(generic_method::<true>), info: unsafe { getCharacteristics_methodinfo.get() } as *const _ as *const JSJitInfo },
852        nargs: 0,
853        flags: (JSPROP_ENUMERATE) as u16,
854        selfHostedName: ptr::null()
855    },
856    JSFunctionSpec {
857        name: JSPropertySpec_Name { string_: c"getIncludedService".as_ptr() },
858        call: JSNativeWrapper { op: Some(generic_method::<true>), info: unsafe { getIncludedService_methodinfo.get() } as *const _ as *const JSJitInfo },
859        nargs: 1,
860        flags: (JSPROP_ENUMERATE) as u16,
861        selfHostedName: ptr::null()
862    },
863    JSFunctionSpec {
864        name: JSPropertySpec_Name { string_: c"getIncludedServices".as_ptr() },
865        call: JSNativeWrapper { op: Some(generic_method::<true>), info: unsafe { getIncludedServices_methodinfo.get() } as *const _ as *const JSJitInfo },
866        nargs: 0,
867        flags: (JSPROP_ENUMERATE) as u16,
868        selfHostedName: ptr::null()
869    },
870    JSFunctionSpec {
871        name: JSPropertySpec_Name { string_: ptr::null() },
872        call: JSNativeWrapper { op: None, info: ptr::null() },
873        nargs: 0,
874        flags: 0,
875        selfHostedName: ptr::null()
876    }]))[..]
877])));
878}static sMethods: ThreadUnsafeOnceLock<&[Guard<&[JSFunctionSpec]>]> = ThreadUnsafeOnceLock::new();
879
880pub(crate) fn init_sMethods_prefs<D: DomTypes>() {
881    sMethods.set(Box::leak(Box::new([    Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sMethods_specs.get() })[0])])));
882}static sAttributes_specs: ThreadUnsafeOnceLock<&[&[JSPropertySpec]]> = ThreadUnsafeOnceLock::new();
883
884pub(crate) fn init_sAttributes_specs<D: DomTypes>() {
885    sAttributes_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
886    JSPropertySpec {
887                    name: JSPropertySpec_Name { string_: c"device".as_ptr() },
888                    attributes_: (JSPROP_ENUMERATE),
889                    kind_: (JSPropertySpec_Kind::NativeAccessor),
890                    u: JSPropertySpec_AccessorsOrValue {
891                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
892                            getter: JSPropertySpec_Accessor {
893                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { device_getterinfo.get() } },
894                            },
895                            setter: JSPropertySpec_Accessor {
896                                native: JSNativeWrapper { op: None, info: ptr::null() },
897                            }
898                        }
899                    }
900                }
901,
902    JSPropertySpec {
903                    name: JSPropertySpec_Name { string_: c"uuid".as_ptr() },
904                    attributes_: (JSPROP_ENUMERATE),
905                    kind_: (JSPropertySpec_Kind::NativeAccessor),
906                    u: JSPropertySpec_AccessorsOrValue {
907                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
908                            getter: JSPropertySpec_Accessor {
909                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { uuid_getterinfo.get() } },
910                            },
911                            setter: JSPropertySpec_Accessor {
912                                native: JSNativeWrapper { op: None, info: ptr::null() },
913                            }
914                        }
915                    }
916                }
917,
918    JSPropertySpec {
919                    name: JSPropertySpec_Name { string_: c"isPrimary".as_ptr() },
920                    attributes_: (JSPROP_ENUMERATE),
921                    kind_: (JSPropertySpec_Kind::NativeAccessor),
922                    u: JSPropertySpec_AccessorsOrValue {
923                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
924                            getter: JSPropertySpec_Accessor {
925                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { isPrimary_getterinfo.get() } },
926                            },
927                            setter: JSPropertySpec_Accessor {
928                                native: JSNativeWrapper { op: None, info: ptr::null() },
929                            }
930                        }
931                    }
932                }
933,
934    JSPropertySpec {
935                    name: JSPropertySpec_Name { string_: c"onserviceadded".as_ptr() },
936                    attributes_: (JSPROP_ENUMERATE),
937                    kind_: (JSPropertySpec_Kind::NativeAccessor),
938                    u: JSPropertySpec_AccessorsOrValue {
939                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
940                            getter: JSPropertySpec_Accessor {
941                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { onserviceadded_getterinfo.get() } },
942                            },
943                            setter: JSPropertySpec_Accessor {
944                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { onserviceadded_setterinfo.get() } },
945                            }
946                        }
947                    }
948                }
949,
950    JSPropertySpec {
951                    name: JSPropertySpec_Name { string_: c"onservicechanged".as_ptr() },
952                    attributes_: (JSPROP_ENUMERATE),
953                    kind_: (JSPropertySpec_Kind::NativeAccessor),
954                    u: JSPropertySpec_AccessorsOrValue {
955                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
956                            getter: JSPropertySpec_Accessor {
957                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { onservicechanged_getterinfo.get() } },
958                            },
959                            setter: JSPropertySpec_Accessor {
960                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { onservicechanged_setterinfo.get() } },
961                            }
962                        }
963                    }
964                }
965,
966    JSPropertySpec {
967                    name: JSPropertySpec_Name { string_: c"onserviceremoved".as_ptr() },
968                    attributes_: (JSPROP_ENUMERATE),
969                    kind_: (JSPropertySpec_Kind::NativeAccessor),
970                    u: JSPropertySpec_AccessorsOrValue {
971                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
972                            getter: JSPropertySpec_Accessor {
973                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { onserviceremoved_getterinfo.get() } },
974                            },
975                            setter: JSPropertySpec_Accessor {
976                                native: JSNativeWrapper { op: Some(generic_setter), info: unsafe { onserviceremoved_setterinfo.get() } },
977                            }
978                        }
979                    }
980                }
981,
982    JSPropertySpec::ZERO]))[..]
983,
984&Box::leak(Box::new([
985    JSPropertySpec {
986                    name: JSPropertySpec_Name { symbol_: SymbolCode::toStringTag as usize + 1 },
987                    attributes_: (JSPROP_READONLY),
988                    kind_: (JSPropertySpec_Kind::Value),
989                    u: JSPropertySpec_AccessorsOrValue {
990                        value: JSPropertySpec_ValueWrapper {
991                            type_: JSPropertySpec_ValueWrapper_Type::String,
992                            __bindgen_anon_1: JSPropertySpec_ValueWrapper__bindgen_ty_1 {
993                                string: c"BluetoothRemoteGATTService".as_ptr(),
994                            }
995                        }
996                    }
997                }
998,
999    JSPropertySpec::ZERO]))[..]
1000])));
1001}static sAttributes: ThreadUnsafeOnceLock<&[Guard<&[JSPropertySpec]>]> = ThreadUnsafeOnceLock::new();
1002
1003pub(crate) fn init_sAttributes_prefs<D: DomTypes>() {
1004    sAttributes.set(Box::leak(Box::new([    Guard::new(&[Condition::Exposed(Globals::WINDOW)], (unsafe { sAttributes_specs.get() })[0]),
1005    Guard::new(&[Condition::Satisfied], (unsafe { sAttributes_specs.get() })[1])])));
1006}
1007pub fn GetProtoObject<D: DomTypes>
1008(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
1009    /* Get the interface prototype object for this class.  This will create the
1010       object as needed. */get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::BluetoothRemoteGATTService), CreateInterfaceObjects::<D>, rval)
1011}
1012
1013
1014static PrototypeClass: JSClass = JSClass {
1015    name: c"BluetoothRemoteGATTServicePrototype".as_ptr(),
1016    flags:
1017        // JSCLASS_HAS_RESERVED_SLOTS()
1018        (0 ) << JSCLASS_RESERVED_SLOTS_SHIFT,
1019    cOps: ptr::null(),
1020    spec: ptr::null(),
1021    ext: ptr::null(),
1022    oOps: ptr::null(),
1023};
1024
1025
1026static INTERFACE_OBJECT_CLASS: ThreadUnsafeOnceLock<NonCallbackInterfaceObjectClass> = ThreadUnsafeOnceLock::new();
1027
1028pub(crate) fn init_interface_object<D: DomTypes>() {
1029    INTERFACE_OBJECT_CLASS.set(NonCallbackInterfaceObjectClass::new(
1030        Box::leak(Box::new(InterfaceConstructorBehavior::throw())),
1031        b"function BluetoothRemoteGATTService() {\n    [native code]\n}",
1032        PrototypeList::ID::BluetoothRemoteGATTService,
1033        1,
1034    ));
1035}
1036
1037pub fn DefineDOMInterface<D: DomTypes>
1038(cx: SafeJSContext, global: HandleObject){
1039    define_dom_interface(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::BluetoothRemoteGATTService),CreateInterfaceObjects::<D>, ConstructorEnabled::<D>)
1040}
1041
1042pub fn ConstructorEnabled<D: DomTypes>
1043(aCx: SafeJSContext, aObj: HandleObject) -> bool{
1044    is_exposed_in(aObj, Globals::WINDOW) &&
1045    pref!(dom_bluetooth_enabled)
1046}
1047
1048unsafe fn CreateInterfaceObjects<D: DomTypes>
1049(cx: SafeJSContext, global: HandleObject, cache: *mut ProtoOrIfaceArray){
1050
1051    rooted!(&in(cx) let mut prototype_proto = ptr::null_mut::<JSObject>());
1052    EventTarget_Binding::GetProtoObject::<D>(cx, global, prototype_proto.handle_mut());
1053    assert!(!prototype_proto.is_null());
1054
1055    rooted!(&in(cx) let mut prototype = ptr::null_mut::<JSObject>());
1056    create_interface_prototype_object::<D>(cx,
1057                                      global,
1058                                      prototype_proto.handle(),
1059                                      &PrototypeClass,
1060                                      sMethods.get(),
1061                                      sAttributes.get(),
1062                                      &[],
1063                                      &[],
1064                                      prototype.handle_mut());
1065    assert!(!prototype.is_null());
1066    assert!((*cache)[PrototypeList::ID::BluetoothRemoteGATTService as usize].is_null());
1067    (*cache)[PrototypeList::ID::BluetoothRemoteGATTService as usize] = prototype.get();
1068    <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::ID::BluetoothRemoteGATTService as isize),
1069                                  ptr::null_mut(),
1070                                  prototype.get());
1071
1072    rooted!(&in(cx) let mut interface_proto = ptr::null_mut::<JSObject>());
1073
1074    EventTarget_Binding::GetConstructorObject::<D>(cx, global, interface_proto.handle_mut());
1075
1076    assert!(!interface_proto.is_null());
1077
1078    rooted!(&in(cx) let mut interface = ptr::null_mut::<JSObject>());
1079    create_noncallback_interface_object::<D>(cx,
1080                                        global,
1081                                        interface_proto.handle(),
1082                                        INTERFACE_OBJECT_CLASS.get(),
1083                                        &[],
1084                                        &[],
1085                                        &[],
1086                                        prototype.handle(),
1087                                        c"BluetoothRemoteGATTService",
1088                                        0,
1089                                        &[],
1090                                        interface.handle_mut());
1091    assert!(!interface.is_null());
1092}
1093
1094
1095        pub(crate) fn init_statics<D: DomTypes>() {
1096            init_interface_object::<D>();
1097            init_domjs_class::<D>();
1098            crate::codegen::GenericBindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTService_Binding::init_getCharacteristic_methodinfo::<D>();
1099crate::codegen::GenericBindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTService_Binding::init_getCharacteristics_methodinfo::<D>();
1100crate::codegen::GenericBindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTService_Binding::init_getIncludedService_methodinfo::<D>();
1101crate::codegen::GenericBindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTService_Binding::init_getIncludedServices_methodinfo::<D>();
1102            init_device_getterinfo::<D>();
1103init_uuid_getterinfo::<D>();
1104init_isPrimary_getterinfo::<D>();
1105init_onserviceadded_getterinfo::<D>();
1106init_onservicechanged_getterinfo::<D>();
1107init_onserviceremoved_getterinfo::<D>();
1108            init_onserviceadded_setterinfo::<D>();
1109init_onservicechanged_setterinfo::<D>();
1110init_onserviceremoved_setterinfo::<D>();
1111
1112            init_sMethods_specs::<D>();
1113init_sMethods_prefs::<D>();
1114init_sAttributes_specs::<D>();
1115init_sAttributes_prefs::<D>();
1116        }
1117        } // mod BluetoothRemoteGATTService_Binding
1118
1119