Use ROUTER::add_typed_route instead of ROUTER::add_route everywhere (#33866)

* Use ROUTER::add_typed_route where possible

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update webxr, media and ipc-channel

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2024-10-18 12:47:52 +02:00 committed by GitHub
parent ff374c1428
commit e33bae6d0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 177 additions and 195 deletions

View file

@ -76,8 +76,8 @@ pub fn response_async<T: AsyncWGPUListener + DomObject + 'static>(
.task_canceller(TaskSourceName::DOMManipulation);
let mut trusted: Option<TrustedPromise> = Some(TrustedPromise::new(promise.clone()));
let trusted_receiver = Trusted::new(receiver);
ROUTER.add_route(
action_receiver.to_opaque(),
ROUTER.add_typed_route(
action_receiver,
Box::new(move |message| {
let trusted = if let Some(trusted) = trusted.take() {
trusted
@ -92,7 +92,7 @@ pub fn response_async<T: AsyncWGPUListener + DomObject + 'static>(
};
let result = task_source.queue_with_canceller(
task!(process_webgpu_task: move|| {
context.response(message.to().unwrap(), CanGc::note());
context.response(message.unwrap(), CanGc::note());
}),
&canceller,
);