Age | Commit message (Collapse) | Author |
|
Also make destructors private for RetainPtr sub-classes, and add missing
destructors.
Change-Id: I451bf0aae2dae943b1f450d0aa4ca5124dc578fd
Reviewed-on: https://pdfium-review.googlesource.com/32853
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Import Chromium's base/compiler_specific.h from r537069.
Now that FALLTHROUGH is available via compiler_specific.h, remove
FX_FALLTHROUGH.
Change-Id: I8b9631a4f007673e10e0c26951dfd61e9dcada30
Reviewed-on: https://pdfium-review.googlesource.com/32639
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Currently the PartitionRealloc code path will only exit, with no
option to return nullptr on failure, unlike PartitionAlloc code path.
This CL refactors the realloc code path to be similar to alloc code
path, following the upstream patch:
https://chromium-review.googlesource.com/c/chromium/src/+/1044971
This also changes the version of realloc exposed to third party C libs
to have the nullptr behaviour, like the exposed version of alloc.
This CL is a redo of
https://pdfium-review.googlesource.com/c/pdfium/+/31990
BUG=chromium:783022
Change-Id: Ib1b659079585dfd0423d683b8a2c7b6758a22a01
Reviewed-on: https://pdfium-review.googlesource.com/32613
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Chris Palmer <palmer@chromium.org>
|
|
Use the system ICU header when USE_SYSTEM_ICUUC is defined.
Change-Id: Ieeb0e4a11ae86da871644dd0fd84de07e9917fde
Reviewed-on: https://pdfium-review.googlesource.com/32490
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
The CFX_BidiLine class is just a thin wrapper to hold a set of methods.
This CL moves the methods into the anonymous namespace and calls them
directly from FX_BidiLine.
Change-Id: Iea2ba178fb08339445702c9af4251f3c8ba2beb6
Reviewed-on: https://pdfium-review.googlesource.com/32617
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL verifies that the provided BidiPos is within the acceptable size
for the vector before accessing.
Bug: chromium:843100
Change-Id: I2955a3ca628b19ee51dd4233726b859729c125af
Reviewed-on: https://pdfium-review.googlesource.com/32593
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
When detecting the exponent on a floating point number, cap the maximum
amount we'll multiply by otherwise we can get excessivly large numbers.
Bug: chromium:843074
Change-Id: I6a8d1b4c20b66e305d2727f464119b1e74beb699
Reviewed-on: https://pdfium-review.googlesource.com/32570
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL switches the usage of wcstod to use the FXSYS_wcstof to
determine if a given string is a valid floating point number.
Using the internal method makes linux slightly slower (10's of ms)
makes mac a lot faster 900ms to 60ms for the test case in the bug.
The FXSYS_wcstof method has been extended to handle the parsing of
float exponents. Unittests were added for FXSYS_wcstof.
Bug: chromium:813646
Change-Id: Ie68287a336e3b95a0c0b845d5bf39db6fc82b39c
Reviewed-on: https://pdfium-review.googlesource.com/32510
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL converts several asserts in the FX_Bidi code to continue instead
of asserting in the face of unexpected input.
A BIDI fuzzer has been added as well.
Bug: chromium:839695
Change-Id: If61f822bde7442c008d50be58f7cecffb6e5d658
Reviewed-on: https://pdfium-review.googlesource.com/32191
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL modifies the formcalc transpiler to create less CFX_WideTextBuf
classes as we convert to JavaScript. This can take some pathalogical
formcal from 20sec to convert to .5sec.
Bug: chromium:834575
Change-Id: I428883297bbc3a6a325a4ab0ad51834f2f02ab82
Reviewed-on: https://pdfium-review.googlesource.com/32154
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Avoids scrolling past this noise when looking at document code.
No functional changes.
Change-Id: I4684a8cf4d8894c699cd1c980bc5fc41b2179ad1
Reviewed-on: https://pdfium-review.googlesource.com/32156
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This existing code has the potential for an integer overflow in it.
When overflow occurs in this function scaling may partially succeed.
This is due to how out of range values are being clamped, which
implicitly swallows the overflow.
This CL changes the calculation to be performed in a 64-bit space and
then attempts to down cast it back to 32-bit space at the end. Because
there are multiple steps it is possible for an intermediate value to
cause an overflow in 32 bit space, but the final value to be valid. If
the downcast is not possible then the stretch operation is failed.
An existing test case has been updated, since it encoded an incorrect
result.
BUG=chromium:839245
Change-Id: I637cc1e2d6c6c2d5394599104f76352c20ead021
Reviewed-on: https://pdfium-review.googlesource.com/32056
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This CL moves several of the member variables to
CFX_XMLParser::DoSyntaxParse as they are only used in that method. The
names of the members have been updated to make their usage clearer.
Change-Id: I460f2bad0181ece278752bd8d93d6bf63dc6d70a
Reviewed-on: https://pdfium-review.googlesource.com/32050
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This CL moves the switch from CFX_XMLParse::Parse into
CFX_XMLParser::DoSyntaxParse. This means all the work to build the tree
is now done in one place instead of spread between the two methods.
Change-Id: Ie9c6cd67795c3fcbd3e305187a06cd727d386a7c
Reviewed-on: https://pdfium-review.googlesource.com/31950
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL renames ParseTextChar to ProcessTextChar to make the usage
clearer. The method does not do any parsing, it just decides if the char
is part of an entity or not.
Change-Id: I9b70a82a421b02e2352cd07bd88b1e581d8578b7
Reviewed-on: https://pdfium-review.googlesource.com/31930
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL adds a CFX_XMLDocument to act as the XML node container. All
nodes are now owned by the document and the document is returned by the
CFX_XMLParser.
Classes which parse XML files now store the document instead of the root
node.
BUG: chromium:835636
Change-Id: I1e07d6115cf14714911d6fd4c3fa920c94fd5faf
Reviewed-on: https://pdfium-review.googlesource.com/31313
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
- Refer to the string in CFX_BidiString by const-ref.
- Remove useless CharAt() method.
- Turn a member variable into a local variable.
Change-Id: I30f221b7350150c839a793129789d8ea7cc1f331
Reviewed-on: https://pdfium-review.googlesource.com/31670
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL fixes issues with handling XML instructions in CXFA_DocumentParser.
Unittests were added to verify the behaviour.
Change-Id: Iff8d51d0e6d411419473c9b2c32c700d4bbf86f5
Reviewed-on: https://pdfium-review.googlesource.com/31810
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL fixes several issues in the CFX_XML class and
adds unit tests.
Change-Id: I05270690de8f3c45dceb866e17ef899ae6d23389
Reviewed-on: https://pdfium-review.googlesource.com/31753
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
When we extract the text data we need to make sure we clear any
entity start positions, otherwise our entity extraction will go badly.
Bug: chromium:836661
Change-Id: Icbafdef912b1f5b495eafef426961c5df66cd3fd
Reviewed-on: https://pdfium-review.googlesource.com/31450
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL removes the m_NodeStack member from the CFX_XMLParser. Instead
of using the node stack we retrieve the parent by getting the current
childs parent.
Change-Id: I0c4c220d14e35c5b6edc5c9c6a3008368f2d550a
Reviewed-on: https://pdfium-review.googlesource.com/31290
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the m_CurNodeType member from CFX_XMLParser. This was,
essentially, duplicating the m_XMLNodeTypeStack. We now use the top() of
the stack element to find the same information.
Change-Id: I26507d2eee954837210aa42919ff061cfc8e85d8
Reviewed-on: https://pdfium-review.googlesource.com/31277
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This CL removes the usage of CFX_BlockBuffer from CFX_XMLParser. The
block buffer has been replaced by a vector which is emptied out after
the characters are removed. This should use less memory when parsing XML
as the block buffer was previously storing all text characters seen in
the file.
Change-Id: I89568c664c762bb9feb034348524e5e86c2d9078
Reviewed-on: https://pdfium-review.googlesource.com/31275
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL converts the CFX_XMLParser to use the FXSYS methods to convert
decimal and hex chars during entity conversion.
Change-Id: I7f6c83fc528e95c9f4c2bcdb04f0066da2c15c09
Reviewed-on: https://pdfium-review.googlesource.com/31274
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
The methods to get a piece of data from the text buffer are all
identical. This CL collapses them all into a single GetTextData method.
Change-Id: Ibd2ace9023a3707505c4c80c6aeb01af666445d9
Reviewed-on: https://pdfium-review.googlesource.com/31273
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This CL moves most initialization of CFX_XMLParser into the header file
and re-organizes the members to group members together better.
Change-Id: I49031ea65dc0d68c9b47cffe942c65f488bbaf20
Reviewed-on: https://pdfium-review.googlesource.com/31250
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL changes CFX_SeekableStreamProxy to be an IFX_SeekableReadStream
subclass.
This is a reland of https://pdfium-review.googlesource.com/c/pdfium/+/30879
after fix bad merge.
Change-Id: Iad58abe7e065541867f202059a944e9be4da5713
Reviewed-on: https://pdfium-review.googlesource.com/31195
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL changes CFX_XML to use an IFX_SeekableWriteStream instead of
the more generic IFX_SeekableStream.
This is a reland of https://pdfium-review.googlesource.com/c/pdfium/+/30877
without pulling in the XML lifetime changes.
Change-Id: I5091da6ad37715fff77f3f22d35ab0105f2bc3d0
Reviewed-on: https://pdfium-review.googlesource.com/31194
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This reverts commit 9a3a7709103a872037dcea1f3cf0b7785a3da191.
Reason for revert: Gerrit did not do what I expected....
Original change's description:
> Change CFX_XML Save to take a write stream
>
> This CL changes CFX_XML to use an IFX_SeekableWriteStream instead of the more
> generic IFX_SeekableStream.
>
> Change-Id: I6e4def380c43eca755d91ad5cb6146c2dfdaee10
> Reviewed-on: https://pdfium-review.googlesource.com/30877
> Commit-Queue: dsinclair <dsinclair@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
TBR=tsepez@chromium.org,dsinclair@chromium.org,hnakashima@chromium.org
Change-Id: I137e53bf93285b88ade6832dedefca66e3b61e13
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://pdfium-review.googlesource.com/31211
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This reverts commit c6077a0164340fa084be03eb059d608bc2675b2b.
Reason for revert: Gerrit did not do what i expected.
Original change's description:
> Make CFX_SeekableStreamProxy a subclass of IFX_SeekableReadStream
>
> This CL changes CFX_SeekableStreamProxy to be an IFX_SeekableReadStream
> subclass.
>
> Change-Id: I28ccb4771606fd6c9cc60e57297ae2e776fc5a9f
> Reviewed-on: https://pdfium-review.googlesource.com/30879
> Commit-Queue: dsinclair <dsinclair@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
TBR=tsepez@chromium.org,dsinclair@chromium.org,hnakashima@chromium.org
Change-Id: I65e7647221e9bad2c0db7d068638178996972437
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://pdfium-review.googlesource.com/31210
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL changes CFX_SeekableStreamProxy to be an IFX_SeekableReadStream
subclass.
Change-Id: I28ccb4771606fd6c9cc60e57297ae2e776fc5a9f
Reviewed-on: https://pdfium-review.googlesource.com/30879
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL changes CFX_XML to use an IFX_SeekableWriteStream instead of the more
generic IFX_SeekableStream.
Change-Id: I6e4def380c43eca755d91ad5cb6146c2dfdaee10
Reviewed-on: https://pdfium-review.googlesource.com/30877
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Use a ByteString object to store the returned value of
WideString.UTF8Encode() instead of using a ByteStringView object
to store the returned value of WideString.UTF8Encode().AsStringView().
Bug: chromium:834149
Change-Id: I8fa8dd7920140730c0417c188572d7b53e4ffb48
Reviewed-on: https://pdfium-review.googlesource.com/30890
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Also tidy AsSpan() for Byte/Wide strings.
Change-Id: I1853d31a59bc7f46de81295cde2e1062b91badec
Reviewed-on: https://pdfium-review.googlesource.com/30911
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Get bounds checking "for free".
Change-Id: Ic60d63836f6c223e2ee1262649d47da54bb30ecc
Reviewed-on: https://pdfium-review.googlesource.com/30876
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Cleanup formatting and unused variables in the CFX_XML classes.
Change-Id: I1aff6317a3da38a141a071ba69c7893d0f669732
Reviewed-on: https://pdfium-review.googlesource.com/30730
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL sets the CFX_XML tree ownership. The pointers set into the tree
must be unique_ptrs and the CFX_XMLNode children are set to be either
unique_ptrs or UnownedPtrs.
Change-Id: Ib0db495c81471e40f5b4533503f7bbe5a784fd77
Reviewed-on: https://pdfium-review.googlesource.com/30711
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the CFX_SeekableStreamProxy constructor which accepts a data
pointer as it is unused.
Change-Id: I1340ebdf1f85ab1dd6c7cd1b5fdebe796c07115e
Reviewed-on: https://pdfium-review.googlesource.com/30858
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL changes the CFX_XMLParser to accept an IFX_SeekableStream intead of a
CFX_SeekableStreamProxy.
Change-Id: I3534288a8a00095acd78a60bf6b925c6a0357892
Reviewed-on: https://pdfium-review.googlesource.com/30856
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL fixes up some cfx_seekablestreamproxy includes and adds a helper to the
xmlparser tests.
Change-Id: If1b67dee51b49fa39527274f6c68da5ec673704f
Reviewed-on: https://pdfium-review.googlesource.com/30854
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the abliity to write to the seekable stream proxy class.
Change-Id: I0eda2619714df190d326c23dfdcd4527d4312779
Reviewed-on: https://pdfium-review.googlesource.com/30853
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL converts the CFX_XML Save methods to take an IFX_SeekableStream instead
of a CFX_SeekableStreamProxy.
Change-Id: I6b3f6acc9f51e73b3c863b965b4dcdcbd25ba949
Reviewed-on: https://pdfium-review.googlesource.com/30850
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This reverts commit 3d523e3cf89440e2ffc6571b1c687ad5e3f0318f.
Fixes bounding errors now caught by tests.
Change-Id: I4d0f1791bdcc45a10615a62abf7a4d20e7e538f2
Reviewed-on: https://pdfium-review.googlesource.com/30799
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This reverts commit 0d32b8fda53e02c1036d39f7290d4f59f2b58ca4.
Restore behaviour on trunk.
TBR: dsinclair@chromium.org
Change-Id: Ia867f09ae9d2885595c4d9b300a058431dfd84f2
Reviewed-on: https://pdfium-review.googlesource.com/30811
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
CFX_XMLElement is the only subclass of CFX_XMLAttributeNode. This CL
merges the two classes together. The {Set|Get}String method has been
renamed to {Set|Get}Attribute to make it clearer what you're retrieving.
Change-Id: I158c961d4d8c5f563d937a3e7a35321a33622562
Reviewed-on: https://pdfium-review.googlesource.com/30710
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Avoids some weirdness in mac toolchain with external templates
and Operator() = default; instantiation.
Change-Id: Ieec5dc08ad559752278a6f1de8fc69aad2b4e30c
Reviewed-on: https://pdfium-review.googlesource.com/30810
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This reverts commit 154e18f9a862975abecebe77b8f5fb418418d14c.
Reason for revert: Generate CL to merge to beta branch
Original change's description:
> Return pdfium::span<wchar_t> from WideString::GetBuffer().
>
> Adds bounds checking "for free", but beware of span outliving
> a ReleaseBuffer() call. Scoping as such avoids the possibility
> of using an invalid span (and it is flagged as a lifetime issue).
>
> Change-Id: Ica63f4b1429823d0254ec6951aeaeb08160cb93c
> Reviewed-on: https://pdfium-review.googlesource.com/30310
> Reviewed-by: dsinclair <dsinclair@chromium.org>
> Commit-Queue: Tom Sepez <tsepez@chromium.org>
TBR=tsepez@chromium.org,dsinclair@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ie1ec9434215584a024538ca8edeb59dea555af48
Reviewed-on: https://pdfium-review.googlesource.com/30830
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This CL removes the GetNumbericSymbol method and adds individual methods
for each symbol we retrieve.
Change-Id: Id14108e5ea43a76250e18a1aa13bdbb05e928cdc
Reviewed-on: https://pdfium-review.googlesource.com/30695
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL deletes the CXML parser as it is no longer used.
Change-Id: Ic4815b683515ee860a6ae5c7ca39e15573e584bc
Reviewed-on: https://pdfium-review.googlesource.com/30694
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL converts CXFA_XMLLocale to use CFX_XML instead of CXML.
Change-Id: I1db617a658548ae5979f2f38d72c5b3000998663
Reviewed-on: https://pdfium-review.googlesource.com/30693
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|