-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Improve the PDFObjects
class
#14585
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
Improve the PDFObjects
class
#14585
Conversation
This ensures that the underlying data cannot be accessed directly, from the outside, since that's definately not intended here. Note that we expose `PDFObjects`-instances, via the `commonObjs` and `objs` properties, on the `PDFPageProxy`-instances hence these changes really cannot hurt.
The manually tracked `resolved`-property is no longer necessary, since the same information is now directly available on all `PromiseCapability`-instances. Furthermore, since the `PDFObjects.resolve` method is not documented as accepting e.g. only Object-data, we probably shouldn't resolve the `PromiseCapability` with the `data` and instead only store it on the `PDFObjects`-instance.[1] --- [1] While Objects are passed by reference in JavaScript, other primitives such as e.g. strings are passed by value and the current implementation *could* thus lead to increased memory usage. Given how we're using `PDFObjects` in the PDF.js code-base none of this should be an issue, but it still cannot hurt to change this.
Given that we expose `PDFObjects`-instances, via the `commonObjs` and `objs` properties, on the `PDFPageProxy`-instances this ought to help provide slightly better TypeScript definitions.
@@ -91,7 +91,7 @@ const DefaultStandardFontDataFactory = | |||
*/ | |||
|
|||
/** | |||
* @type IPDFStreamFactory | |||
* @type {IPDFStreamFactory} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unrelated to the other changes, but I happened to notice this typo and thought that a separate commit/PR for only this change was excessive :-)
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/0cab2c420458665/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/4a4924f2591b301/output.txt |
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/4a4924f2591b301/output.txt Total script time: 25.27 mins
|
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/0cab2c420458665/output.txt Total script time: 60.00 mins |
/botio-linux test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/3114c3aeb2724c3/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/3114c3aeb2724c3/output.txt Total script time: 23.25 mins
Image differences available at: http://54.241.84.105:8877/3114c3aeb2724c3/reftest-analyzer.html#web=eq.log |
Nice improvements; thanks! |
Please refer to the individual commit messages for additional details.