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

Add an abstract base-class, which all the various Stream implementations inherit from #13303

Merged
merged 30 commits into from
May 1, 2021

Commits on Apr 28, 2021

  1. Configuration menu
    Copy the full SHA
    6c1a321 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1f9b134 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1f0685c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    342b0c1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    66b898e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    704514c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d63df04 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    59591f8 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    d2227a7 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    3294d4d View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    f6c7a65 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    cdb583b View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    28b0809 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    a9476e7 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    e938c05 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    66d9d83 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    b08f9a8 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    40c342e View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    1e5bf35 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    aa1deaf View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    213e1c3 View commit details
    Browse the repository at this point in the history
  22. Move the DecodeStream and StreamsSequenceStream from `src/core/st…

    …ream.js` and into its own file
    Snuffleupagus committed Apr 28, 2021
    Configuration menu
    Copy the full SHA
    30a22a1 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    8ce2cae View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    b11f012 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    29cf415 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    6151b4e View commit details
    Browse the repository at this point in the history
  27. Add an abstract base-class, which all the various Stream implementati…

    …ons inherit from
    
    By having an abstract base-class, it becomes a lot clearer exactly which methods/getters are expected to exist on all Stream instances.
    Furthermore, since a number of the methods are *identical* for all Stream implementations, this reduces unnecessary code duplication in the `Stream`, `DecodeStream`, and `ChunkedStream` classes.
    
    For e.g. `gulp mozcentral`, the *built* `pdf.worker.js` files decreases from `1 619 329` to `1 616 115` bytes with this patch-series.
    Snuffleupagus committed Apr 28, 2021
    Configuration menu
    Copy the full SHA
    67415bf View commit details
    Browse the repository at this point in the history
  28. Improve the handling getBaseStreams, on the various Stream implemen…

    …tations
    
    The way that `getBaseStreams` is currently handled has bothered me from time to time, especially how we're checking if the method exists before calling it.
    By adding a dummy `BaseStream.getBaseStreams` method, and having the call-sites simply check the return value, we can improve some of the relevant code.
    
    Note in particular how the `ObjectLoader._walk` method didn't actually check that the data in question is a Stream instance, and instead only checked the `currentNode` (which could be anything) for the existence of a `getBaseStreams` property.
    Snuffleupagus committed Apr 28, 2021
    Configuration menu
    Copy the full SHA
    67a1cfc View commit details
    Browse the repository at this point in the history
  29. Stop special-casing the dict parameter in the Jbig2Stream/`JpegSt…

    …ream`/`JpxStream` constructors
    
    For all of the other `DecodeStream`s we're not passing in a `Dict`-instance manually, but instead get it from the `stream`-parameter. Hence there's no particularly good reason, as far as I can tell, to not do the same thing in `Jbig2Stream`/`JpegStream`/`JpxStream` as well.
    Snuffleupagus committed Apr 28, 2021
    Configuration menu
    Copy the full SHA
    fb07755 View commit details
    Browse the repository at this point in the history
  30. Let ChunkedStream extend Stream, rather than BaseStream directly

    Looking at the `ChunkedStream` implementation, it's basically a "regular" `Stream` but with added functionality in order to deal with fetching/loading of missing data.
    Hence, by letting `ChunkedStream` extend `Stream`, we can remove some duplicate methods from the `ChunkedStream` class.
    Snuffleupagus committed Apr 28, 2021
    Configuration menu
    Copy the full SHA
    2ac4ad3 View commit details
    Browse the repository at this point in the history