Remove unused BasePdfManager/LocalPdfManager methods - #21827
Conversation
This method is never invoked, since the `LocalPdfManager` is only used when all data is already available. More specifically, the `requestRange` method is only called from: - https://github.com/mozilla/pdf.js/blob/49ff3dc5af480f6db625fa86abce1d74b0d6c67a/src/core/document.js#L2042-L2045 - https://github.com/mozilla/pdf.js/blob/49ff3dc5af480f6db625fa86abce1d74b0d6c67a/src/core/pdf_manager.js#L227-L230 - https://github.com/mozilla/pdf.js/blob/49ff3dc5af480f6db625fa86abce1d74b0d6c67a/src/core/xref.js#L1050-L1053 Note how in all those cases a `MissingDataException` must have been thrown in order for that method to be called, and that exception is *only* ever thrown from the `src/core/chunked_stream.js` file. The classes in that file are only invoked from the `NetworkPdfManager` constructor, hence we know that `LocalPdfManager.prototype.requestRange` is indeed unused.
…333 follow-up) This method became unused in PR 20333, so let's just remove it now.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #21827 +/- ##
==========================================
- Coverage 90.18% 90.12% -0.07%
==========================================
Files 264 264
Lines 67312 67310 -2
==========================================
- Hits 60707 60664 -43
- Misses 6605 6646 +41
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/botio browsertest |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/8f3d95fa23c9bdc/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/848179b115830d1/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/8f3d95fa23c9bdc/output.txt Total script time: 19.17 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/848179b115830d1/output.txt Total script time: 24.00 mins
|
|
Thank you for cleaning this up! |
Remove the unused
LocalPdfManager.prototype.requestRangemethodThis method is never invoked, since the
LocalPdfManageris only used when all data is already available.More specifically, the
requestRangemethod is only called from:pdf.js/src/core/document.js
Lines 2042 to 2045 in 49ff3dc
pdf.js/src/core/pdf_manager.js
Lines 227 to 230 in 49ff3dc
pdf.js/src/core/xref.js
Lines 1050 to 1053 in 49ff3dc
Note how in all those cases a
MissingDataExceptionmust have been thrown in order for that method to be called, and that exception is only ever thrown from thesrc/core/chunked_stream.jsfile.The classes in that file are only invoked from the
NetworkPdfManagerconstructor, hence we know thatLocalPdfManager.prototype.requestRangeis indeed unused.Remove the unused
BasePdfManager.prototype.ensureXRefmethod (PR 20333 follow-up)This method became unused in PR Fix incremental saving with hybrid references #20333, so let's just remove it now.