mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Add session parameter to XRSpace
This commit is contained in:
parent
ffacb1179e
commit
8f14007979
3 changed files with 22 additions and 11 deletions
|
@ -4,27 +4,30 @@
|
|||
|
||||
use crate::dom::bindings::codegen::Bindings::XRSpaceBinding;
|
||||
use crate::dom::bindings::reflector::reflect_dom_object;
|
||||
use crate::dom::bindings::root::DomRoot;
|
||||
use crate::dom::bindings::root::{Dom, DomRoot};
|
||||
use crate::dom::eventtarget::EventTarget;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::xrsession::XRSession;
|
||||
use dom_struct::dom_struct;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct XRSpace {
|
||||
eventtarget: EventTarget,
|
||||
session: Dom<XRSession>,
|
||||
}
|
||||
|
||||
impl XRSpace {
|
||||
pub fn new_inherited() -> XRSpace {
|
||||
pub fn new_inherited(session: &XRSession) -> XRSpace {
|
||||
XRSpace {
|
||||
eventtarget: EventTarget::new_inherited(),
|
||||
session: Dom::from_ref(session),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn new(global: &GlobalScope) -> DomRoot<XRSpace> {
|
||||
pub fn new(global: &GlobalScope, session: &XRSession) -> DomRoot<XRSpace> {
|
||||
reflect_dom_object(
|
||||
Box::new(XRSpace::new_inherited()),
|
||||
Box::new(XRSpace::new_inherited(session)),
|
||||
global,
|
||||
XRSpaceBinding::Wrap,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue