1
0
Fork 0
mirror of https://github.com/codedread/bitjs synced 2025-10-03 17:49:16 +02:00

Experiment with marking ArrayBuffers are Transferable across the Worker thread boundary for unzip.

This commit is contained in:
Jeff Schiller 2021-12-12 12:15:29 -08:00
parent 2a90e32c89
commit 85dcee80ec
3 changed files with 36 additions and 20 deletions

View file

@ -109,6 +109,7 @@ class ZipLocalFile {
}
// Read in the compressed data if we have no data descriptor.
/** @type {Uint8Array} */
this.fileData = null;
let descriptorSize = 0;
if (this.hasDataDescriptor) {
@ -622,7 +623,7 @@ function archiveUnzip() {
oneLocalFile.unzip();
if (oneLocalFile.fileData != null) {
postMessage({ type: 'extract', unarchivedFile: oneLocalFile });
postMessage({ type: 'extract', unarchivedFile: oneLocalFile }, [oneLocalFile.fileData.buffer]);
postProgress();
}
}