mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
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>
This commit is contained in:
parent
edc304854f
commit
575e885529
50 changed files with 422 additions and 221 deletions
|
@ -257,10 +257,10 @@ impl BlobMethods for Blob {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/FileAPI/#text-method-algo
|
||||
fn Text(&self) -> Rc<Promise> {
|
||||
fn Text(&self, can_gc: CanGc) -> Rc<Promise> {
|
||||
let global = self.global();
|
||||
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);
|
||||
let id = self.get_blob_url_id();
|
||||
global.read_file_async(
|
||||
id,
|
||||
|
@ -280,10 +280,10 @@ impl BlobMethods for Blob {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/FileAPI/#arraybuffer-method-algo
|
||||
fn ArrayBuffer(&self) -> Rc<Promise> {
|
||||
fn ArrayBuffer(&self, can_gc: CanGc) -> Rc<Promise> {
|
||||
let global = self.global();
|
||||
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);
|
||||
|
||||
let id = self.get_blob_url_id();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue