mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Clean up vrdisplay, set active immersive session correctly
This commit is contained in:
parent
8780edb165
commit
57c85361be
4 changed files with 18 additions and 152 deletions
|
@ -40,7 +40,7 @@ pub struct XR {
|
|||
displays: DomRefCell<Vec<Dom<VRDisplay>>>,
|
||||
gamepads: DomRefCell<Vec<Dom<Gamepad>>>,
|
||||
pending_immersive_session: Cell<bool>,
|
||||
active_immersive_session: MutNullableDom<VRDisplay>,
|
||||
active_immersive_session: MutNullableDom<XRSession>,
|
||||
test: MutNullableDom<XRTest>,
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ impl XR {
|
|||
self.pending_immersive_session.set(true)
|
||||
}
|
||||
|
||||
pub fn set_active_immersive_session(&self, session: &VRDisplay) {
|
||||
pub fn set_active_immersive_session(&self, session: &XRSession) {
|
||||
// XXXManishearth when we support non-immersive (inline) sessions we should
|
||||
// ensure they never reach these codepaths
|
||||
self.pending_immersive_session.set(false);
|
||||
|
@ -237,6 +237,7 @@ impl XR {
|
|||
};
|
||||
|
||||
let session = XRSession::new(&self.global(), session);
|
||||
self.set_active_immersive_session(&session);
|
||||
promise.resolve_native(&session);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue