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

Move worker-thread only functions from src/shared/util.js and into a new src/core/core_utils.js file #10577

Merged
merged 3 commits into from
Feb 24, 2019

Conversation

Snuffleupagus
Copy link
Collaborator

The src/shared/util.js file is being bundled into both the pdf.js and pdf.worker.js files, meaning that its code is by definition duplicated.
Some main-thread only utility functions have already been moved to a separate src/display_utils.js file, and this patch simply extends that concept to utility functions which are used only on the worker-thread.

Note in particular the getInheritableProperty function, which expects a Dict as input and thus cannot possibly ever be used on the main-thread.

…ils.js`

This file (currently) contains not only DOM-specific helper functions/classes, but is used generally for various helper code relevant for main-thread functionality.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/61035b57e82f4d2/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/0dd6987ba153d62/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/61035b57e82f4d2/output.txt

Total script time: 17.98 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/0dd6987ba153d62/output.txt

Total script time: 25.76 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

…a new `src/core/core_utils.js` file

The `src/shared/util.js` file is being bundled into both the `pdf.js` and `pdf.worker.js` files, meaning that its code is by definition duplicated.
Some main-thread only utility functions have already been moved to a separate `src/display/display_utils.js` file, and this patch simply extends that concept to utility functions which are used *only* on the worker-thread.

Note in particular the `getInheritableProperty` function, which expects a `Dict` as input and thus *cannot* possibly ever be used on the main-thread.
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/2804ae401e7cd21/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/2804ae401e7cd21/output.txt

Total script time: 1.98 mins

Published

@timvandermeij timvandermeij merged commit de56518 into mozilla:master Feb 24, 2019
@timvandermeij
Copy link
Contributor

Splitting the utilities seems like a good idea to me. Thanks!

@Snuffleupagus Snuffleupagus deleted the util-split branch February 25, 2019 00:20
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