/
githubmirror
/
servo
Обзор
Документация
Войти
/
githubmirror
/
servo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
components/script/dom/webgpu/gpuoutofmemoryerror.rs
48 строк
2 KB
Tim van der Lippe
script: Mechanically migrate to `reflect_dom_object_with_proto` (#46529)
15 июл 2026, 23:09
Не верифицирован
15 июл 2026, 23:09
2557009
Код
Авторство
О чём код?
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use dom_struct::dom_struct; use js::context::JSContext; use js::rust::HandleObject; use script_bindings::reflector::reflect_dom_object_with_proto; use crate::dom::bindings::codegen::Bindings::WebGPUBinding::GPUOutOfMemoryError_Binding::GPUOutOfMemoryErrorMethods; use crate::dom::bindings::root::DomRoot; use crate::dom::bindings::str::DOMString; use crate::dom::globalscope::GlobalScope; use crate::dom::types::GPUError; #[dom_struct] pub(crate) struct GPUOutOfMemoryError { gpu_error: GPUError, } impl GPUOutOfMemoryError { fn new_inherited(message: DOMString) -> Self { Self { gpu_error: GPUError::new_inherited(message), } } pub(crate) fn new_with_proto( cx: &mut JSContext, global: &GlobalScope, proto: Option<HandleObject>, message: DOMString, ) -> DomRoot<Self> { reflect_dom_object_with_proto(cx, Box::new(Self::new_inherited(message)), global, proto) } } impl GPUOutOfMemoryErrorMethods<crate::DomTypeHolder> for GPUOutOfMemoryError { /// <https://gpuweb.github.io/gpuweb/#dom-GPUOutOfMemoryError-GPUOutOfMemoryError> fn Constructor( cx: &mut JSContext, global: &GlobalScope, proto: Option<HandleObject>, message: DOMString, ) -> DomRoot<Self> { Self::new_with_proto(cx, global, proto, message) } }