script: Mark callback methods with CanGc. (#35753)

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-03-03 07:17:25 -05:00 committed by GitHub
parent 3d320fa96a
commit 5650fa2e79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 133 additions and 67 deletions

View file

@ -480,7 +480,7 @@ impl XRSession {
for i in 0..len {
let callback = self.current_raf_callback_list.borrow()[i].1.clone();
if let Some(callback) = callback {
let _ = callback.Call__(time, &frame, ExceptionHandling::Report);
let _ = callback.Call__(time, &frame, ExceptionHandling::Report, can_gc);
}
}
self.outside_raf.set(true);

View file

@ -180,10 +180,15 @@ impl XRTestMethods<crate::DomTypeHolder> for XRTest {
}
/// <https://github.com/immersive-web/webxr-test-api/blob/master/explainer.md>
fn SimulateUserActivation(&self, f: Rc<Function>) {
fn SimulateUserActivation(&self, f: Rc<Function>, can_gc: CanGc) {
ScriptThread::set_user_interacting(true);
rooted!(in(*GlobalScope::get_cx()) let mut value: JSVal);
let _ = f.Call__(vec![], value.handle_mut(), ExceptionHandling::Rethrow);
let _ = f.Call__(
vec![],
value.handle_mut(),
ExceptionHandling::Rethrow,
can_gc,
);
ScriptThread::set_user_interacting(false);
}