diff options
author | Josh Matthews <josh@joshmatthews.net> | 2024-10-22 05:35:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-22 09:35:20 +0000 |
commit | 575e8855294a9ee2094b110a7c1fea868e69251e (patch) | |
tree | 261ab3e890b9125e9e08f97366de34213eb67467 /components/script/dom/gpu.rs | |
parent | edc304854ff18bc686f8e2adc6cb64cbad181598 (diff) | |
download | servo-575e8855294a9ee2094b110a7c1fea868e69251e.tar.gz servo-575e8855294a9ee2094b110a7c1fea868e69251e.zip |
Mark promise creation methods with CanGc (#33928)
* Add CanGc annotations to promise constructor.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Propagate CanGc arguments for Promise::new_in_current_realm.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Fix out-of-order entries.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Propagate CanGc from Promise::new.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Suppress clippy warning.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Formatting.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Diffstat (limited to 'components/script/dom/gpu.rs')
-rw-r--r-- | components/script/dom/gpu.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/components/script/dom/gpu.rs b/components/script/dom/gpu.rs index cdac3a5a2e0..753ff82b7ab 100644 --- a/components/script/dom/gpu.rs +++ b/components/script/dom/gpu.rs @@ -106,9 +106,14 @@ pub fn response_async<T: AsyncWGPUListener + DomObject + 'static>( impl GPUMethods for GPU { // https://gpuweb.github.io/gpuweb/#dom-gpu-requestadapter - fn RequestAdapter(&self, options: &GPURequestAdapterOptions, comp: InRealm) -> Rc<Promise> { + fn RequestAdapter( + &self, + options: &GPURequestAdapterOptions, + comp: InRealm, + can_gc: CanGc, + ) -> Rc<Promise> { let global = &self.global(); - let promise = Promise::new_in_current_realm(comp); + let promise = Promise::new_in_current_realm(comp, can_gc); let sender = response_async(&promise, self); let power_preference = match options.powerPreference { Some(GPUPowerPreference::Low_power) => PowerPreference::LowPower, |