script_bindings/home/runner/work/servo/servo/target/debug/build/script_bindings-d55f55d5af1efaee/out/Bindings/
GPUCanvasContextBinding.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::ElementBinding::Element_Binding;
6use crate::codegen::GenericBindings::EventTargetBinding::EventTarget_Binding;
7use crate::codegen::GenericBindings::HTMLElementBinding::HTMLElement_Binding;
8use crate::codegen::GenericBindings::NodeBinding::Node_Binding;
9use crate::codegen::GenericBindings::WebGPUBinding::GPUCanvasAlphaMode;
10use crate::codegen::GenericBindings::WebGPUBinding::GPUCanvasAlphaModeValues;
11use crate::codegen::GenericBindings::WebGPUBinding::GPUCanvasConfiguration;
12use crate::codegen::GenericBindings::WebGPUBinding::GPUTextureFormat;
13use crate::codegen::GenericBindings::WebGPUBinding::GPUTextureFormatValues;
14use crate::import::base::*;
15
16pub use self::GPUCanvasContext_Binding::{Wrap, GPUCanvasContextMethods, GetProtoObject, DefineDOMInterface};
17pub mod GPUCanvasContext_Binding {
18use crate::codegen::GenericBindings::ElementBinding::Element_Binding;
19use crate::codegen::GenericBindings::EventTargetBinding::EventTarget_Binding;
20use crate::codegen::GenericBindings::HTMLElementBinding::HTMLElement_Binding;
21use crate::codegen::GenericBindings::NodeBinding::Node_Binding;
22use crate::codegen::GenericBindings::WebGPUBinding::GPUCanvasAlphaMode;
23use crate::codegen::GenericBindings::WebGPUBinding::GPUCanvasAlphaModeValues;
24use crate::codegen::GenericBindings::WebGPUBinding::GPUCanvasConfiguration;
25use crate::codegen::GenericBindings::WebGPUBinding::GPUTextureFormat;
26use crate::codegen::GenericBindings::WebGPUBinding::GPUTextureFormatValues;
27use crate::import::module::*;
28
29unsafe extern "C" fn get_canvas<D: DomTypes>
30(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: JSJitGetterCallArgs) -> bool{
31    let mut result = false;
32    wrap_panic(&mut || result = (|| {
33        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
34        let this = &*(this as *const D::GPUCanvasContext);
35        let result: GenericUnionTypes::HTMLCanvasElementOrOffscreenCanvas::<D> = this.Canvas();
36
37        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
38        return true;
39    })());
40    result
41}
42
43
44static canvas_getterinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
45
46pub(crate) fn init_canvas_getterinfo<D: DomTypes>() {
47    canvas_getterinfo.set(JSJitInfo {
48    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
49        getter: Some(get_canvas::<D>)
50    },
51    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
52        protoID: PrototypeList::ID::GPUCanvasContext as u16,
53    },
54    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 0 },
55    _bitfield_align_1: [],
56    _bitfield_1: __BindgenBitfieldUnit::new(
57        new_jsjitinfo_bitfield_1!(
58            JSJitInfo_OpType::Getter as u8,
59            JSJitInfo_AliasSet::AliasEverything as u8,
60            JSValueType::JSVAL_TYPE_OBJECT as u8,
61            true,
62            false,
63            false,
64            false,
65            false,
66            false,
67            0,
68        ).to_ne_bytes()
69    ),
70});
71}
72unsafe extern "C" fn configure<D: DomTypes>
73(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
74    let mut result = false;
75    wrap_panic(&mut || result = (|| {
76        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
77        let this = &*(this as *const D::GPUCanvasContext);
78        let args = &*args;
79        let argc = args.argc_;
80
81        if argc < 1 {
82            throw_type_error(cx.raw_cx(), "Not enough arguments to \"GPUCanvasContext.configure\".");
83            return false;
84        }
85        let arg0: crate::codegen::GenericBindings::WebGPUBinding::GPUCanvasConfiguration<D> = match FromJSValConvertible::from_jsval(cx.raw_cx(), HandleValue::from_raw(args.get(0)), ()) {
86            Ok(ConversionResult::Success(value)) => value,
87            Ok(ConversionResult::Failure(error)) => {
88                throw_type_error(cx.raw_cx(), &error);
89        return false;
90
91            }
92            _ => {
93                return false;
94
95            },
96        }
97        ;
98        let result: Result<(), Error> = this.Configure(&arg0);
99        let result = match result {
100            Ok(result) => result,
101            Err(e) => {
102                <D as DomHelpers<D>>::throw_dom_exception(SafeJSContext::from_ptr(cx.raw_cx()), &this.global_(InRealm::already(&AlreadyInRealm::assert_for_cx(SafeJSContext::from_ptr(cx.raw_cx())))), e, CanGc::note());
103                return false;
104            },
105        };
106
107        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
108        return true;
109    })());
110    result
111}
112
113
114static configure_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
115
116pub(crate) fn init_configure_methodinfo<D: DomTypes>() {
117    configure_methodinfo.set(JSJitInfo {
118    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
119        method: Some(configure::<D>)
120    },
121    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
122        protoID: PrototypeList::ID::GPUCanvasContext as u16,
123    },
124    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 0 },
125    _bitfield_align_1: [],
126    _bitfield_1: __BindgenBitfieldUnit::new(
127        new_jsjitinfo_bitfield_1!(
128            JSJitInfo_OpType::Method as u8,
129            JSJitInfo_AliasSet::AliasEverything as u8,
130            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
131            false,
132            false,
133            false,
134            false,
135            false,
136            false,
137            0,
138        ).to_ne_bytes()
139    ),
140});
141}
142unsafe extern "C" fn unconfigure<D: DomTypes>
143(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
144    let mut result = false;
145    wrap_panic(&mut || result = (|| {
146        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
147        let this = &*(this as *const D::GPUCanvasContext);
148        let args = &*args;
149        let argc = args.argc_;
150        let result: () = this.Unconfigure();
151
152        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
153        return true;
154    })());
155    result
156}
157
158
159static unconfigure_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
160
161pub(crate) fn init_unconfigure_methodinfo<D: DomTypes>() {
162    unconfigure_methodinfo.set(JSJitInfo {
163    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
164        method: Some(unconfigure::<D>)
165    },
166    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
167        protoID: PrototypeList::ID::GPUCanvasContext as u16,
168    },
169    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 0 },
170    _bitfield_align_1: [],
171    _bitfield_1: __BindgenBitfieldUnit::new(
172        new_jsjitinfo_bitfield_1!(
173            JSJitInfo_OpType::Method as u8,
174            JSJitInfo_AliasSet::AliasEverything as u8,
175            JSValueType::JSVAL_TYPE_UNDEFINED as u8,
176            true,
177            false,
178            false,
179            false,
180            false,
181            false,
182            0,
183        ).to_ne_bytes()
184    ),
185});
186}
187unsafe extern "C" fn getCurrentTexture<D: DomTypes>
188(cx: *mut RawJSContext, _obj: RawHandleObject, this: *mut libc::c_void, args: *const JSJitMethodCallArgs) -> bool{
189    let mut result = false;
190    wrap_panic(&mut || result = (|| {
191        let mut cx = JSContext::from_ptr(ptr::NonNull::new(cx).unwrap());
192        let this = &*(this as *const D::GPUCanvasContext);
193        let args = &*args;
194        let argc = args.argc_;
195        let result: Result<DomRoot<D::GPUTexture>, Error> = this.GetCurrentTexture();
196        let result = match result {
197            Ok(result) => result,
198            Err(e) => {
199                <D as DomHelpers<D>>::throw_dom_exception(SafeJSContext::from_ptr(cx.raw_cx()), &this.global_(InRealm::already(&AlreadyInRealm::assert_for_cx(SafeJSContext::from_ptr(cx.raw_cx())))), e, CanGc::note());
200                return false;
201            },
202        };
203
204        (result).to_jsval(cx.raw_cx(), MutableHandleValue::from_raw(args.rval()));
205        return true;
206    })());
207    result
208}
209
210
211static getCurrentTexture_methodinfo: ThreadUnsafeOnceLock<JSJitInfo> = ThreadUnsafeOnceLock::new();
212
213pub(crate) fn init_getCurrentTexture_methodinfo<D: DomTypes>() {
214    getCurrentTexture_methodinfo.set(JSJitInfo {
215    __bindgen_anon_1: JSJitInfo__bindgen_ty_1 {
216        method: Some(getCurrentTexture::<D>)
217    },
218    __bindgen_anon_2: JSJitInfo__bindgen_ty_2 {
219        protoID: PrototypeList::ID::GPUCanvasContext as u16,
220    },
221    __bindgen_anon_3: JSJitInfo__bindgen_ty_3 { depth: 0 },
222    _bitfield_align_1: [],
223    _bitfield_1: __BindgenBitfieldUnit::new(
224        new_jsjitinfo_bitfield_1!(
225            JSJitInfo_OpType::Method as u8,
226            JSJitInfo_AliasSet::AliasEverything as u8,
227            JSValueType::JSVAL_TYPE_OBJECT as u8,
228            false,
229            false,
230            false,
231            false,
232            false,
233            false,
234            0,
235        ).to_ne_bytes()
236    ),
237});
238}
239unsafe extern "C" fn _finalize<D: DomTypes>
240(_cx: *mut GCContext, obj: *mut JSObject){
241    wrap_panic(&mut || {
242
243        let this = native_from_object_static::<D::GPUCanvasContext>(obj).unwrap();
244        finalize_weak_referenceable(obj, this);
245    })
246}
247
248unsafe extern "C" fn _trace<D: DomTypes>
249(trc: *mut JSTracer, obj: *mut JSObject){
250    wrap_panic(&mut || {
251
252        let this = native_from_object_static::<D::GPUCanvasContext>(obj).unwrap();
253        if this.is_null() { return; } // GC during obj creation
254        (*this).trace(trc);
255    })
256}
257
258
259static CLASS_OPS: ThreadUnsafeOnceLock<JSClassOps> = ThreadUnsafeOnceLock::new();
260
261pub(crate) fn init_class_ops<D: DomTypes>() {
262    CLASS_OPS.set(JSClassOps {
263        addProperty: None,
264        delProperty: None,
265        enumerate: None,
266        newEnumerate: None,
267        resolve: None,
268        mayResolve: None,
269        finalize: Some(_finalize::<D>),
270        call: None,
271        construct: None,
272        trace: Some(_trace::<D>),
273    });
274}
275
276pub static Class: ThreadUnsafeOnceLock<DOMJSClass> = ThreadUnsafeOnceLock::new();
277
278pub(crate) fn init_domjs_class<D: DomTypes>() {
279    init_class_ops::<D>();
280    Class.set(DOMJSClass {
281        base: JSClass {
282            name: c"GPUCanvasContext".as_ptr(),
283            flags: JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE |
284                   (((2) & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT)
285                   /* JSCLASS_HAS_RESERVED_SLOTS(2) */,
286            cOps: unsafe { CLASS_OPS.get() },
287            spec: ptr::null(),
288            ext: ptr::null(),
289            oOps: ptr::null(),
290        },
291        dom_class:
292DOMClass {
293    interface_chain: [ PrototypeList::ID::GPUCanvasContext, PrototypeList::ID::Last, PrototypeList::ID::Last, PrototypeList::ID::Last, PrototypeList::ID::Last, PrototypeList::ID::Last ],
294    depth: 0,
295    type_id: crate::codegen::InheritTypes::TopTypeId { alone: () },
296    malloc_size_of: malloc_size_of_including_raw_self::<D::GPUCanvasContext> as unsafe fn(&mut _, _) -> _,
297    global: Globals::EMPTY,
298},
299    });
300}
301
302#[cfg_attr(crown, allow(crown::unrooted_must_root))] pub unsafe fn Wrap<D: DomTypes>
303(cx: SafeJSContext, scope: &D::GlobalScope, given_proto: Option<HandleObject>, object: Box<D::GPUCanvasContext>, _can_gc: CanGc) -> DomRoot<D::GPUCanvasContext>{
304
305    let raw = Root::new(MaybeUnreflectedDom::from_box(object));
306
307    let scope = scope.reflector().get_jsobject();
308    assert!(!scope.get().is_null());
309    assert!(((*get_object_class(scope.get())).flags & JSCLASS_IS_GLOBAL) != 0);
310    let _ac = JSAutoRealm::new(cx.raw_cx(), scope.get());
311
312    rooted!(&in(cx) let mut canonical_proto = ptr::null_mut::<JSObject>());
313    GetProtoObject::<D>(cx, scope, canonical_proto.handle_mut());
314    assert!(!canonical_proto.is_null());
315
316
317    rooted!(&in(cx) let mut proto = ptr::null_mut::<JSObject>());
318    if let Some(given) = given_proto {
319        proto.set(*given);
320        if get_context_realm(cx.raw_cx()) != get_object_realm(*given) {
321            assert!(JS_WrapObject(cx.raw_cx(), proto.handle_mut()));
322        }
323    } else {
324        proto.set(*canonical_proto);
325    }
326    rooted!(&in(cx) let obj = JS_NewObjectWithGivenProto(
327        cx.raw_cx(),
328        &Class.get().base,
329        proto.handle(),
330    ));
331    assert!(!obj.is_null());
332    JS_SetReservedSlot(
333        obj.get(),
334        DOM_OBJECT_SLOT,
335        &PrivateValue(raw.as_ptr() as *const libc::c_void),
336    );
337
338    let val = PrivateValue(ptr::null());
339    JS_SetReservedSlot(obj.get(), DOM_WEAK_SLOT, &val);
340
341    let root = raw.reflect_with(obj.get());
342
343
344
345    DomRoot::from_ref(&*root)
346}
347
348pub trait GPUCanvasContextMethods<D: DomTypes> {
349    fn Canvas(&self, ) -> GenericUnionTypes::HTMLCanvasElementOrOffscreenCanvas::<D>;
350    fn Configure(&self, r#descriptor: &crate::codegen::GenericBindings::WebGPUBinding::GPUCanvasConfiguration<D>) -> Fallible<()>;
351    fn Unconfigure(&self, );
352    fn GetCurrentTexture(&self, ) -> Fallible<DomRoot<D::GPUTexture>>;
353}
354static sMethods_specs: ThreadUnsafeOnceLock<&[&[JSFunctionSpec]]> = ThreadUnsafeOnceLock::new();
355
356pub(crate) fn init_sMethods_specs<D: DomTypes>() {
357    sMethods_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
358    JSFunctionSpec {
359        name: JSPropertySpec_Name { string_: c"configure".as_ptr() },
360        call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { configure_methodinfo.get() } as *const _ as *const JSJitInfo },
361        nargs: 1,
362        flags: (JSPROP_ENUMERATE) as u16,
363        selfHostedName: ptr::null()
364    },
365    JSFunctionSpec {
366        name: JSPropertySpec_Name { string_: c"unconfigure".as_ptr() },
367        call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { unconfigure_methodinfo.get() } as *const _ as *const JSJitInfo },
368        nargs: 0,
369        flags: (JSPROP_ENUMERATE) as u16,
370        selfHostedName: ptr::null()
371    },
372    JSFunctionSpec {
373        name: JSPropertySpec_Name { string_: c"getCurrentTexture".as_ptr() },
374        call: JSNativeWrapper { op: Some(generic_method::<false>), info: unsafe { getCurrentTexture_methodinfo.get() } as *const _ as *const JSJitInfo },
375        nargs: 0,
376        flags: (JSPROP_ENUMERATE) as u16,
377        selfHostedName: ptr::null()
378    },
379    JSFunctionSpec {
380        name: JSPropertySpec_Name { string_: ptr::null() },
381        call: JSNativeWrapper { op: None, info: ptr::null() },
382        nargs: 0,
383        flags: 0,
384        selfHostedName: ptr::null()
385    }]))[..]
386])));
387}static sMethods: ThreadUnsafeOnceLock<&[Guard<&[JSFunctionSpec]>]> = ThreadUnsafeOnceLock::new();
388
389pub(crate) fn init_sMethods_prefs<D: DomTypes>() {
390    sMethods.set(Box::leak(Box::new([    Guard::new(&[Condition::Pref("dom_webgpu_enabled"),Condition::Exposed(Globals::WINDOW),Condition::Exposed(Globals::DEDICATED_WORKER_GLOBAL_SCOPE)], (unsafe { sMethods_specs.get() })[0])])));
391}static sAttributes_specs: ThreadUnsafeOnceLock<&[&[JSPropertySpec]]> = ThreadUnsafeOnceLock::new();
392
393pub(crate) fn init_sAttributes_specs<D: DomTypes>() {
394    sAttributes_specs.set(Box::leak(Box::new([&Box::leak(Box::new([
395    JSPropertySpec {
396                    name: JSPropertySpec_Name { string_: c"canvas".as_ptr() },
397                    attributes_: (JSPROP_ENUMERATE),
398                    kind_: (JSPropertySpec_Kind::NativeAccessor),
399                    u: JSPropertySpec_AccessorsOrValue {
400                        accessors: JSPropertySpec_AccessorsOrValue_Accessors {
401                            getter: JSPropertySpec_Accessor {
402                                native: JSNativeWrapper { op: Some(generic_getter::<false>), info: unsafe { canvas_getterinfo.get() } },
403                            },
404                            setter: JSPropertySpec_Accessor {
405                                native: JSNativeWrapper { op: None, info: ptr::null() },
406                            }
407                        }
408                    }
409                }
410,
411    JSPropertySpec::ZERO]))[..]
412,
413&Box::leak(Box::new([
414    JSPropertySpec {
415                    name: JSPropertySpec_Name { symbol_: SymbolCode::toStringTag as usize + 1 },
416                    attributes_: (JSPROP_READONLY),
417                    kind_: (JSPropertySpec_Kind::Value),
418                    u: JSPropertySpec_AccessorsOrValue {
419                        value: JSPropertySpec_ValueWrapper {
420                            type_: JSPropertySpec_ValueWrapper_Type::String,
421                            __bindgen_anon_1: JSPropertySpec_ValueWrapper__bindgen_ty_1 {
422                                string: c"GPUCanvasContext".as_ptr(),
423                            }
424                        }
425                    }
426                }
427,
428    JSPropertySpec::ZERO]))[..]
429])));
430}static sAttributes: ThreadUnsafeOnceLock<&[Guard<&[JSPropertySpec]>]> = ThreadUnsafeOnceLock::new();
431
432pub(crate) fn init_sAttributes_prefs<D: DomTypes>() {
433    sAttributes.set(Box::leak(Box::new([    Guard::new(&[Condition::Exposed(Globals::WINDOW),Condition::Exposed(Globals::DEDICATED_WORKER_GLOBAL_SCOPE)], (unsafe { sAttributes_specs.get() })[0]),
434    Guard::new(&[Condition::Satisfied], (unsafe { sAttributes_specs.get() })[1])])));
435}
436pub fn GetProtoObject<D: DomTypes>
437(cx: SafeJSContext, global: HandleObject, mut rval: MutableHandleObject){
438    /* Get the interface prototype object for this class.  This will create the
439       object as needed. */get_per_interface_object_handle(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::GPUCanvasContext), CreateInterfaceObjects::<D>, rval)
440}
441
442
443static PrototypeClass: JSClass = JSClass {
444    name: c"GPUCanvasContextPrototype".as_ptr(),
445    flags:
446        // JSCLASS_HAS_RESERVED_SLOTS()
447        (0 ) << JSCLASS_RESERVED_SLOTS_SHIFT,
448    cOps: ptr::null(),
449    spec: ptr::null(),
450    ext: ptr::null(),
451    oOps: ptr::null(),
452};
453
454
455static INTERFACE_OBJECT_CLASS: ThreadUnsafeOnceLock<NonCallbackInterfaceObjectClass> = ThreadUnsafeOnceLock::new();
456
457pub(crate) fn init_interface_object<D: DomTypes>() {
458    INTERFACE_OBJECT_CLASS.set(NonCallbackInterfaceObjectClass::new(
459        Box::leak(Box::new(InterfaceConstructorBehavior::throw())),
460        b"function GPUCanvasContext() {\n    [native code]\n}",
461        PrototypeList::ID::GPUCanvasContext,
462        0,
463    ));
464}
465
466pub fn DefineDOMInterface<D: DomTypes>
467(cx: SafeJSContext, global: HandleObject){
468    define_dom_interface(cx, global, ProtoOrIfaceIndex::ID(PrototypeList::ID::GPUCanvasContext),CreateInterfaceObjects::<D>, ConstructorEnabled::<D>)
469}
470
471pub fn ConstructorEnabled<D: DomTypes>
472(aCx: SafeJSContext, aObj: HandleObject) -> bool{
473    is_exposed_in(aObj, Globals::DEDICATED_WORKER_GLOBAL_SCOPE | Globals::WINDOW) &&
474    pref!(dom_webgpu_enabled)
475}
476
477unsafe fn CreateInterfaceObjects<D: DomTypes>
478(cx: SafeJSContext, global: HandleObject, cache: *mut ProtoOrIfaceArray){
479
480    rooted!(&in(cx) let mut prototype_proto = ptr::null_mut::<JSObject>());
481    prototype_proto.set(GetRealmObjectPrototype(cx.raw_cx()));
482    assert!(!prototype_proto.is_null());
483
484    rooted!(&in(cx) let mut prototype = ptr::null_mut::<JSObject>());
485    create_interface_prototype_object::<D>(cx,
486                                      global,
487                                      prototype_proto.handle(),
488                                      &PrototypeClass,
489                                      sMethods.get(),
490                                      sAttributes.get(),
491                                      &[],
492                                      &[],
493                                      prototype.handle_mut());
494    assert!(!prototype.is_null());
495    assert!((*cache)[PrototypeList::ID::GPUCanvasContext as usize].is_null());
496    (*cache)[PrototypeList::ID::GPUCanvasContext as usize] = prototype.get();
497    <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::ID::GPUCanvasContext as isize),
498                                  ptr::null_mut(),
499                                  prototype.get());
500
501    rooted!(&in(cx) let mut interface_proto = ptr::null_mut::<JSObject>());
502    interface_proto.set(GetRealmFunctionPrototype(cx.raw_cx()));
503
504    assert!(!interface_proto.is_null());
505
506    rooted!(&in(cx) let mut interface = ptr::null_mut::<JSObject>());
507    create_noncallback_interface_object::<D>(cx,
508                                        global,
509                                        interface_proto.handle(),
510                                        INTERFACE_OBJECT_CLASS.get(),
511                                        &[],
512                                        &[],
513                                        &[],
514                                        prototype.handle(),
515                                        c"GPUCanvasContext",
516                                        0,
517                                        &[],
518                                        interface.handle_mut());
519    assert!(!interface.is_null());
520}
521
522
523        pub(crate) fn init_statics<D: DomTypes>() {
524            init_interface_object::<D>();
525            init_domjs_class::<D>();
526            crate::codegen::GenericBindings::GPUCanvasContextBinding::GPUCanvasContext_Binding::init_configure_methodinfo::<D>();
527crate::codegen::GenericBindings::GPUCanvasContextBinding::GPUCanvasContext_Binding::init_unconfigure_methodinfo::<D>();
528crate::codegen::GenericBindings::GPUCanvasContextBinding::GPUCanvasContext_Binding::init_getCurrentTexture_methodinfo::<D>();
529            init_canvas_getterinfo::<D>();
530
531
532            init_sMethods_specs::<D>();
533init_sMethods_prefs::<D>();
534init_sAttributes_specs::<D>();
535init_sAttributes_prefs::<D>();
536        }
537        } // mod GPUCanvasContext_Binding
538
539