aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/globalscope.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2024-10-22 05:35:20 -0400
committerGitHub <noreply@github.com>2024-10-22 09:35:20 +0000
commit575e8855294a9ee2094b110a7c1fea868e69251e (patch)
tree261ab3e890b9125e9e08f97366de34213eb67467 /components/script/dom/globalscope.rs
parentedc304854ff18bc686f8e2adc6cb64cbad181598 (diff)
downloadservo-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/globalscope.rs')
-rw-r--r--components/script/dom/globalscope.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs
index 2458db4af8a..81574c8b50a 100644
--- a/components/script/dom/globalscope.rs
+++ b/components/script/dom/globalscope.rs
@@ -2810,9 +2810,10 @@ impl GlobalScope {
&self,
image: ImageBitmapSource,
options: &ImageBitmapOptions,
+ can_gc: CanGc,
) -> Rc<Promise> {
let in_realm_proof = AlreadyInRealm::assert();
- let p = Promise::new_in_current_realm(InRealm::Already(&in_realm_proof));
+ let p = Promise::new_in_current_realm(InRealm::Already(&in_realm_proof), can_gc);
if options.resizeWidth.is_some_and(|w| w == 0) {
p.reject_error(Error::InvalidState);
return p;