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.
This commit is contained in:
Jonas Jenwald 2026-01-30 07:56:05 +01:00
parent 987265720e
commit 05b78ce03c

View File

@ -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;