mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-08-02 20:37:21 +02:00
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:
parent
987265720e
commit
05b78ce03c
@ -283,7 +283,6 @@ class ChunkedStreamManager {
|
|||||||
|
|
||||||
sendRequest(begin, end) {
|
sendRequest(begin, end) {
|
||||||
const rangeReader = this.pdfNetworkStream.getRangeReader(begin, end);
|
const rangeReader = this.pdfNetworkStream.getRangeReader(begin, end);
|
||||||
rangeReader.onProgress = this.onProgress.bind(this);
|
|
||||||
|
|
||||||
let chunks = [];
|
let chunks = [];
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@ -441,13 +440,6 @@ class ChunkedStreamManager {
|
|||||||
return groupedChunks;
|
return groupedChunks;
|
||||||
}
|
}
|
||||||
|
|
||||||
onProgress(args) {
|
|
||||||
this.msgHandler.send("DocProgress", {
|
|
||||||
loaded: this.stream.numChunksLoaded * this.chunkSize + args.loaded,
|
|
||||||
total: this.length,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
onReceiveData(args) {
|
onReceiveData(args) {
|
||||||
const { chunkSize, length, stream } = this;
|
const { chunkSize, length, stream } = this;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user