Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the DownloadManager.onerror functionality, since its only usage is unlikely to be helpful #12804

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

  • Add a new helper method, on PDFViewerApplication, to determine the document filename

    Currently this code is duplicated no less than three times in the web/app.js file, and by introducing a helper method we can avoid unnecessary repetition.

  • Remove the DownloadManager.onerror functionality, since its only usage is unlikely to be helpful

    Note how the onerror functionality is not being used in the GENERIC DownloadManager, since we have no way of knowing if downloading succeeded.
    Hence this functionality is only possibly useful in MOZCENTRAL builds, however as outlined in the existing comments it's unlikely to be helpful in practice. Generally speaking, if downloading failed once in PdfStreamConverter.jsm it seems very likely that it would fail again; all-in-all I'm thus suggesting that we just remove the onerror functionality altogether here.

…document filename

Currently this code is duplicated no less than three times in the `web/app.js` file, and by introducing a helper method we can avoid unnecessary repetition.
…age is unlikely to be helpful

Note how the `onerror` functionality is not being used in the GENERIC `DownloadManager`, since we have no way of knowing if downloading succeeded.
Hence this functionality is only *possibly* useful in MOZCENTRAL builds, however as outlined in the existing comments it's unlikely to be helpful in practice. Generally speaking, if downloading failed once in [`PdfStreamConverter.jsm`](https://searchfox.org/mozilla-central/rev/809ac3660845fef6faf18ec210232fdadc0f1ad9/toolkit/components/pdfjs/content/PdfStreamConverter.jsm#294-406) it seems very likely that it would fail again; all-in-all I'm thus suggesting that we just remove the `onerror` functionality altogether here.
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Jan 2, 2021

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/82cfc14509e1879/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jan 2, 2021

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/82cfc14509e1879/output.txt

Total script time: 4.04 mins

Published

@timvandermeij timvandermeij merged commit 1810e65 into mozilla:master Jan 3, 2021
@timvandermeij
Copy link
Contributor

Nice, thanks!

@Snuffleupagus Snuffleupagus deleted the DownloadManager-rm-onerror branch January 3, 2021 11:56
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.

3 participants