mirror of
https://github.com/servo/servo
synced 2026-04-30 11:27:28 +02:00
Script: Convert routed_promise to GenericCallback (#41380)
This changes routed_promise to use the GenericCallback functionality. This mostly effected WebGPU but also Clipboard and Memory Reporting. We also added a GenericCallback::new_blocking() functionality which produces a callback and a channel which then can be blocked on. This was used a couple of times in the code. Signed-off-by: Narfinger <Narfinger@users.noreply.github.com> Testing: This should not change functionality. --------- Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
@@ -20,7 +20,7 @@ use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::promise::Promise;
|
||||
use crate::dom::types::GPUDevice;
|
||||
use crate::realms::InRealm;
|
||||
use crate::routed_promise::{RoutedPromiseListener, route_promise};
|
||||
use crate::routed_promise::{RoutedPromiseListener, callback_promise};
|
||||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
@@ -95,7 +95,7 @@ impl GPUShaderModule {
|
||||
promise.clone(),
|
||||
can_gc,
|
||||
);
|
||||
let sender = route_promise(
|
||||
let callback = callback_promise(
|
||||
&promise,
|
||||
&*shader_module,
|
||||
device
|
||||
@@ -111,7 +111,7 @@ impl GPUShaderModule {
|
||||
program_id,
|
||||
program: descriptor.code.0.clone(),
|
||||
label: None,
|
||||
sender,
|
||||
callback,
|
||||
})
|
||||
.expect("Failed to create WebGPU ShaderModule");
|
||||
shader_module
|
||||
|
||||
Reference in New Issue
Block a user