mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
parent
ff374c1428
commit
e33bae6d0a
40 changed files with 177 additions and 195 deletions
|
@ -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,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue