summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-10-06Roll third_party/depot_tools/ 02d534031..71e3be7a5 (141 commits; 44 trivial ↵Lei Zhang
rolls) https://chromium.googlesource.com/chromium/tools/depot_tools.git/+log/02d53403125b..71e3be7a50c2 Created with: roll-dep third_party/depot_tools TBR=hnakashima@chromium.org Change-Id: I03be03cf116ac03a7413ef68b29172866c991acf Reviewed-on: https://pdfium-review.googlesource.com/c/43592 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-06Roll tools/code_coverage/ 64186cbaf..4191ea067 (6 commits)Lei Zhang
https://chromium.googlesource.com/chromium/src/tools/code_coverage.git/+log/64186cbaf924..4191ea0675c4 Created with: roll-dep tools/code_coverage TBR=rharrison@chromium.org Change-Id: I6903c7afcfd6dbe22ac56c50b5792ad95a612968 Reviewed-on: https://pdfium-review.googlesource.com/c/43591 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-06Roll build/ dfca77bb0..eb7ca761a (27 commits)Lei Zhang
https://chromium.googlesource.com/chromium/src/build.git/+log/dfca77bb0d1a..eb7ca761a169 Created with: roll-dep build TBR=hnakashima@chromium.org Change-Id: Ib9ae41531585379025d14320ab234de05d875173 Reviewed-on: https://pdfium-review.googlesource.com/c/43590 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-06Simplify CFX_FloatRect::Inflate() and Deflate().Lei Zhang
Make all the other Inflate() methods to call the 4 parameters version. Make all the other Deflate() methods to call the 4 parameters version. Make the 4 parameters version of Deflate() call Inflate(). Change-Id: I1d2702898206bf9845f0bb176c2bf4d5a315cf96 Reviewed-on: https://pdfium-review.googlesource.com/c/43573 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-06Move CFX_FloatRect method impls out of the header.Lei Zhang
Change-Id: Ice814a84f699ea32325e98bbcea1a5b7db065fc6 Reviewed-on: https://pdfium-review.googlesource.com/c/43572 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-06Encapsulate CPDF_PageObject's rect member.Lei Zhang
At the same time, change it from 4 floats to a CFX_FloatRect. Change-Id: I00ded941723d6a264b7a17c73fd337e66b449308 Reviewed-on: https://pdfium-review.googlesource.com/c/43570 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-05Remove optional matrix parameter from CPDF_PageObject::GetBBox().Lei Zhang
Instead, add GetTransformedBBox() with a required matrix parameter and use that when the there is a matrix. Change-Id: I594f3eb6bc7e1bc3eb6aa9f66556ebb1dfdbebe1 Reviewed-on: https://pdfium-review.googlesource.com/c/43553 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-05Remove one CSection::m_pVT null checkTom Sepez
The one place we create a CSection, the argument is |this| which can not be null. Change-Id: Ia216d9d5658f695a694eb7924627c997487de623 Reviewed-on: https://pdfium-review.googlesource.com/c/43571 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-05Tidy CPVT_WordRangeTom Sepez
Change-Id: I6fea894fbf6d4865f8ca6bd70452c5730414f378 Reviewed-on: https://pdfium-review.googlesource.com/c/43551 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-05Add booleans for form flags in CPDF_FormField.Lei Zhang
Add constants/form_flags.h as well. Change-Id: If15deff6bafdf394ed975b767128d65b5d2eb0e9 Reviewed-on: https://pdfium-review.googlesource.com/c/43533 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-05Make CPDF_RenderStatus matrix params const-ref.Lei Zhang
Eliminate the possibility of nullptr. Change-Id: I16c3e442d78e5151330db7227bd1c1630af3d4a3 Reviewed-on: https://pdfium-review.googlesource.com/c/43531 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-05Remove SetSaveCalled APIRyan Harrison
This was meant to be part of a mechanism to alert users that entered data into a PDF form was not going to actually be saved how they would expect. The UI for this is blocked on a bug in V8, and is now being superseded by work to correctly implement saving. BUG=pdfium:953 Change-Id: Id9c85c109a3f6a6b4ee69d35f366006be4dc9c32 Reviewed-on: https://pdfium-review.googlesource.com/c/43552 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-10-05Add methods to read specific field flags in CPDF_FormField.Lei Zhang
Instead of reading the entire field flags value and applying bitmasks. Also read an unused setter and make a member const. Change-Id: I4ad645765ac58864b9c155ee9fe740aca4396d52 Reviewed-on: https://pdfium-review.googlesource.com/c/43532 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-05Remove unreachable null checks in CPDF_ActionFieldsTom Sepez
We always pass &local as the argument to the ctor. Change-Id: I3d6e046b8aed0a2cee3c3c20513e72b85741cabe Reviewed-on: https://pdfium-review.googlesource.com/c/43550 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-05Tidy PWL_FLOATRANGETom Sepez
Remove unused form of constructor. Initialize in header and default constructor (POD). Use std::min/max Change-Id: Ib2a37333d9f57ff2e2139a2cc1dea61416a8614b Reviewed-on: https://pdfium-review.googlesource.com/c/43476 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-04Change |virtual ~Foo(){}| to |virtual ~Foo()=default;|chromium/3571Tom Sepez
Otherwise code coverage flags the empty body as unreachable. Change-Id: Iee1d9a876d68276529c70d9b8c7a28276f271767 Reviewed-on: https://pdfium-review.googlesource.com/c/43514 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-04Remove some unused code in fxcrt strings.Tom Sepez
Unused static method in StringDataTemplate<>. Unused WideString::GetFloat(), which in turn allows us to remove another custom string to float parser. Change-Id: If7ae60a0ba90563598232bad229f97cb74d682ba Reviewed-on: https://pdfium-review.googlesource.com/c/43513 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-04Refer to const smart pointers consistently.Lei Zhang
SmartPtr<T> const m_Ptr, instead of const SmartPtr<T> m_Ptr. Change-Id: I8001b0334543f49d138a24438def62088a15c6e4 Reviewed-on: https://pdfium-review.googlesource.com/c/43512 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-04Remove unreachable code in CPDFXFA_Page.Lei Zhang
Also disambiguate LoadPDFPage() and do some cleanups. Change-Id: I591295cd5e742a14e41149b63e9d11d8c3d5b7fd Reviewed-on: https://pdfium-review.googlesource.com/c/43460 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-04Remove null m_page checks from CPDFSDK_PageView.Tom Sepez
The constructor asserts that it isn't null. Change-Id: I1812068916e8a55693387077ba3faac539172534 Reviewed-on: https://pdfium-review.googlesource.com/c/43510 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-04Make some CPWL_FontMap methods pure virtual.Tom Sepez
We never instantiate this class by itself, and these don't get called. Change-Id: Ibff1e57c93c346d038c5f9f508b601ef919a6895 Reviewed-on: https://pdfium-review.googlesource.com/c/43475 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-04Remove CPDFSDK_DateTime entirely.Tom Sepez
A previous CL has made it completely unused. Change-Id: I54d178f69ac8ea3884c89526e4d2fb81cccc0f20 Reviewed-on: https://pdfium-review.googlesource.com/c/43511 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-04CPDF_VariableText::m_nHorzScale is always 100Tom Sepez
Remove the member and simplify logic in all the places this is passed. Change-Id: I39b979793fe84f0dc460261223655dd7f50555cc Reviewed-on: https://pdfium-review.googlesource.com/c/43474 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-04CPDFSDK_AnnotHandlerMgr::Annot_OnCreate() is not called.Tom Sepez
Also Annot_OnLButtonDblClk() and Annot_OnKeyUp(). Change-Id: I0a5984fc89f73f507af520c5cf5afb115b1886ce Reviewed-on: https://pdfium-review.googlesource.com/c/43490 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-04Remove CPWL_Wnd::GetClassName() and overrides.Tom Sepez
It's only used in two tests, and there it is not essential, so save some strings and vtable space. Change-Id: If8c68e5e2580dbe588bccb942f9008efb66fe490 Reviewed-on: https://pdfium-review.googlesource.com/c/43472 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-04Remove CPWL_EditCtrl::m_pEdit null checks.Tom Sepez
It is always non-null. Move initializers to header while we're at it. Change-Id: I64f59ab1d5ffee9256f87e4712e46fb71f14ef08 Reviewed-on: https://pdfium-review.googlesource.com/c/43473 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-04Remove more uncalled methods in core/Tom Sepez
Change-Id: I10679c9d28eb495c6bc21fd1355cb3ef330a1209 Reviewed-on: https://pdfium-review.googlesource.com/c/43471 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-04Reject argument lists that are not comma separatedRyan Harrison
The FormCalc grammar explicitly calls out that argument lists must have commas separating the simple expressions that make up the elements. The current implementation will accept the invalid string !a!b!c, which is 3 variables; !a, !b, and !c. BUG=chromium:890407 Change-Id: I3e2da4abce9989e9e9b929ce2da030e0f8dfd371 Reviewed-on: https://pdfium-review.googlesource.com/c/43430 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-10-04Remove several more unused methods from core/Tom Sepez
Change-Id: I891add4e91c7ee58b34974fed6d73d17c297e759 Reviewed-on: https://pdfium-review.googlesource.com/c/43459 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-03Remove unused method CPDF_ActionFields::GetFieldsCount()Tom Sepez
Change-Id: I0299a5df10facc964d228346a438018bd3c962b4 Reviewed-on: https://pdfium-review.googlesource.com/c/43457 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-03Remove unused method CPDF_Bookmark::GetColorRef.Tom Sepez
Change-Id: I8ad38892eda7c820189924d53dacbb4c5a720e8b Reviewed-on: https://pdfium-review.googlesource.com/c/43458 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-03Remove unused methods in CPDF_DocJSActions.Tom Sepez
Tidy ctor while at it. Change-Id: I33c0751bc37e1aa840033439b4826c76d1597d4c Reviewed-on: https://pdfium-review.googlesource.com/c/43456 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-03Remove some impossible null checks from fx_crypt_sha.cppTom Sepez
We always call CRYPT_SHA*Start() with &ctx, so it can't be null. Found by inspecting code coverage report. Change-Id: Ibdca16e6a1f2d60514270fe386bf555668ec3586 Reviewed-on: https://pdfium-review.googlesource.com/c/43452 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-03Tidy CFX_UTF8Decoder.Tom Sepez
Remove unused method, make ctor/dtor out-of-line. Change-Id: I77bb7c1da8e9d369085072639ca388247f2b9225 Reviewed-on: https://pdfium-review.googlesource.com/c/43455 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-03Use numbers to test barcode encodings that do not accept letters.Henrique Nakashima
Bug: pdfium:1172 Change-Id: I8399a0add43dcb1f3269101d6ea212cfc33d3ca7 Reviewed-on: https://pdfium-review.googlesource.com/c/43454 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-10-03Remove blocklen argument from CRYPT_AESSetKey()Tom Sepez
We always pass it as 16. In turn, remove some unused code to handle the non-16 cases. Noticed while looking at coverage report. Change-Id: I93f5f0342537284ce6a2b36a8b477425da3cc872 Reviewed-on: https://pdfium-review.googlesource.com/c/43450 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-03Make CCodec_ProgressiveDecoder::ReadMoreData() slightly sanerchromium/3570Tom Sepez
- Fix buffer leak if TryRealloc fails. - Make m_SrcSize always represent the usable bytes in the buffer, even when read the last partial block from the file. - Remove redundant comparisons and use std::min(). - Better naming. Change-Id: Ie7dd79bac21b2f2422f299563a2dd28ed358e3e2 Reviewed-on: https://pdfium-review.googlesource.com/42130 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-03Reland "Make potentially dangerous Actions require a user click."Henrique Nakashima
This is a reland of 9d784c291714b703b16185e69860a3797de85b6c https://chromium-review.googlesource.com/c/chromium/src/+/1244367 was submitted changing the test that broke with this CL to not depend on PDF OpenActions anymore. Original change's description: > Make potentially dangerous Actions require a user click. > > URI and SubmitForm actions are only handled if the event was > ButtonUp or ButtonDown. > > Bug: 851821 > Change-Id: If6eb0ff44f6d62ac6df50b552c0bdc582885ab5d > Reviewed-on: https://pdfium-review.googlesource.com/42731 > Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> > Reviewed-by: Tom Sepez <tsepez@chromium.org> > Reviewed-by: Ryan Harrison <rharrison@chromium.org> Bug: 851821 Change-Id: Iaf9c399059590f0f1a050ac450e08ee60a8d5a38 Reviewed-on: https://pdfium-review.googlesource.com/43410 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-10-03Fix nits in CFX_FontSourceEnum_File.Lei Zhang
Change-Id: I116745419311b4cd37ce69c85f6ce6972d5325f4 Reviewed-on: https://pdfium-review.googlesource.com/43351 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-03Split CFX_FontSourceEnum_File into its own file.Lei Zhang
Change-Id: I85d2094f77866d18c0dce060755583ea289bb9ea Reviewed-on: https://pdfium-review.googlesource.com/43350 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-03Add FxFolderHandleCloser for use with std::unique_ptr.Lei Zhang
Use it in a couple of places. Make the similar code in the two places even more so. Change-Id: I3fc6a567088217e24506cdf7ab927b94cb5a4d52 Reviewed-on: https://pdfium-review.googlesource.com/43330 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-03Simplify CFX_FontSourceEnum_File's file iterator.Lei Zhang
Break the methods down to their basic functionality, and built up from there. Change-Id: I691abaf08375425b59f2382cf95577c3917aca9d Reviewed-on: https://pdfium-review.googlesource.com/42972 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-02Clean up some XFA forward declarations.Lei Zhang
Change-Id: I2d30ceb5e475290c0842fe4add7ffb965dc77572 Reviewed-on: https://pdfium-review.googlesource.com/c/43316 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-02Avoid overloading CFGAS_FontMgr::LoadFont().Lei Zhang
Rename the internal one LoadFontInternal. Remove unused out parameter. Change-Id: Ia108bc4fc29ef0ad7732eacad9bb924a8e424c2e Reviewed-on: https://pdfium-review.googlesource.com/c/43317 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-02Make CFGAS_DefaultFontManager a class with only static methods.Lei Zhang
It has no member variables. Change-Id: I25b333e201d76e90d25e3f526cf23bccd2b4687a Reviewed-on: https://pdfium-review.googlesource.com/c/43315 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-02Reduce includes in cfgas_defaultfontmanager.hLei Zhang
Do IWYU elsewhere, and unindent CFGAS_DefaultFontManager::GetFont(). Change-Id: Idb06c4ae75ce2d72b231cc4c84f61e5ca8a80cc5 Reviewed-on: https://pdfium-review.googlesource.com/c/43314 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-02Remove unneeded cfgas_fontmgr.h includes.Lei Zhang
Fix IWYU issues in affected files. Change-Id: I92c145348549d2d0f0e066e134e649b3b958e068 Reviewed-on: https://pdfium-review.googlesource.com/c/43313 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-02Consolidate ReadMoreData() calls.Tom Sepez
Extract some dividends from having landed the previous CL. Change-Id: I9ade77c801b51762cab801716b9fd2bc4c634036 Reviewed-on: https://pdfium-review.googlesource.com/c/41990 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-02Remove ability to delete annot in CJS_Document::removeField()Tom Sepez
This path has only been present under XFA, and has resulted in several bugs, including the referenced one. There is a breakage in some XFA functionality, but I'm not confident we can do this without re-engineering all of fpdfsdk widget ownership. Bug: 891210 Change-Id: I5aa158fa5359b1c8338046eefb25fb25df9ace48 Reviewed-on: https://pdfium-review.googlesource.com/c/43311 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-02Use smart pointers in CPDF_PageRenderCache.Lei Zhang
Use std::unique_ptr and MaybeOwned, instead of manual memory management. Change-Id: I5f08abd869245fb55b7e868621369ff3ea34146f Reviewed-on: https://pdfium-review.googlesource.com/43211 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>