From 05b78ce03cb5392eb7664f5100a62351a5cac03d Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 30 Jan 2026 07:56:05 +0100 Subject: [PATCH] Stop registering an `onProgress` callback on the `PDFWorkerStreamRangeReader`-instance, in the `ChunkedStreamManager` class Given that nothing in the `PDFWorkerStreamRangeReader` class attempts to invoke the `onProgress` callback, this is effectively dead code now. Looking briefly at the history of this code it's not clear, at least to me, when this became unused however it's probably close to a decade ago. Finally, note also how progress is already being reported through the `ChunkedStreamManager.prototype.onReceiveData` method. --- src/core/chunked_stream.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/core/chunked_stream.js b/src/core/chunked_stream.js index 680ac85fc..055bcfcde 100644 --- a/src/core/chunked_stream.js +++ b/src/core/chunked_stream.js @@ -283,7 +283,6 @@ class ChunkedStreamManager { sendRequest(begin, end) { const rangeReader = this.pdfNetworkStream.getRangeReader(begin, end); - rangeReader.onProgress = this.onProgress.bind(this); let chunks = []; return new Promise((resolve, reject) => { @@ -441,13 +440,6 @@ class ChunkedStreamManager { return groupedChunks; } - onProgress(args) { - this.msgHandler.send("DocProgress", { - loaded: this.stream.numChunksLoaded * this.chunkSize + args.loaded, - total: this.length, - }); - } - onReceiveData(args) { const { chunkSize, length, stream } = this;