mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Various CanGc fixes (#33800)
* CanGc fix for pagetransitionevent Signed-off-by: webbeef <me@webbeef.org> * CanGc fix for dom/node Signed-off-by: webbeef <me@webbeef.org> * CanGc fix for gamepad Signed-off-by: webbeef <me@webbeef.org> * CanGc fix for gpu Signed-off-by: webbeef <me@webbeef.org> * CanGc fix for dom/element Signed-off-by: webbeef <me@webbeef.org> * CanGc fix for xhr Signed-off-by: webbeef <me@webbeef.org> * CanGc fix for dom/worker Signed-off-by: webbeef <me@webbeef.org> * CanGc fix for rtcdatachannel Signed-off-by: webbeef <me@webbeef.org> * CanGc fix for rtcerror Signed-off-by: webbeef <me@webbeef.org> * Address review comments Signed-off-by: webbeef <me@webbeef.org> --------- Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
parent
c00c6e728d
commit
2b71130a8a
24 changed files with 168 additions and 119 deletions
|
@ -68,6 +68,7 @@ use crate::dom::xrspace::XRSpace;
|
|||
use crate::realms::InRealm;
|
||||
use crate::script_runtime::JSContext;
|
||||
use crate::task_source::TaskSource;
|
||||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct XRSession {
|
||||
|
@ -240,7 +241,7 @@ impl XRSession {
|
|||
let this = this.clone();
|
||||
let _ = task_source.queue_with_canceller(
|
||||
task!(xr_event_callback: move || {
|
||||
this.root().event_callback(message.to().unwrap());
|
||||
this.root().event_callback(message.to().unwrap(), CanGc::note());
|
||||
}),
|
||||
&canceller,
|
||||
);
|
||||
|
@ -275,13 +276,13 @@ impl XRSession {
|
|||
let _ = task_source.queue_with_canceller(
|
||||
task!(session_initial_inputs: move || {
|
||||
let this = this.root();
|
||||
this.input_sources.add_input_sources(&this, &initial_inputs);
|
||||
this.input_sources.add_input_sources(&this, &initial_inputs, CanGc::note());
|
||||
}),
|
||||
&canceller,
|
||||
);
|
||||
}
|
||||
|
||||
fn event_callback(&self, event: XREvent) {
|
||||
fn event_callback(&self, event: XREvent, can_gc: CanGc) {
|
||||
match event {
|
||||
XREvent::SessionEnd => {
|
||||
// https://immersive-web.github.io/webxr/#shut-down-the-session
|
||||
|
@ -366,13 +367,14 @@ impl XRSession {
|
|||
self.dirty_layers();
|
||||
},
|
||||
XREvent::AddInput(info) => {
|
||||
self.input_sources.add_input_sources(self, &[info]);
|
||||
self.input_sources.add_input_sources(self, &[info], can_gc);
|
||||
},
|
||||
XREvent::RemoveInput(id) => {
|
||||
self.input_sources.remove_input_source(self, id);
|
||||
},
|
||||
XREvent::UpdateInput(id, source) => {
|
||||
self.input_sources.add_remove_input_source(self, id, source);
|
||||
self.input_sources
|
||||
.add_remove_input_source(self, id, source, can_gc);
|
||||
},
|
||||
XREvent::InputChanged(id, frame) => {
|
||||
self.input_frames.borrow_mut().insert(id, frame);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue