summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-10-16Make {A85,RunLength}Encode()'s buffer out parameter a unique_ptr.Lei Zhang
Change-Id: I3f06ea7ed39c8a8fff57e07f14ff6c21bedbc028 Reviewed-on: https://pdfium-review.googlesource.com/c/43998 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-16Use unique_ptr and span in CPDF_Image::SetImage().Lei Zhang
Fix lint errors as well. Change-Id: I139528b8e76383f878915f9ec940b0af29e155f0 Reviewed-on: https://pdfium-review.googlesource.com/c/44071 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-15Split pdfium_embeddertests sources.chromium/3582Lei Zhang
Move foo_embeddertest.cpp to the same BUILD.gn file as foo.cpp. Set up dependencies to make pdfium_embeddertests pass gn check. Change-Id: If1fe67c261960c35c344c1047950cd7fdb32c4a1 Reviewed-on: https://pdfium-review.googlesource.com/c/43997 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-15Move fx_skia_device_unittest.cpp to pdfium_embeddertests.Lei Zhang
It uses fpdfsdk/ and public/ code from core/. Also sort some conditionals in BUILD.gn. Change-Id: I4da9dc1f1833fa6644be3da1a935beba1d57cb2f Reviewed-on: https://pdfium-review.googlesource.com/c/43996 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-15Split pdfium_unittests sources.Lei Zhang
Move foo_unittest.cpp to the same BUILD.gn file as foo.cpp. Set up dependencies to make pdfium_unittests pass gn check. Change-Id: Id9f649d5d0c76fe4254f3887778516abb75fcbce Reviewed-on: https://pdfium-review.googlesource.com/c/43995 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-15Split public/ headers into their own source_set.Lei Zhang
This removes some allow_circular_includes_from entries. Change-Id: I276d211a0f45f460b4814560533f0cb83d681613 Reviewed-on: https://pdfium-review.googlesource.com/c/43994 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-15Restrict fxcrt's visibility to third_party.Lei Zhang
Change-Id: I4b4b1a8e78e2405791aca915e4d48a88e79444d5 Reviewed-on: https://pdfium-review.googlesource.com/c/43993 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-15Clone dict before iteration in CJS_Document::get_infoTom Sepez
Bug: 895152 Change-Id: I678350841892f88a5d580b58a33a639a1b6ec305 Reviewed-on: https://pdfium-review.googlesource.com/c/44050 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-15Use CropBox instead of ArtBox or TrimBoxxlou
FPDFPage_Flatten() used ArtBox as the BBbox of the newly created XObject, which in some situation, some content of the generated PDF are not visible. FPDF_ImportNPagesToOne() uses TrimBox as the BBbox of the newly created XObject, which in some cases, MediaBox and CropBox are scaled up, however TrimBox is not, which caused some content of the newly generated N-upped PDF not visible. Hence for the above two situations, we have chosen to use mostly commonly used CropBox. Bug:409670 Change-Id: Ifb82a6f881d7ce1802cf23c7e8e6f11cc76bf3e9 Reviewed-on: https://pdfium-review.googlesource.com/c/43987 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Shirleen Lou <xlou@chromium.org>
2018-10-15Convert %s -> %ls for wide string error format.Tom Sepez
Make JavaScript tests results correct across platforms. Change-Id: I32e5621f9f37ebb67e45c30ef7b22ea88a3a40af Reviewed-on: https://pdfium-review.googlesource.com/c/44030 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-15Make core/ pass gn check.Lei Zhang
Use allow_circular_includes_from as a crutch for now. Change-Id: Ia7a29a268e67b1fe21bed5cdd629e06fb5cc7bfb Reviewed-on: https://pdfium-review.googlesource.com/c/43992 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-15Use more UnownedPtr in CPDF_FormControl.Lei Zhang
To make this work, remove an UnownedPtr vector in CPDF_FormField and make CPDF_InteractiveForm manage it instead. Also simplify some code within CPDF_FormControl and CPDF_InteractiveForm. Change-Id: Ifc3a979dcdb992376a48db7a40840d2e76078500 Reviewed-on: https://pdfium-review.googlesource.com/c/43938 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-15Move CPDF_ModuleMgr methods into cpdf_modulemgr.cpp.Lei Zhang
Some of them were implemented in core/fpdfapi/cmaps. Reorder CPDF_ModuleMgr private methods as well. Change-Id: I88b7c48049de83591c961dd9a74e01fefb211c0c Reviewed-on: https://pdfium-review.googlesource.com/c/43991 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-15Make ":pdfium" pass gn check.Lei Zhang
Change-Id: I41861ae949f44475a13f67e7cb8fb6e186cd6732 Reviewed-on: https://pdfium-review.googlesource.com/c/43990 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-15Stop shadowing codec memory size with CCodec_ProgressiveDecoder::m_SrcSizeTom Sepez
This is a remnant from the old implementation which can get out of sync with the actual value, esp. in the fuzzers where buffers are shorter-lived. Bug: 895009 Change-Id: Ibf16dad58dd750c961e3b446f12cb2197004dbb4 Reviewed-on: https://pdfium-review.googlesource.com/c/44010 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-15Make fxjs/ pass gn check.Lei Zhang
Use allow_circular_includes_from as a crutch for now. Change-Id: I8c53bafd864048506a77354f57e27cac50369005 Reviewed-on: https://pdfium-review.googlesource.com/c/43989 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-15Make fpdfsdk/ pass gn check.Lei Zhang
Use allow_circular_includes_from as a crutch for now. Change-Id: I58e90da4b71a22dd54fd59e8d644b6eef740d4cd Reviewed-on: https://pdfium-review.googlesource.com/c/43988 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-15Make xfa/ pass gn check.Lei Zhang
Use allow_circular_includes_from as a crutch for now. Change-Id: I1aad3276a6fd571071270090235b0cfb625e337b Reviewed-on: https://pdfium-review.googlesource.com/c/43986 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-15Make FlateEncode()'s buffer out parameter a unique_ptr.Lei Zhang
Change-Id: I31a5abb3c8dd31826098493f51effbd5afe109d1 Reviewed-on: https://pdfium-review.googlesource.com/c/41856 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-13Fix span / unique_ptr destruction order in PDF_DataDecode().chromium/3581chromium/3580Lei Zhang
BUG=chromium:895026 Change-Id: Ie7d8bfd6e42308c3531ce6637ad29ec2231a2095 Reviewed-on: https://pdfium-review.googlesource.com/c/43984 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-13Make testing/ pass gn check.Lei Zhang
Change-Id: Ifb2d60bf3c2d86a105705196d65e318081cefe4e Reviewed-on: https://pdfium-review.googlesource.com/c/43981 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-13Fix v8 ToLocalChecked() failure in CJS_Runtime.Lei Zhang
BUG=chromium:894938 Change-Id: I3d1ca33eec4cd2b01bfa4dfce7da3642dd5ad31b Reviewed-on: https://pdfium-review.googlesource.com/c/43983 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-13Add missing config to core/fxcrt:seekablemultistream target.Lei Zhang
Should have been part of commit e421d384. TBR=tsepez@chromium.org Change-Id: I042c1c85f915798dd393f5ea136edb86d644ca11 Reviewed-on: https://pdfium-review.googlesource.com/c/43982 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-12Add setters/getters for BleedBox and TrimBox.xlou
Since BleedBox and TrimBox are supported according to PDF specification, hence added setters and getters to get the value if exists. Bug:894655 Change-Id: I3c2600450f07665241a4724457a7cbc4282941ed Reviewed-on: https://pdfium-review.googlesource.com/c/43977 Commit-Queue: Shirleen Lou <xlou@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-12Beef up coverage in CJS_Field.Tom Sepez
Still a long way to go, but hit the easy ones first. Alphabetize property names in cjs_field.cpp file. Change-Id: I1ede770a1e159d464287775cf9e19cbaf9f2a62f Reviewed-on: https://pdfium-review.googlesource.com/c/43978 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-12Split core/fpdfapi build rules into various sub-directories.Lei Zhang
Change-Id: I98e2e913f11ff63e70cb841de00a4f56b06ca03b Reviewed-on: https://pdfium-review.googlesource.com/c/43974 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-12Make core/fxcrt pass gn check.Lei Zhang
Split some XFA-only code into their own targets to avoid circular dependencies. Make CFX_SeekableMultiStream XFA-only. Change-Id: I88f49556623d52dddd4d0013cc3308b694c01d42 Reviewed-on: https://pdfium-review.googlesource.com/c/43973 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-12Do IWYU in xfa.Lei Zhang
Change-Id: Ia104471caffe79f92d439920baeea37a71c71c50 Reviewed-on: https://pdfium-review.googlesource.com/c/43971 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-12Beef up CJS_Document method coverage.Tom Sepez
Also alphabetize mailDoc method position in .cpp file. Change-Id: Ifb53e9a6f5f165bb41b865d51dae15e3bc84c4c7 Reviewed-on: https://pdfium-review.googlesource.com/c/43972 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-12Split core/fxcrt build rules into core/fxcrt/BUILD.gn.Lei Zhang
Change-Id: I9b3608bd76ec4911a4bb820fcda62c5d9533fb4f Reviewed-on: https://pdfium-review.googlesource.com/c/43947 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-12Add test for CJS_Annot JS callbacks.Tom Sepez
Change-Id: I8ef9bb333e786e833faca75566730a5b441d63c2 Reviewed-on: https://pdfium-review.googlesource.com/c/43830 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-12Remove more unnecessary includes and do IWYU as needed.Lei Zhang
Also move some implementations out of headers. Change-Id: I321fc26970c440d874b135bd28e8bc8156b9afee Reviewed-on: https://pdfium-review.googlesource.com/c/43890 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-12Split most core build rules into various BUILD.gn files in core.Lei Zhang
Change-Id: I773eec2bbf104f073eba7a64ed19f6fba0131d21 Reviewed-on: https://pdfium-review.googlesource.com/c/43946 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-10-12Move core/fdrm/crypto/* to core/fdrm/.Lei Zhang
core/fdrm/ currently only contains the crypto directory. Change-Id: I68f4a38e7098f8a3bdc19764bc1ec78c28a386c9 Reviewed-on: https://pdfium-review.googlesource.com/c/43945 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-12Split constants and testing build rules into their own BUILD.gn files.Lei Zhang
Change-Id: I3a100e1f009f18ee06959edf47d189d1bfdcb25a Reviewed-on: https://pdfium-review.googlesource.com/c/43944 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-10-12Add test for CJS_Color properties.Tom Sepez
Return a more precise error in one case. Change-Id: I21e4ef6b30be5f44d35922640643bffb9cb4b5e4 Reviewed-on: https://pdfium-review.googlesource.com/c/43950 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-12Add tests for CJS_Console methods.Tom Sepez
Change-Id: Ie534b26d8241e889ad9cdca942e142cddca44bf4 Reviewed-on: https://pdfium-review.googlesource.com/c/43933 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-12Split fpdfsdk build rules into various BUILD.gn files in fpdfsdk.Lei Zhang
Change-Id: I3500ab9a9bbf0ec983e02dd4b739c9b199d71e21 Reviewed-on: https://pdfium-review.googlesource.com/c/43943 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-10-12Split fxjs build rules into fxjs/BUILD.gn.Lei Zhang
Change-Id: I7d9d5bb14a4a2b11afeab0da25bad35322560d3b Reviewed-on: https://pdfium-review.googlesource.com/c/43942 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-10-12Split xfa build rules into various BUILD.gn files in xfa/.Lei Zhang
Change-Id: I3e6624d0e7af6c4f7ec9674d5990ae25cc3954d0 Reviewed-on: https://pdfium-review.googlesource.com/c/43941 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-10-12Slightly simplify CPDF_FormField's notify methods.Lei Zhang
Change-Id: I5eaa286d8cd0920cfb73f3ca0dacc1800affc6b6 Reviewed-on: https://pdfium-review.googlesource.com/c/43936 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-12Rename CPDF_{Array,Dictionary}::GetCount() to size().Lei Zhang
Make them compatible with pdfium::CollectionSize(). Change-Id: Ibef3b182e35a7eca7c656cf590462782de0cc157 Reviewed-on: https://pdfium-review.googlesource.com/c/43937 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-12Forward declare more in codec code.Lei Zhang
Change-Id: I8060ada299f845a9198a6e83d31d128bd4bf09bc Reviewed-on: https://pdfium-review.googlesource.com/c/43870 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-12Remove redundent ASSERT + if checks in CPDF_FormControl.Lei Zhang
Change-Id: Iedaf9447513d7142359771c81c49f03f8bca28d7 Reviewed-on: https://pdfium-review.googlesource.com/c/43935 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-12Split fxbarcode build rules into fxbarcode/BUILD.gn.Lei Zhang
Enable GN check for fxbarcode and make it pass. Change-Id: I696a97b90113b65ae5c7f8aa18185328c4640251 Reviewed-on: https://pdfium-review.googlesource.com/c/43940 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-10-12Add minimal pixel test for a rendering bug.Lei Zhang
The test is suppressed because it currently renders incorrectly. BUG=pdfium:632 Change-Id: Ie780e2128ef3a0bcf5f7d57b164ae38f03b1e9fd Reviewed-on: https://pdfium-review.googlesource.com/c/43090 Reviewed-by: Nicolás Peña Moreno <npm@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-12Fix naming for CPDF_FormField::Type enum.Lei Zhang
The preferred Google C++ style is kFoo. Change-Id: I167b147aab91245a4dfce1185008f0b412078260 Reviewed-on: https://pdfium-review.googlesource.com/c/43934 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-12Mark the bigint target as XFA only.chromium/3579Lei Zhang
Depend on it directly from the only user, fxbarcode. Change-Id: I303dc7b0e713d683257fb3d893e74fdd40ac2046 Reviewed-on: https://pdfium-review.googlesource.com/c/43939 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-12Make PDF_DataDecode()'s buffer out parameter a std::unique_ptr.Lei Zhang
Change-Id: Id8f7473c590ef94799d0dd29f5de790a453c86f6 Reviewed-on: https://pdfium-review.googlesource.com/c/42603 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-11Fix some nits in CJS_Document helpers.Lei Zhang
Change-Id: Iad2eaf53fcca2d4eee92760cdbd6da2869695d56 Reviewed-on: https://pdfium-review.googlesource.com/c/43831 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>