refactor: asynchronous blob backing store (#10969)

Co-authored-by: Luca Casonato <hello@lcas.dev>
This commit is contained in:
Jimmy Wärting 2021-07-05 15:34:37 +02:00 committed by GitHub
parent ea87d860be
commit 2c0b0e45b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 652 additions and 269 deletions

View file

@ -15,7 +15,7 @@
((window) => {
const core = Deno.core;
const webidl = window.__bootstrap.webidl;
const { _byteSequence } = window.__bootstrap.file;
const { getParts } = window.__bootstrap.file;
const { URL } = window.__bootstrap.url;
/**
@ -31,9 +31,9 @@
});
const url = core.opSync(
"op_file_create_object_url",
"op_blob_create_object_url",
blob.type,
blob[_byteSequence],
getParts(blob),
);
return url;
@ -51,10 +51,7 @@
prefix,
});
core.opSync(
"op_file_revoke_object_url",
url,
);
core.opSync("op_blob_revoke_object_url", url);
}
URL.createObjectURL = createObjectURL;