mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 20:59:10 +00:00
refactor: asynchronous blob backing store (#10969)
Co-authored-by: Luca Casonato <hello@lcas.dev>
This commit is contained in:
parent
ea87d860be
commit
2c0b0e45b7
28 changed files with 652 additions and 269 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue