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

@ -1077,14 +1077,15 @@ impl HTMLImageElement {
.task_manager()
.networking_task_source_with_canceller();
let generation = elem.generation.get();
ROUTER.add_route(
responder_receiver.to_opaque(),
ROUTER.add_typed_route(
responder_receiver,
Box::new(move |message| {
debug!("Got image {:?}", message);
// Return the image via a message to the script thread, which marks
// the element as dirty and triggers a reflow.
let element = trusted_node.clone();
let image: PendingImageResponse = message.to().unwrap();
let image: PendingImageResponse = message.unwrap();
let selected_source_clone = selected_source.clone();
let _ = task_source.queue_with_canceller(
task!(process_image_response_for_environment_change: move || {