Skip to content

Commit 05b78ce

Browse files
committed
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.
1 parent 9872657 commit 05b78ce

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/core/chunked_stream.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ class ChunkedStreamManager {
283283

284284
sendRequest(begin, end) {
285285
const rangeReader = this.pdfNetworkStream.getRangeReader(begin, end);
286-
rangeReader.onProgress = this.onProgress.bind(this);
287286

288287
let chunks = [];
289288
return new Promise((resolve, reject) => {
@@ -441,13 +440,6 @@ class ChunkedStreamManager {
441440
return groupedChunks;
442441
}
443442

444-
onProgress(args) {
445-
this.msgHandler.send("DocProgress", {
446-
loaded: this.stream.numChunksLoaded * this.chunkSize + args.loaded,
447-
total: this.length,
448-
});
449-
}
450-
451443
onReceiveData(args) {
452444
const { chunkSize, length, stream } = this;
453445

0 commit comments

Comments
 (0)