Age | Commit message (Collapse) | Author |
|
Also make more core/fxcrt/xml member variable names consistent in style.
Change-Id: I892841b4026df302aa28f754441bf21707e96764
Reviewed-on: https://pdfium-review.googlesource.com/c/44171
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Remove some variables named "string" to avoid false positives from the
linter.
Change-Id: I00a53e6970451fd0cea8ab2f8178183650ca00d2
Reviewed-on: https://pdfium-review.googlesource.com/42810
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change check to use empty instead of size <= 0. Also added a comment
to the check to make it clear what is being guarded against
BUG=chromium:863098
Change-Id: I993085c04ab66a9e2869c83d8fb48883ec0bbf71
Reviewed-on: https://pdfium-review.googlesource.com/39497
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Currently the parser will accept arbitrary garbage before the first
element begins. This is causing issues with ClusterFuzz since it
generates a lot of trash inputs which take a long time to parse
inspite of being invalid.
This CL adds in a check of how deep the parse is when dealing with
text, and if it is at the top level scope, then only accept the
beginning of the root node.
BUG=chromium:863098
Change-Id: Ie45114ecf488f7e8a68a120d153033c7089d5cdc
Reviewed-on: https://pdfium-review.googlesource.com/39470
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
All usages were previously checked correctly, but this consolidates
some code as well.
Change-Id: I63711748b31b698a3f21f98fdb536db1e9e0b1cf
Reviewed-on: https://pdfium-review.googlesource.com/39010
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Introduces checks in a few new places, but mainly just consolidates
checking/casting logic.
Change-Id: I634a03060d254db099972c6978249992367e146c
Reviewed-on: https://pdfium-review.googlesource.com/38900
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@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>
|
|
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 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>
|
|
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 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>
|
|
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>
|
|
This CL fixes the return type of CFX_XMLParser::GetStatus to correctly
return bool instead of int32_t.
Change-Id: Ifa0d24b8aad55c4cf63ddf7cfc8eee48bf8431bf
Reviewed-on: https://pdfium-review.googlesource.com/30290
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL allows the CXFA_SimpleParser to retrieve the XML tree from the
CFX_XMLDoc. This way, we don't have to keep the doc around and can store
the pointer to the tree in the CXFA_SimpleParser.
Change-Id: I5b478acbe61e6f1ca5fa04d03133a2b327a0cb1c
Reviewed-on: https://pdfium-review.googlesource.com/30210
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
The CFX_XMLParser was a wrapper around the CFX_XMLSyntaxParser. This CL
merges the SyntaxParser into protected/private methods if the XMLParser.
Change-Id: If1519b5de55866ed14359dffd64dc12c36ee0244
Reviewed-on: https://pdfium-review.googlesource.com/30171
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL cleans up minor nits in the CFX_XMLParser code.
Change-Id: Ie19d12d3dcce16c9ce6088160ecdec3d9855c11f
Reviewed-on: https://pdfium-review.googlesource.com/30170
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the code for verifying and creating checksums associated
with form elements in XFA documents. This was the only code requiring
the SAXReader which has also been removed.
According to the XFA spec and application can decide which parts of the
signatures are supported. This feature is being removed until we
determine if/when it is needed.
Bug: pdfium:1063
Change-Id: Iec2261282340f8fc72a1225d2e0d3e6ddf05edcb
Reviewed-on: https://pdfium-review.googlesource.com/30150
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes unused methods from CFX_XMLNode, adds an AppendChild to
handle the case of a -1 index to InsertChildNode, removes the
InsertChildNode return value which is unused and cleans up various other
things.
Change-Id: I3a022e4dc2afffa6893ad11014034dd7ed301f13
Reviewed-on: https://pdfium-review.googlesource.com/26510
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I3efc57cd7325d16e3ca8ebdeeaec06012b2c56e3
Reviewed-on: https://pdfium-review.googlesource.com/20110
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL renames CFX_RetainPtr to RetainPtr and places in the fxcrt
namespace.
Bug: pdfium:898
Change-Id: I8798a9f79cb0840d3f037e8d04937cedd742914e
Reviewed-on: https://pdfium-review.googlesource.com/14616
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Automated using git grep & sed.
Replace StringC classes with StringView classes.
Remove the CFX_ prefix and put string classes in fxcrt namespace.
Change AsStringC() to AsStringView().
Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*,
Foo).
Couple of tests needed to have their names regularlized.
BUG=pdfium:894
Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d
Reviewed-on: https://pdfium-review.googlesource.com/14151
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This CL removes the fx_basic.h header and fixes up includes as needed.
Change-Id: I49af32a8327bdbcda40c50a61ffbd75d06609040
Reviewed-on: https://pdfium-review.googlesource.com/12670
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This Cl cleans up more IFX_Pause parameters which are always null.
Change-Id: Ia48600f06216db64a2db8e6e97222a91bd4ba149
Reviewed-on: https://pdfium-review.googlesource.com/4890
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
This CL moves the XML parser from FDE into FXCRT and renames to CFX_
from CFDE_.
Change-Id: I21a9590bf74daf5517df630d7e7a5de89da99ea4
Reviewed-on: https://pdfium-review.googlesource.com/4312
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|