Age | Commit message (Collapse) | Author |
|
XFA has its own method for generating alerts in the embedder,
CPDFSDK_FormFillEnvironment::Alert, which is a slight variation of the
non-XFA CPDFSDK_FormFillEnvironment::JS_appAlert. Converting the two
instances of calls to the XFA only method to use the non-XFA method
and removing the XFA only method.
Change-Id: I60ea92b2ae69ea96ce4c216ef6d9029d79580b05
Reviewed-on: https://pdfium-review.googlesource.com/35690
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug: 853238
Change-Id: I133be340fd877e9acd2733845d454924dc86d295
Reviewed-on: https://pdfium-review.googlesource.com/35711
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
Change-Id: I5dfadcb68e640235be6e3eb7c8d57ae3b8013d26
Reviewed-on: https://pdfium-review.googlesource.com/35691
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Many of these are converting ByteString => c_str => ByteStringView, since
the ByteStringView ctor is implicit. This is unfortunate, since that
involves a strlen() which the ByteString already knows if we use
AsStringView() instead.
This changed one test result where we can now return the string
"\0" instead of "" -- since strlen no longer eats the NUL. This
seems consistent, say, with String.fromCharCode().
Change-Id: I17f68d1a1f4b352960208f9148e68ab4c4d78bd2
Reviewed-on: https://pdfium-review.googlesource.com/35590
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Skia is moving to normalize on std::swap instead of its own SkTSwap.
This removes the use of SkTSwap from PDFium so that Skia can remove it.
Change-Id: If77708c1f363f4fd82a4c7905c7fbb2060900532
Reviewed-on: https://pdfium-review.googlesource.com/35470
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
c_str() is a bit of a code smell, esp. since Byte/Wide strings
know how to do this all by themselves.
Change-Id: I9c86cee42c12a3f72ddb1d410a91cf25647d0ce6
Reviewed-on: https://pdfium-review.googlesource.com/35530
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Setting an upper limit to the size of images being processed in the
JPX fuzzer to reduce timeouts due to images just being really big.
Also cleaned the types for passing pitch down to reduce the signedness
conversions.
BUG=chromium:834561
Change-Id: I28b7a2537a922ed7a9ca2f8ed049ae78dd471f49
Reviewed-on: https://pdfium-review.googlesource.com/35570
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Remove some string copies in barcode that were noticed whilst
looking for moves.
Change-Id: Ieda34d00f633576ba1f0dca283dcdabfb36f236c
Reviewed-on: https://pdfium-review.googlesource.com/35410
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
We speculate that the bug that makes the comparison operator irreflexive
might be the cause of the segv on windows production code, should a
NaN sneak into the GraphicsData struct. In any event, should this
happen, the tree won't be correct with some nodes erroneously replaced.
Add a test which fails prior to the patch, but alas does not elicit
the segv.
Also move operator<() methods to .cpp file corresponding to .h file
in which they are delcared.
Bug: 852273
Change-Id: Ib7929881e7ffbed8b09f6e2c9fb7898cbde58946
Reviewed-on: https://pdfium-review.googlesource.com/35171
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This is similar to FPDFPath_GetMatrix(), but works on text, not path
objects.
Change-Id: If268362b7fa4398124b953e0e2225074523f5f65
Reviewed-on: https://pdfium-review.googlesource.com/35434
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
Change-Id: I4a2905f9ce4433e8c00b274fa9703ff4dc459e95
Reviewed-on: https://pdfium-review.googlesource.com/35510
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This hasn't been a big deal, since no data is copied, but avoids
some ref-count churn in the process.
Change-Id: I53c059284aa6806793c59a0c19b3e0d7fe4191d6
Reviewed-on: https://pdfium-review.googlesource.com/35350
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL merges 3 methods into a single DecodeArithOpt3(). The code is
the same, except for some constants which are extracted out as namespace
variables.
Change-Id: I6d9127d71b5e7c4c75e31a736b0f3307bb78a076
Reviewed-on: https://pdfium-review.googlesource.com/35170
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
When calling the FXSYS_wctof method we currently pass in -1 from
AdvanceForNumber. This tells the method to calculate the string length.
This can be slow for a formcalc string with a lot of numbers.
This CL changes the call to pass in the length of remaining data in the
original string. This takes the MSAN runtime of the case in the linked
bug from ~21seconds to ~500ms. The debug runtime goes from ~2s to
~500ms.
Bug: chromium:846104
Change-Id: Idbd19a728160f35982e21c0d97567fbbeefe667a
Reviewed-on: https://pdfium-review.googlesource.com/35210
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This allows compilers targeting the MS ABI to select the correct inheritance
model for the member function pointer type XFA_ATTRIBUTE_CALLBACK using the
complete type of CJX_Object. It will allow us to enable the new Clang flag
-fcomplete-member-pointers globally.
Bug: chromium:847724
Change-Id: I90cedde8c5355e5eb896a93f0e43e6a1e1d09dbc
Reviewed-on: https://pdfium-review.googlesource.com/35190
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Loop through the dirty page objects and streams and regenerate all
streams that are dirty.
Bug: pdfium:1051
Change-Id: I837b5a7cd9542b7777e7c7ae7ac9cc75f69f30b5
Reviewed-on: https://pdfium-review.googlesource.com/34330
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I020fd5ae11b32f753d681e7e0c26b7f95e920bff
Reviewed-on: https://pdfium-review.googlesource.com/15812
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
cpdfsdk_annot.cpp:315 and cpdfsdk_annot.cpp:338 are nearly identical,
except that the #ifdef XFA code passed along the correct type from
the argument. Prefer this behaviour even when non-XFA.
Change-Id: Id4d5fbcc773ffd10746c4ddc77a571e818e5a957
Reviewed-on: https://pdfium-review.googlesource.com/35030
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Bug: pdfium:1051
Change-Id: Ib3376eea32336437d148f8f9c0017d6b8f9fb556
Reviewed-on: https://pdfium-review.googlesource.com/33770
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug: pdfium:177
Change-Id: I58fe339d5a0a962215c5cb29c963b37b86832637
Reviewed-on: https://pdfium-review.googlesource.com/35113
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Bug: pdfium:177
Change-Id: I92e71fd0f2445736680e1cf9e7cc41bda8e6505e
Reviewed-on: https://pdfium-review.googlesource.com/35114
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
This CL removes all the usages of CFX_FixedBufGrow, except for one that would
cause performance issues for our corpus tests.
Bug: pdfium:177
Change-Id: I0ad76c14f713b116cf7dce50606554e3b03d9f2c
Reviewed-on: https://pdfium-review.googlesource.com/35150
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL changes GetHuffmanTable() to return a const pointer and fixes
other members / functions accordingly.
Change-Id: Ie62fe044b3156f67885dd4fa1f6512cbd35a83d3
Reviewed-on: https://pdfium-review.googlesource.com/35116
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
Bug: pdfium:177
Change-Id: Ib4de4f258ebd98a53b309c30b7e4aa28f0c581eb
Reviewed-on: https://pdfium-review.googlesource.com/35112
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: If120ee16c53117ae148447e141cbbd8143194b36
Reviewed-on: https://pdfium-review.googlesource.com/15811
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Bug: pdfium:978
Change-Id: I0dcffdfd1b19b83e5234da7791cb3f3e52cc257b
Reviewed-on: https://pdfium-review.googlesource.com/35110
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug: pdfium:177
Change-Id: I63f2e7579de37f52fd67f02988d72de7e1b3c7ba
Reviewed-on: https://pdfium-review.googlesource.com/35111
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The callers are all in blocks controlled by the same ifdef.
Change-Id: I2bf1dfd8725eefcfab5b05460fc31b0e7e08c75e
Reviewed-on: https://pdfium-review.googlesource.com/35090
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
The polymorphic IPDF_Page::GetDocument() allows getting the document
without special cases. The subsequent retrieval of the page view
via the helper function is equivalent to the inline code in the other
branch of the ifdef.
Change-Id: I8c7008c18610e11e7dcc4151fa7369cfc3625049
Reviewed-on: https://pdfium-review.googlesource.com/35070
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
GetOrCreateDefaultGraphics() has a side effect, and it needs to be
called regardless of whether a stream is generated of not. Failing
to do so causes default graphics to not exist in some cases.
Bug: pdfium:1051
Change-Id: I039cb6b755cc15c8ca667c92e581d085f3f2a124
Reviewed-on: https://pdfium-review.googlesource.com/35010
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
So remove it and combine the XFA/non-XFA cases.
Change-Id: I13d718de13ec31bf4f5c045164ea5791bf22f92d
Reviewed-on: https://pdfium-review.googlesource.com/35050
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This is a pure refactor, there should be no change in behavior. It
prepares for the next CL, which will allow modification of content
streams.
Bug: pdfium:1051
Change-Id: I01ca3e897efe423e89df75e1f31cd67539cc3d08
Reviewed-on: https://pdfium-review.googlesource.com/34470
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This is an anti-pattern when XFA can be configured at runtime.
Make it easier to find some more remaining cases.
Change-Id: I1ee8d95b2fd52be5e37ef4e859e3e9179ea25975
Reviewed-on: https://pdfium-review.googlesource.com/34990
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
From the comment of CPDF_PageObject::GetContentStream():
"""
Get what content stream the object was parsed from in its page.
This number is the index of the content stream in the "Contents" array,
or 0 if there is a single content stream. If the object is newly
created, -1 is returned.
If the object is spread among more than one content stream, this is
the index of the last one.
"""
Bug: pdfium:1051
Change-Id: I9f7804af4f263dda0422e9542e025e3320ff7c31
Reviewed-on: https://pdfium-review.googlesource.com/34250
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Now that there is a consistent underlying page type, we can unify these
actions.
Change-Id: I13fdfe775c540baaa0cd8085f8a7999fa6a3d276
Reviewed-on: https://pdfium-review.googlesource.com/34970
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
So remove the argument, and the logic dependent upon it being otherwise.
Rename function to more accurately reflect its purpose. Remove needless
null check while we're at it.
Change-Id: I7e119429fd159334eabcc250b5dac215580882ea
Reviewed-on: https://pdfium-review.googlesource.com/34950
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Make LoadDocumentImpl() logic match FPDFAvail_GetDocument() logic, so
that the XFA extension is loaded before checking unsupported features.
Add some comments along the way.
Change-Id: I040e40fcca872f7c0a46e921bce1146f0fe42588
Reviewed-on: https://pdfium-review.googlesource.com/34931
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This landed earlier as part of a larger change that got reverted for
unrelated reasons. Now re-land it by itself. See
https://pdfium-review.googlesource.com/c/pdfium/+/33370
If we don't have a document, then we can't dynamically tell if it is
an XFA doc, so there's no reason to believe it should have all permissions.
If there is an XFA doc under the covers, then the extension will give
us the value.
Change-Id: I6e007ab659914c39d2e5f3fe7a25d9d13439d358
Reviewed-on: https://pdfium-review.googlesource.com/34932
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This landed earlier as part of a larger change that got reverted for
unrelated reasons. Now re-land it by itself. See
https://pdfium-review.googlesource.com/c/pdfium/+/33370
The current code could cause FT to try to free memory allocated by the
caller, with potentially a different allocator. It appears that this may
have been added ages ago as a way to kludge around a leak. If we're
leaking, msan will find it, and we can deal with it properly rather
than trying to force FT to tidy after us.
Change-Id: I20abf4cd35d465de1f435ebe6d94b10c3ff74002
Reviewed-on: https://pdfium-review.googlesource.com/34930
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Re-landing of https://pdfium-review.googlesource.com/c/pdfium/+/32892
This time, however, we do not build on the previous CL which cached
pages. This CL by itself should be OK but was reverted only because
it was blocking earlier reverts.
Change-Id: I067d5f07373eeac6cced5d0c113ea40e5f8dcd15
Reviewed-on: https://pdfium-review.googlesource.com/34910
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL updates some of the formcal tests to use raw literals instead of
escaping lots of things.
Change-Id: I539063b6c98aae318147b7103a0fd84e6b76054f
Reviewed-on: https://pdfium-review.googlesource.com/34190
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I153747ef587a184eaef58ff09dbf8f214c9ddfb3
Reviewed-on: https://pdfium-review.googlesource.com/17230
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
Partial move, we'll clean up the engine side later.
Change-Id: I07fdae150de9e834d11ed242a7f9a007aae266ac
Reviewed-on: https://pdfium-review.googlesource.com/34810
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This more clearly shows how information is flowing out of V8
and into our C++ callbacks.
Change-Id: I5c37d2c28c166443eb9983076fbb0e944bebbf47
Reviewed-on: https://pdfium-review.googlesource.com/34790
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Because its a code smell of a sort.
Change-Id: Id1c1b124f539e31a929701fb9486da9d396d3563
Reviewed-on: https://pdfium-review.googlesource.com/34695
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Also avoids confusion with unrelated FPDF_PAGE API type.
Bug: pdfium:1085
Change-Id: I36569573f020f0b87f13630bbab91caf351e4994
Reviewed-on: https://pdfium-review.googlesource.com/34830
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Avoid explicitly finding array sizes.
Change-Id: Id51e3d10ea4db0a6375807a53309ce8d68b3b413
Reviewed-on: https://pdfium-review.googlesource.com/34750
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Avoid explicitly having to count items in arrays.
Change-Id: I24a91db45e8a8530f38afcc273e824ffb70a6cb9
Reviewed-on: https://pdfium-review.googlesource.com/34710
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Move all the checks into the shared helper functions for getting/setting
bounding boxes.
Change-Id: I6f597f478fd3510e0528d20a0a7820949600fd2a
Reviewed-on: https://pdfium-review.googlesource.com/34692
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
BUG=chromium:664730
Change-Id: Ie46221382ffed7a16366c484c249d2571c7be5c4
Reviewed-on: https://pdfium-review.googlesource.com/34696
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|