Age | Commit message (Collapse) | Author |
|
Change-Id: I0481774858a9d9823580e1207807e35be8a9eea9
Reviewed-on: https://pdfium-review.googlesource.com/36270
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
Bug: chromium:868477
Change-Id: I5957c5ef051bc4fa8eb51efa6a7fc142996742c5
Reviewed-on: https://pdfium-review.googlesource.com/39130
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
BUG=chromium:828177
NOTRY=true
Change-Id: I30123087bbe11aaaa6175b5f729b7ab55107a975
Reviewed-on: https://pdfium-review.googlesource.com/38902
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Change-Id: Ib22db6c57d2066ef70c0ef12e44d1e5eee6611a5
Reviewed-on: https://pdfium-review.googlesource.com/36410
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Because it is a stronger pattern at runtime.
These were found by essentially: grep -ni '\bassert\b.*type'
Change-Id: I913d77139053e8980528597a6633e1859e5204c4
Reviewed-on: https://pdfium-review.googlesource.com/38890
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Remove |kInvalidHeaderOffset|.
Change-Id: I5978e745e97aa4e13299dd21028721725ac0c996
Reviewed-on: https://pdfium-review.googlesource.com/38853
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Art Snake <art-snake@yandex-team.ru>
|
|
Replace with CFX_BufferSeekableReadStream, which allows for spans and
const inputs.
Change CXFA_DocumentParser to take IFX_SeekableReadStream instead of
IFX_SeekableStream in the process.
Change-Id: I0168451350c9fc250231f0414c38738a4d86ca42
Reviewed-on: https://pdfium-review.googlesource.com/38852
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Clearer that just using indexing off of raw pointers, and makes the
code more closely resemble other functions.
Change-Id: I7cc8363b505e66120bc1c686bb23b2bdf8fc401f
Reviewed-on: https://pdfium-review.googlesource.com/38894
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Ib9e20fdfc637b2ba0358586e23ad72454b0b8ad1
Reviewed-on: https://pdfium-review.googlesource.com/38851
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
- CPDF_SyntaxParser can no longer be initialized multiple times.
- Make the file length and header offset const.
- Make the header offset type FX_FILESIZE consistently.
- Simplify for the common case where the header offset is 0.
Change-Id: I7138db1fbcec3b7578b0239b92fc1154fa4dc4ce
Reviewed-on: https://pdfium-review.googlesource.com/38850
Reviewed-by: Art Snake <art-snake@yandex-team.ru>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Sample PDF:
https://yadi.sk/d/oWLtAEfy3YbEb3
For offsets, equal to the hint stream offset, added hint stream
length to determine the actual offset, because linearization
inserted the hint stream at the original location of the object.
Also the number of bits needed to represent the numerator of
the fractional position for each shared object reference may be
zero, if each shared group contains only one object with obj num,
incremented on 1.
Change-Id: I4754d603f388354821e8d0cac97ad99a7578fe4b
Reviewed-on: https://pdfium-review.googlesource.com/36610
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
We should use document size instead of File size,
because all offsets and sizes was read from document should
take into account of header offset.
Added some tests of parsing of documents with header offset.
Also drop friendship of CPDF_SyntaxParser with CPDF_Parser.
Change-Id: Iebec75ab2ee07fb644a6c653b4ef5c2e09af09fe
Reviewed-on: https://pdfium-review.googlesource.com/35830
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Return encryption dictionary as const reference
from CPDF_Parser.
Create a copy in CPDF_Creator if needed.
Change-Id: I270f71d307d818fba7f65ebe379f5942ae816934
Reviewed-on: https://pdfium-review.googlesource.com/38390
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
Move writing logic into implementation of related clases.
Change-Id: If70dc418b352b562ee681ea34fa6595d6f52eee3
Reviewed-on: https://pdfium-review.googlesource.com/36350
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I0743c34f0206f85828570430edb9f62b6b0cdbb5
Reviewed-on: https://pdfium-review.googlesource.com/37315
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
Use CPDF_SyntaxParser logic to rebuild crossref.
Change-Id: I394f64e76294b97c6a7c2b8984a880712fd193a7
Reviewed-on: https://pdfium-review.googlesource.com/37314
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
Picks up some enhancements from base/span.h. In turn, also adds
the size_bytes() helper. Differs from base version in that it
works around C++14 enable_if_t<>, and avoids the dynamic_extent
template specialization tricks.
Use it in a few places where appropriate.
Change-Id: I86f72cf0023f2d4317a7afa351fddee601c8f86c
Reviewed-on: https://pdfium-review.googlesource.com/38251
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Ia5a4e89bff8a1dbc46246f5a734170765b7ee74e
Reviewed-on: https://pdfium-review.googlesource.com/38250
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
BUG=chromium:851994
Change-Id: I2e14401271c70afa204221e0f3d469f0b82ce8cf
Reviewed-on: https://pdfium-review.googlesource.com/37871
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Art Snake <art-snake@yandex-team.ru>
|
|
Use const_cast for the non-const version to call the const version.
Change-Id: Ibdf5fe53255ee6e983555080336f5d63e683afd1
Reviewed-on: https://pdfium-review.googlesource.com/37490
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I354e8bed12606abdc67427bbc7928e3b1f11e243
Reviewed-on: https://pdfium-review.googlesource.com/35433
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Use own copy of encryption dictionary within CPDF_Parser,
to prevent modification of original trailer.
Change-Id: I6246b872d431b94411fcec694c5176f8d85dfe26
Reviewed-on: https://pdfium-review.googlesource.com/35450
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
In CPDF_ScaledRenderBuffer::Initialize(), use the existing
CFX_DIBitmap::CalculatePitchAndSize() function to figure out the pitch
and size. Unlike the existing code, CalculatePitchAndSize() does a
better job of checking for integer overflows.
BUG=pdfium:1123
Change-Id: Ic8fe7226bc56fed0456486d88e02a7af2928bc94
Reviewed-on: https://pdfium-review.googlesource.com/38010
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Remove checks for impossible conditions.
Change-Id: I7a6607675899bfde6179e93da0c9139dfec19984
Reviewed-on: https://pdfium-review.googlesource.com/38070
Reviewed-by: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I57f89b9f2a8ef3f351e7574a76d6064ffde150d3
Reviewed-on: https://pdfium-review.googlesource.com/37870
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I3686bd3d28a84aae39c750a371902e1e5d62b365
Reviewed-on: https://pdfium-review.googlesource.com/37050
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Use std::vector<> as a manager for contiguous buffers.
Change-Id: Icaacbd4b7010b928237aa71485411ade7539412a
Reviewed-on: https://pdfium-review.googlesource.com/37012
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: Ibf09905523ae2d80ce48bfe7337733d8dc718669
Reviewed-on: https://pdfium-review.googlesource.com/37850
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
- FPDFPageObj_RemoveMark()
Bug: pdfium:1037
Change-Id: I7ff320261d64e3ead45375ccc72301e7c64dd6e3
Reviewed-on: https://pdfium-review.googlesource.com/37710
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug: pdfium:1037
Change-Id: Ia2cd0d6ef99495dda3289988123489e3a2ad6e82
Reviewed-on: https://pdfium-review.googlesource.com/37750
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Change-Id: I6fa3fd93638bc3aeaaef854676fe31476888433b
Reviewed-on: https://pdfium-review.googlesource.com/37671
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Commit {Insert later} removed the last caller to this method.
Change-Id: I1689b33486396cc3a41139f984f819b39ab02b2a
Reviewed-on: https://pdfium-review.googlesource.com/35130
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Merge shared objects related data into CPDF_HintsTable::SharedObjGroupInfo.
Change-Id: I53bb7fc42ea6bcd26b3ebf91b8c6aa402108d086
Reviewed-on: https://pdfium-review.googlesource.com/15830
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
This is a reland of 77f15f7883638a4ced131d74c053af10a5970ce9
Original change's description:
> Avoid duplicate data buffering in CPDF_SyntaxParser::ReadStream().
>
> Allow sub-streams created from an IFX_SeekableReadStream to provide
> stream data without copying memory.
> The data will only reside in the top-level stream.
>
> For example:
> For file
> http://www.major-landrover.ru/upload/attachments/f/9/f96aab07dab04ae89c8a509ec1ef2b31.pdf
> (18 Mb)
>
> The memory usage is reduced by ~13 Mb.
>
> Change-Id: I2595c014d0fbe1fdd181cc04965cfd7d901c2d88
> Reviewed-on: https://pdfium-review.googlesource.com/35930
> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
> Reviewed-by: dsinclair <dsinclair@chromium.org>
Change-Id: I4c4d5dcf42ff44784468ac7a7c302df509fc804d
Reviewed-on: https://pdfium-review.googlesource.com/37313
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
The marked content operators are BMC, BDC and EMC. In the case of
BDC, it is preceded by a direct dict or a property name.
Bug: pdfium:1118
Change-Id: I3ee736ff7be3e7d7dde55ef581af3444a325e887
Reviewed-on: https://pdfium-review.googlesource.com/37470
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
The name of the property is now stored in the CPDF_ContentMarkItem,
which will be needed to properly write back these content marks
after a change in the stream.
Bug: pdfium:1118
Change-Id: I1296f488b35ee0684efa33d17400ed22a88383a2
Reviewed-on: https://pdfium-review.googlesource.com/37370
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Bug: pdfium:1118
Change-Id: I457a52196ee177a09d33d9e025a094888be3fb60
Reviewed-on: https://pdfium-review.googlesource.com/37610
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
One version is for a mark without a dictionary. The second is for
a mark with a direct dictionary. The third is for a mark with
indirect properties.
Bug: pdfium:1118
Change-Id: Ice0ff11d5ba4eaf2ccdf57be49b9140ba5c9b159
Reviewed-on: https://pdfium-review.googlesource.com/37550
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Do not return size within CPDF_StreamAcc in case when read
data failed.
Also free buffers in this case.
Bug: chromium:860210
Change-Id: Ifb2a061d7c8427409b68c33f213c5c55343fb946
Reviewed-on: https://pdfium-review.googlesource.com/37310
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
Currently, not necessary to store the cross ref v5 obj within
CPDF_IndirectObjectHolder(CPDF_Document), because all
necessary data from the cross ref are parsed or cloned, and
owned by CPDF_Parser seperately from CPDF_IndirectObjectHolder.
Also this fix regression from commit 4ea4459e.
BUG=chromium:810768
Change-Id: I0d1a11ff027210f4f15804a69d12416838ec9815
Reviewed-on: https://pdfium-review.googlesource.com/37110
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
This CL creates the following new functions in the public API:
- FPDFPageObj_AddMark
- FPDFPageObjMark_SetIntParam
- FPDFPageObjMark_SetStringParam
Bug: pdfium:1037
Change-Id: Icabf3fdd8e8153b9156bab807a3708d38a9365d8
Reviewed-on: https://pdfium-review.googlesource.com/37330
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Move the code to select what it points at to a separate function, so the
CPDF_StreamContentParser constructor only sets it once.
Change-Id: I60013e77c8f37246282f94227a4aeb17270ee23c
Reviewed-on: https://pdfium-review.googlesource.com/37450
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL allows Apple to use m_GlyphIndex as a replacement for m_ExtGID
when it is invalid.
Bug: pdfium:1121
Change-Id: I49e7936201815bae5a2c8a26680fc1e542a60c43
Reviewed-on: https://pdfium-review.googlesource.com/37390
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
This avoids copying the CPDF_ContentMark every time a mark is closed.
Another benefit is that the same CPDF_ContentMarkItem vector will be
shared by page objects before and after a nested mark.
Bug: pdfium:1037
Change-Id: I6197f0b9a4693ef84da9269f86a2629aa50d8685
Reviewed-on: https://pdfium-review.googlesource.com/37190
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
It is currently a vector of CPDF_ContentMarkItem.
Copying MarkData whenever a content mark is opened or closed is
inefficient since each MarkData will have copies of the same
CPDF_ContentMarkItems.
This CL changes the vector inside MarkData to contains only pointers
to the CPDF_ContentMarkItems rather than copies of those items. More
importantly, this unifies the dictionaries of each content mark.
Previously, there were as many copies of those dictionaries as content
marks scope changes inside the mark with parameters.
Bug: pdfium:1037
Change-Id: Ia6f79b401d4e14ac07dbba81bbd97df965b77c94
Reviewed-on: https://pdfium-review.googlesource.com/37135
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This reverts commit 77f15f7883638a4ced131d74c053af10a5970ce9.
Reason for revert: Causes crbug.com/860210
Bug: chromium:860210
Original change's description:
> Avoid duplicate data buffering in CPDF_SyntaxParser::ReadStream().
>
> Allow sub-streams created from an IFX_SeekableReadStream to provide
> stream data without copying memory.
> The data will only reside in the top-level stream.
>
> For example:
> For file
> http://www.major-landrover.ru/upload/attachments/f/9/f96aab07dab04ae89c8a509ec1ef2b31.pdf
> (18 Mb)
>
> The memory usage is reduced by ~13 Mb.
>
> Change-Id: I2595c014d0fbe1fdd181cc04965cfd7d901c2d88
> Reviewed-on: https://pdfium-review.googlesource.com/35930
> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
> Reviewed-by: dsinclair <dsinclair@chromium.org>
TBR=tsepez@chromium.org,dsinclair@chromium.org,art-snake@yandex-team.ru
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I947fca17052765935a952a4f25ca48f6599c4af9
Reviewed-on: https://pdfium-review.googlesource.com/37210
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Bug: chromium:845800
Change-Id: Ib878dd991e435a76b63b662ef3d9d33c2cc61a19
Reviewed-on: https://pdfium-review.googlesource.com/37191
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Bug: pdfium:1037
Change-Id: I94efc14ce5f8d0d407853cce025f0184b3866cc4
Reviewed-on: https://pdfium-review.googlesource.com/37134
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This is called by many client to make sure CountItems() does not
crash. Moving the check to CountItems() makes HasRef() unnecessary.
Bug: pdfium:1037
Change-Id: I4f21f33a88c9aad54f0dae18a38b370c6ceaec80
Reviewed-on: https://pdfium-review.googlesource.com/37133
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
A RetainPtr is already used inside SharedCopyOnWrite, and the API
that CPDF_ContentMark offers is not intuitive. AddMark() and
RemoveLastMark() currently copy the MarkData.
The new API does not perform these copies, but rather leaves it to
the client code.
This is the first step to make CPDF_ContentMarkItems modifiable. As
long as they are inside a SharedCopyOnWrite, they cannot be changed.
Bug: pdfium:1037
Change-Id: I0cd6334b0b8db62070b4412f1d6d1c88bce9891f
Reviewed-on: https://pdfium-review.googlesource.com/37132
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|