Skip to content

Remove unused BasePdfManager/LocalPdfManager methods - #21827

Merged
timvandermeij merged 2 commits into
mozilla:masterfrom
Snuffleupagus:PdfManager-rm-unused
Aug 27, 2026
Merged

Remove unused BasePdfManager/LocalPdfManager methods#21827
timvandermeij merged 2 commits into
mozilla:masterfrom
Snuffleupagus:PdfManager-rm-unused

Conversation

@Snuffleupagus

Copy link
Copy Markdown
Collaborator
  • Remove the unused LocalPdfManager.prototype.requestRange method

    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:

    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.

  • Remove the unused BasePdfManager.prototype.ensureXRef method (PR 20333 follow-up)

    This method became unused in PR Fix incremental saving with hybrid references #20333, so let's just remove it now.

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-commenter

codecov-commenter commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.12%. Comparing base (49ff3dc) to head (af429da).

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     
Flag Coverage Δ
browsertest 66.30% <ø> (-0.02%) ⬇️
fonttest 8.92% <ø> (ø)
integrationtest 69.32% <ø> (-0.08%) ⬇️
unittest 58.38% <ø> (+<0.01%) ⬆️
unittestcli 56.96% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Snuffleupagus

Copy link
Copy Markdown
Collaborator Author

/botio browsertest

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/8f3d95fa23c9bdc/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Received

Command cmd_browsertest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/848179b115830d1/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/8f3d95fa23c9bdc/output.txt

Total script time: 19.17 mins

  • Regression tests: Passed

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/848179b115830d1/output.txt

Total script time: 24.00 mins

  • Regression tests: Passed

@timvandermeij
timvandermeij merged commit 3065994 into mozilla:master Aug 27, 2026
24 of 25 checks passed
@timvandermeij

Copy link
Copy Markdown
Collaborator

Thank you for cleaning this up!

@Snuffleupagus
Snuffleupagus deleted the PdfManager-rm-unused branch August 28, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants