summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-09-20Make some methods const in XFAJSEmbedderTestchromium/3560chromium/3559chromium/3558Nicolas Pena
This CL addresses the published draft comment from https://pdfium-review.googlesource.com/c/pdfium/+/5691/ Change-Id: I7a2cd9aa5dbdde18cadb82cbef70f0e8820cc276 Reviewed-on: https://pdfium-review.googlesource.com/42871 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
2018-09-20Roll testing/corpus/ 2ddedb263..19feefee4 (1 commit)Lei Zhang
https://pdfium.googlesource.com/pdfium_tests/+log/2ddedb263bd5..19feefee44bd Created with: roll-dep testing/corpus TBR=tsepez@chromium.org Change-Id: I053e08d6d9fa668daa4f0a71dd6e9dc6822fe7b0 Reviewed-on: https://pdfium-review.googlesource.com/42813 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-20Validate some image data in CPDF_Image::InitJPEG().Lei Zhang
Change-Id: I55e840667acfda831488d75efc97504355813dd1 Reviewed-on: https://pdfium-review.googlesource.com/42850 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-09-20Use pdfium::Optional with FPDF_Doc_Save().Lei Zhang
Also rename it to DoDocSave(), since it is not a public API. Change-Id: I88992d12d1b7826c621de0b88692ab33f6d83a06 Reviewed-on: https://pdfium-review.googlesource.com/42815 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-09-20Change CFX_FixedBufGrow to take a size_t.Lei Zhang
Thanks to Qihoo 360 Vulcan Team for pointing this out. Change-Id: Ib6dd77307b3759e54168127dc0e17aa42698d852 Reviewed-on: https://pdfium-review.googlesource.com/42830 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-20Remove extraneous 'extern "C"' entries.Lei Zhang
Also remove dead code found along the way, and fix lint errors. BUG=pdfium:410 Change-Id: I4cd0ede516483209cf49a6686d909953ab196106 Reviewed-on: https://pdfium-review.googlesource.com/42771 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-20Fix misc lint errors and other cleanups.Lei Zhang
Change-Id: I00ce0109251d1231858e87ffc3889abe6937fa26 Reviewed-on: https://pdfium-review.googlesource.com/42811 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-09-20Remove more unneeded STL #includes from headers.Lei Zhang
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>
2018-09-20Remove many unneeded STL #includes from headers.Lei Zhang
Change-Id: I7010cedee8d17d05b2c37a94d767e6f3a9c48f7d Reviewed-on: https://pdfium-review.googlesource.com/42790 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-19Use MaybeOwned in CPDF_StreamAcc.chromium/3557Lei Zhang
Change-Id: Iba886e51cf34ea01ed0d93afc93c8ec0ffed4f52 Reviewed-on: https://pdfium-review.googlesource.com/42594 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-09-19Roll testing/corpus/ 6cd71979b..2ddedb263 (1 commit)Lei Zhang
https://pdfium.googlesource.com/pdfium_tests/+log/6cd71979b56e..2ddedb263bd5 $ git log 6cd71979b..2ddedb263 --date=short --no-merges --format='%ad %ae %s' 2018-09-19 thestig Add Skia xfermode test output to testing corpus. Created with: roll-dep testing/corpus TBR=hnakashima@chromium.org BUG=pdfium:1152 Change-Id: I492a1260455d4355469ffe9eaf90be367d2932c2 Reviewed-on: https://pdfium-review.googlesource.com/42770 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-19Consolidate raw data processing path in CPDF_StreamAcc.Lei Zhang
Add ProcessRawData() and ProcessFilteredData() helper methods for the consolidated branches. Change-Id: I88fb0ffb76e5d354bc311490a9d995e07fbc2174 Reviewed-on: https://pdfium-review.googlesource.com/42593 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-09-19Initialize CPDF_ImageRenderer in the header.Lei Zhang
Also add a GetRenderOptions() helper method. Change-Id: I47db7a21f55f396e08775575f6b2a48e440c2f91 Reviewed-on: https://pdfium-review.googlesource.com/42750 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-09-19Encapsulate CPDF_ImageLoader.Lei Zhang
Change-Id: Iee7ce04630fed86f651cd382a19e46b2f7ab6d61 Reviewed-on: https://pdfium-review.googlesource.com/42672 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-19Validate decoder pipelines.Lei Zhang
PDF decoders, AKA filters, can be chained together. There can be an arbitrary number of decoding / decompressing filters in the pipeline, but there should be at most 1 image decoder, and the image decoder should only be at the end of the chain. BUG=chromium:880675 Change-Id: Iffa27c70ec1ed7574e38e0de23413840ee900959 Reviewed-on: https://pdfium-review.googlesource.com/42711 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-18Change signature of FPDFPageObjMark_Get(Name|ParamKey).chromium/3556Henrique Nakashima
These methods used to return the size of the buffer to contain the value to be returned. Now they will return an FPDF_BOOL to make it consistent with the other mark APIs and more intuitive to differentiate a success from a failure. The size will be returned through an out param. This CL also adds more focused testing for these API methods and similar ones. Change-Id: I6f9837f99d955aaba2c49a259ed7805a286e091d Reviewed-on: https://pdfium-review.googlesource.com/42411 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-09-18Transfer ownership of nodes to top-level XML docRyan Harrison
For XFA, XML nodes are owned by the XML doc that they were created by, but references to them are stored elsewhere. For a PDF document there is one top-level XML document created and retained when the initial XFA XML is parsed. Another can be created if loadXML is called by JS. In the existing code the XML doc that owns the newly created nodes is local to loadXML. So the nodes are destroyed right after putting refernces to them into the main XFA data structures. This CL adds in a method to transfer ownership of the XML nodes from one doc to another, and uses it to correctly retain the newly created nodes, by having them owned by the top-level XML doc. BUG=chromium:884664 Change-Id: Id29b4edbfe44aefb9713328e4e217e830f7e9e14 Reviewed-on: https://pdfium-review.googlesource.com/42690 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-09-18Encode mark names when writing to file.Henrique Nakashima
Bug: pdfium:1150 Change-Id: I7e589fb3d164dfc9b39a7a3f6e782c09331cc32d Reviewed-on: https://pdfium-review.googlesource.com/42630 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-09-18Roll third_party/freetype/src/ f8af8fba7..dfddc2d97 (14 commits)Lei Zhang
https://chromium.googlesource.com/chromium/src/third_party/freetype2.git/+log/f8af8fba78ac..dfddc2d97596 Created with: roll-dep third_party/freetype/src BUG=pdfium:1153 TBR=npm@chromium.org Change-Id: Ia1359184f0290cd0a04487a50e43b61c5971ab30 Reviewed-on: https://pdfium-review.googlesource.com/42671 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-17Make fxcrt::Retainable non-copyable.Tom Sepez
Because copying ref-counts from one object to another is a bad idea and sure to leak. Change-Id: I5f2c0891d08c893eb1ac8fb8a5908d975295ae2e Reviewed-on: https://pdfium-review.googlesource.com/42670 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-09-17Check for empty streams earlier in CPDF_StreamAcc::LoadAllData().Lei Zhang
Change-Id: I91c8d7d837e4c2104d56d725c16a28d49399aaca Reviewed-on: https://pdfium-review.googlesource.com/42592 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-09-17Replace CJS_GlobalVariableArray::Copy() with operator=().Tom Sepez
Change-Id: I71794f87a99f9dcbb04296f42e8a5cd55656bd90 Reviewed-on: https://pdfium-review.googlesource.com/42615 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-09-17Make CBC_CodeBase::SetWideNarrowRatio() not virtual.Lei Zhang
Make CBC_Writer::SetWideNarrowRatio() virtual instead. Do the same for SetStartChar(), SetEndChar(), and SetErrorCorrectionLevel(). Change-Id: I70e87c0e9f8b772331105e57dd26075db3cfcb95 Reviewed-on: https://pdfium-review.googlesource.com/42602 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-09-17Extract duplicate code into GetShadingSteps().Lei Zhang
Change-Id: I6761a5f7fc099807c09abacdccbb72d282252551 Reviewed-on: https://pdfium-review.googlesource.com/42604 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-09-17Remove a check that is never true in CJBig2_ArithDecoder::Decode().chromium/3555Lei Zhang
Change-Id: I538fd8bf9905be61d2297181bd02a243a01b30db Reviewed-on: https://pdfium-review.googlesource.com/42607 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-09-17Use more booleans within JBig2ArithCtx.Lei Zhang
Change-Id: I41535238715926795f5c588dcae0834bf3a789d0 Reviewed-on: https://pdfium-review.googlesource.com/42606 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-09-17Remove CPDF_StreamAcc::m_pSrcData.Lei Zhang
It just ends up being a nullptr, so it is not useful. Change-Id: I52fcbb261c4bb0bc024e1856da95028431d577c1 Reviewed-on: https://pdfium-review.googlesource.com/42591 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-09-17Make CBC_CodeBase::SetTextLocation() not virtual.Lei Zhang
Make CBC_Writer::SetTextLocation() virtual instead. Change-Id: I9ac06affe35f3c7bebc2f5ff0917e7146cfe89cc Reviewed-on: https://pdfium-review.googlesource.com/42601 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-09-17Make JBig2ArithCtx a class.Lei Zhang
For better encapsulation. Change-Id: Ia6fd8056112d97d672b91a9a521a2978c807060f Reviewed-on: https://pdfium-review.googlesource.com/42605 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-17Fix final/protected conflicts.Tom Sepez
Classes marked |final| should not have |protected| members. In turn, "private field m_dwEncryptObjNum is not used" warning is produced. Change-Id: I51a96aca5a5f499381a6764d892962f7f2dc0327 Reviewed-on: https://pdfium-review.googlesource.com/42611 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-09-17Make CBC_CodeBase::SetTextLocation() virtual.Lei Zhang
Do the same for a few other CBC_CodeBase methods, instead of trying to implement virtual methods manually using memory pointers. Change-Id: Iec0e3a4f8eabc54962c7ac0a00a1b80b192ff474 Reviewed-on: https://pdfium-review.googlesource.com/42600 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-17Initialize some 1D barcode classes in the header.Lei Zhang
Change-Id: Iaeb7f43e442ace403f1522268e63b1a59f223a9d Reviewed-on: https://pdfium-review.googlesource.com/42599 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-17Remove BCExceptionInvalidateCharacter.Lei Zhang
Change-Id: Ia165095864ffe2865a5e433d09d0bccad1164d2c Reviewed-on: https://pdfium-review.googlesource.com/42453 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-17Encapsulate CPDF_StreamAcc::LoadAllData().Lei Zhang
Make it a private method, and add public methods so only limited combinations of LoadAllData() arguments are possible. Change-Id: I8c2220eb0e95012350858876586f7c470c40a7c3 Reviewed-on: https://pdfium-review.googlesource.com/42590 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-17Remove deprecated FPDFPage_CountObject().Lei Zhang
FPDFPage_CountObjects() is the straight-forward replacement that has been available for a year. Change-Id: I64cd379f81234d8295bfcaf9b6effe3467f100d6 Reviewed-on: https://pdfium-review.googlesource.com/42451 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-15Roll v8/ 19afaa143..41562c7c5 (415 commits)chromium/3554Lei Zhang
https://chromium.googlesource.com/v8/v8.git/+log/19afaa1436ef..41562c7c52bd Created with: roll-dep v8 TBR=hnakashima@chromium.org Change-Id: I210263c82dfa3c8d341069975a07368535d9592e Reviewed-on: https://pdfium-review.googlesource.com/42598 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-15Roll tools/clang to 9bd40b25b.Lei Zhang
Need to roll build/ to match. https://chromium.googlesource.com/chromium/src/tools/clang/+log/13b165992adf..9bd40b25b05f https://chromium.googlesource.com/chromium/src/build.git/+log/4755315a..f53effa7 TBR=hnakashima@chromium.org Change-Id: Ib819c1ea1375a9af61b4ba3a0d38261539475c9a Reviewed-on: https://pdfium-review.googlesource.com/42597 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-09-15Roll third_party/libjpeg_turbo/ 7260e4d8b..61a2bbaa9 (4 commits)Lei Zhang
https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git/+log/7260e4d8b8e1..61a2bbaa9aec Created with: roll-dep third_party/libjpeg_turbo TBR=hnakashima@chromium.org Change-Id: I72dc2838e650f849e52900c3666ef7ac9d0b436a Reviewed-on: https://pdfium-review.googlesource.com/42596 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-15Roll DEPS for catapult to 9f36d9f7Lei Zhang
https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git/+log/c61a0380..9f36d9f7 TBR=hnakashima@chromium.org Change-Id: Id5bd0cd43aa355a5cd35838e252828bec321ac86 Reviewed-on: https://pdfium-review.googlesource.com/42595 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-15Remove FXFM_ENCODING_NONE.Lei Zhang
FX_CreateFontEncodingEx() always passes FXFM_ENCODING_NONE. Just get rid of it instead. Change-Id: I417f84d8ae2f10ba874265a92576d3ef8481a9d6 Reviewed-on: https://pdfium-review.googlesource.com/42460 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-15Remove dead CBC_QRCoderEncoder code.Lei Zhang
Change-Id: I096ba8681d779bb0cc1d7aaaedcd9f68020d5b37 Reviewed-on: https://pdfium-review.googlesource.com/42452 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-15Use ScopedFPDFStructTree in tests.Lei Zhang
Change-Id: Ia457942238ca2a9f48210c080a93412c09ae932c Reviewed-on: https://pdfium-review.googlesource.com/42570 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-14Use pdfium::Optional in CFGAS_GEFont.Lei Zhang
Change-Id: I1fe90d94ed782f59745dc47e38cda561c5b5ac47 Reviewed-on: https://pdfium-review.googlesource.com/42512 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-14Add CPDF_Document::StockFontClearer.Lei Zhang
So CPDF_Document's dtor does not have to do any explicit cleanup. Change-Id: Iaec7d18f67422914542fc1dc5f3b1b5a9cf5ffc5 Reviewed-on: https://pdfium-review.googlesource.com/42551 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-09-14Use MakeUnique() in CFFL_InteractiveFormFiller.Tom Sepez
Remove more bare |new|s. Change-Id: Ia26bb8150d5bb0004c6a8e6ff89b4694b9ef2865 Reviewed-on: https://pdfium-review.googlesource.com/42552 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-09-14Use unique_ptr<> in CJS_GlobalVariableArray::Add().Tom Sepez
Clean up another ten bare |new|s or so. Change-Id: If32b307e5edd844488dfb2020e710214bb6f75a0 Reviewed-on: https://pdfium-review.googlesource.com/42550 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-09-14Use fxcrt::MaybeOwned in CFGAS_GEFont.Lei Zhang
Change-Id: Ie1f4763e37832475a60c55b26263405e0bbf09b3 Reviewed-on: https://pdfium-review.googlesource.com/42510 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-09-14Use UnownedPtr in CFX_UnicodeEncoding.Lei Zhang
Change-Id: I410909be359a5b5bb0c90d42064144771183525e Reviewed-on: https://pdfium-review.googlesource.com/42461 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-09-14Revert "Disable FPDFEditEmbeddertest.AddCIDFontText"Tom Sepez
This reverts commit 725f544776a6ee96a514a91dffd39aa32ecca3e6. Reason for revert: <INSERT REASONING HERE> Original change's description: > Disable FPDFEditEmbeddertest.AddCIDFontText > > Bug: pdfium:1151 > Change-Id: Ib8b0f8165389ce1a1aa96652685dab14eac6bdfd > Reviewed-on: https://pdfium-review.googlesource.com/42412 > Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> > Commit-Queue: Tom Sepez <tsepez@chromium.org> TBR=tsepez@chromium.org,hnakashima@chromium.org,rharrison@chromium.org Change-Id: I8a27fe9c5d678f6a041542f3be3a3bade857753a No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: pdfium:1151 Reviewed-on: https://pdfium-review.googlesource.com/42530 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-09-14Clean up CFGAS_GEFont members.Lei Zhang
Remove unused members and initialize the rest in the header. Change-Id: Ic2122fc1d49024632b9ebd4cb490c14dd0724de6 Reviewed-on: https://pdfium-review.googlesource.com/42491 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>