summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-10-25Add android_nov8 builder to the default try job set.Lei Zhang
TBR=tsepez@chromium.org Change-Id: I4630986f13f352aba4b57268bdf48eb1406770a6 Reviewed-on: https://pdfium-review.googlesource.com/c/44546 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Fix CPLW_Wnd ownership model in CFFL_FormFiller.Tom Sepez
CFFL_FormFiller::DestroyPDFWindow() might get re-entered, so do not leave any dangling references in maps. Use unique_ptr to be more sure that we have it right. Bug: chromium:898531 Change-Id: I7b61940ff4e88c8a7e3219fefb0479f33bbbfae1 Reviewed-on: https://pdfium-review.googlesource.com/c/44542 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-24Clean up CFX_ImageTransformer parameters.Lei Zhang
- A valid matrix is always passed in, so make the parameter const-ref. Since it is not obvious who owns the passed in matrix, make a copy with the corresponding matrix member. - Since the matrix parameter is const-ref, CFX_DIBBase::TransformTo() can also have a const-ref matrix parameter. - |flags| should be uint32_t, since |m_Flags| is. - |pClips| is only used inside the ctor, so remove |m_pClip|. Change-Id: If3d58a3fd28fa72b4ac7caac15f49a8057c594db Reviewed-on: https://pdfium-review.googlesource.com/c/44541 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Remove FXDIB_BLEND_UNSUPPORTED.Lei Zhang
The blend mode is never set to this value. Change-Id: I96cbadb055137a9de45f0082c81a7b8aedb9a427 Reviewed-on: https://pdfium-review.googlesource.com/c/44544 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Initialize CPDF_GeneralState::StateData in the header.Lei Zhang
Change-Id: I7049073c09ac87ef8041bfa51740c653a67b4bd3 Reviewed-on: https://pdfium-review.googlesource.com/c/44543 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Use ASSERT() consistently. Replace assert() usage.Lei Zhang
ASSERT() is PDFium's wrapper for cross-platform wrapper for assert(). Change-Id: Ie2a98a8e1de101f93aa9bf667d6f125d11d129cd Reviewed-on: https://pdfium-review.googlesource.com/c/44539 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-24Assert CPDF_Image::m_pDocument is never nullptr.Lei Zhang
Remove a check that will never be true. Change-Id: I6474cb7f6549f412a368d1920fd0af90eae9a700 Reviewed-on: https://pdfium-review.googlesource.com/c/44540 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Make CPDF_PathObject::m_Path private.Lei Zhang
Change-Id: I5c42af8e9e2d6a60648d291153326aef04e4c49e Reviewed-on: https://pdfium-review.googlesource.com/c/44513 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-24Make CPDF_PathObject::m_FillType private.Lei Zhang
Change-Id: I69436316dd4a12ebdc3f09e7db3bf25c7495a4ce Reviewed-on: https://pdfium-review.googlesource.com/c/44512 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-24Make CPDF_PathObject::m_bStroke private.Lei Zhang
Remove some setters on newly constructed objects, since |m_bStroke| is already initialized to false. Change-Id: I8d04efec997226fb86091566eea96604f18680aa Reviewed-on: https://pdfium-review.googlesource.com/c/44511 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-24Start making CPDF_PathObject members private.Lei Zhang
Also move member initialization to the header. Change-Id: I557380ae774ddf887cefeb56df2a33e5b7cff8a4 Reviewed-on: https://pdfium-review.googlesource.com/c/44510 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-24Add CFX_Matrix::AsTuple().chromium/3591Lei Zhang
Change-Id: I53c1b148cb8cdc77461766fc9996a0a3ce5f4cb7 Reviewed-on: https://pdfium-review.googlesource.com/c/44536 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Implement FPDFImageObj_GetMatrix().Lei Zhang
BUG=pdfium:1183 Change-Id: I5b1051d8924264aa12534466ee51b2718b3eca67 Reviewed-on: https://pdfium-review.googlesource.com/c/44514 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Implement FPDFPageObj_GetLineCap().Lei Zhang
Add unit tests for FPDFPageObj_[GS]etLineCap(). BUG=pdfium:1186 Change-Id: I3df907713a8846fd7481300c5caf102293f381ba Reviewed-on: https://pdfium-review.googlesource.com/c/44516 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-24Implement FPDFPageObj_GetLineJoin().Lei Zhang
Add unit tests for FPDFPageObj_[GS]etLineJoin(). BUG=pdfium:1185 Change-Id: I10c6f0ad5cc06b2b0ac11c1142353e7a275fc79e Reviewed-on: https://pdfium-review.googlesource.com/c/44515 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-24Check CPDFFooObjectFromFPDFPageObject() result.Lei Zhang
Instead of checking the FPDF_OBJECT itself. Remove redundant checks and fix nits. Change-Id: Id566847d39d16331c08f0b5f3b46431716717b5c Reviewed-on: https://pdfium-review.googlesource.com/c/44535 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-24Be more particular about FX objects constructed from JSTom Sepez
This is back-filling some more error cases from the work from a few weeks ago. Replaces a lambda with a static CallHandler() method since the verbosity was increasing. It gets invoked if you try to make a new FXJS object from the javascript side, rather than the C++ side. Making such an object is a little tricky, since we don't give these functions names in V8, but they can be obtained via constructor property from an instance of the object. Change-Id: Ibca686e75338ac54d08a114f36f930cd424a1eb5 Reviewed-on: https://pdfium-review.googlesource.com/c/44534 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-23Pull in current Chromium IMMEDIATE_CRASH() implementation.Lei Zhang
Update CHECK() to use IMMEDIATE_CRASH(). Change-Id: I7bcc75b31a64b657940b706ae8321740c27a5071 Reviewed-on: https://pdfium-review.googlesource.com/c/44211 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-23Test color.convert() and equal() from JS (and fix comparison logic).Tom Sepez
Currently, color.equal(a, b) may not give the same result as color.equal(b, a) since arg1 is converted to be the type of arg2, and some of these conversions lose information. Instead promote to the type with the most components in the hope of preserving the most information. Better error message when there are the right number of parameters but the types are wrong. Change-Id: I1d93fa29db4fb65e0f7c07c3ba7d9ca87ebf7bc9 Reviewed-on: https://pdfium-review.googlesource.com/c/44413 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-23Split field.in into field_properties.in and field_methods.inTom Sepez
Matches the conventions of the other JavaScript tests. Change-Id: I9dc41e3964220db03f57b9ab30289e0c19b042da Reviewed-on: https://pdfium-review.googlesource.com/c/44531 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-23Remove CJS_Field::ValueIsOccur()Tom Sepez
It is never called. Change-Id: If4dd7854cbcc815f48fa289003acc203f444cc3e Reviewed-on: https://pdfium-review.googlesource.com/c/44530 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-23Remove CJS_Report class.Tom Sepez
Its methods are never registered with JavaScript, so they can't be called, and they don't do anything anyways. In fact, the signature of its DefineJSObjects() method is about 2 years out of date ... Change-Id: I028d43ff2c7fa5ab0f59c5790fee3fa91d2f20ac Reviewed-on: https://pdfium-review.googlesource.com/c/44533 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-23Remove JSMessage::kRunSuccess and its stringTom Sepez
It is unused. Apparently, success is not possible ... Change-Id: If8fd079484af5f7c232a4dceedb4dc9a7b14a230 Reviewed-on: https://pdfium-review.googlesource.com/c/44532 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-22Modernize app.* JS method tests.chromium/3590Tom Sepez
Also add several missing cases. Change-Id: I38aa1fdacf839975249957267ffb121ad609aec5 Reviewed-on: https://pdfium-review.googlesource.com/c/44430 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-22Remove third arg to CFX_DIBitmap::LoadChannel()chromium/3589Tom Sepez
It is always passed as FXDIB_Alpha. Rename method to indicate its new purpose, and remove dead code. Change-Id: Ifaf4faa6b25d1cbd2ff272309764b49de70dc836 Reviewed-on: https://pdfium-review.googlesource.com/c/44491 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-22Consolidate app_*.in tests into app_methods.inTom Sepez
One file per method is excessive. Change-Id: I02e3e9dffd2fc2d98f77f15a4669bd15c0119dd3 Reviewed-on: https://pdfium-review.googlesource.com/c/44412 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-22Add missing property to event_properties.inTom Sepez
Change-Id: I63c2f2c416d3270061fcffd0c9d0a82c10de88d2 Reviewed-on: https://pdfium-review.googlesource.com/c/44411 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-22Call last uncovered document methods.Tom Sepez
Test-only CL. Change-Id: Ica1613c42075adb5fedfef6d66d99095cef08655 Reviewed-on: https://pdfium-review.googlesource.com/c/44410 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-22Add FPDFFormFillEmbeddertest.DocumentAActions.Tom Sepez
Provides coverage for CJS_EventContext::OnDoc_* methods. Change-Id: I65dff8fe5af4a9c11ac8fffabe209ad497586b1c Reviewed-on: https://pdfium-review.googlesource.com/c/44392 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-22Remove pdfium_diff target from pdf_is_standalone block.Tom Sepez
Allows it to be built as part of a chromium checkout so that the official coverage tools may invoke it as part of the coverage generation scripts. Change-Id: I8ed49f789a6a7e7eaa8ece4ef068295b0942cc45 Reviewed-on: https://pdfium-review.googlesource.com/c/44490 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-22Roll v8/ 626844157..db22e96fb (203 commits)Lei Zhang
https://chromium.googlesource.com/v8/v8.git/+log/626844157660..db22e96fb450 Version 7.2.31 Created with: roll-dep v8 TBR=tsepez@chromium.org Change-Id: I1a07462cd1974a472f77f6f9583479a0f31c4b25 Reviewed-on: https://pdfium-review.googlesource.com/c/44391 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-22Fix timezone inconsistency in document methods test.Tom Sepez
We do this by adding an override that forces GM time on everyone when run from the test harness. Generalize presubmit warnings so that the new function passes. De-duplicate lambda capture in place of static function. Change-Id: I15b34bea558baf1763476b36f0bca76614984107 Reviewed-on: https://pdfium-review.googlesource.com/c/44390 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-22Rename CPDF_Object::Type enumerators with k prefixesHans Wennborg
This was originally motivated by Clang's newly enhanced -Wshadow warning, which complained about BOOLEAN shadowing a BOOLEAN typedef in winnt.h. The warning has since been changed to not fire on enums shadowing types, but it was suggested that this kind of naming change was desirable anyway. Bug: chromium:895475 Change-Id: I278ce9dbbd88f802fe5bc77fca28b082aa5e684d Reviewed-on: https://pdfium-review.googlesource.com/c/44330 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-22Add k prefixes to CPDF_AAction::AActionType enumeratorsHans Wennborg
The GetFocus enumerator was shadowing the GetFocus function in winuser.h. Change the enumerators to all have a k prefix to avoid the warning, and since I believe pdfium wants to move towards that style anyway. Bug: chromium:895475 Change-Id: I740afa4f29d895e7e3cbb488fd311a7487d67a82 Reviewed-on: https://pdfium-review.googlesource.com/c/44470 Commit-Queue: Hans Wennborg <hans@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-22Speculative fix for bad FX_Free() under fuzzer.Tom Sepez
A recent change to CFX_CodecMemory prevented it leaking an old buffer when a realloc() failed. But there is a corner case where realloc() to size 0 also returns null (as would a failed alloc), but frees the buffer, rather than leaving it intact. TBR: thestig@chromium.org Bug: 897585 Change-Id: Ib1e82088a822008780f11c6ea94b0552fbf51146 Reviewed-on: https://pdfium-review.googlesource.com/c/44451 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-10-19Roll v8/ 604c50c84..626844157 (516 commits)chromium/3588chromium/3587chromium/3586Lei Zhang
https://chromium.googlesource.com/v8/v8.git/+log/604c50c84e67..626844157660 Version 7.1.314 Update a few callers to avoid deprecated V8 APIs. Created with: roll-dep v8 Change-Id: Ifabcae4956364cf1d02d4c2fe6074806fadc7ee3 Reviewed-on: https://pdfium-review.googlesource.com/c/43595 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-19Roll v8/ c623fabe5..604c50c84 (9 commits)Lei Zhang
https://chromium.googlesource.com/v8/v8.git/+log/c623fabe5643..604c50c84e67 Version 7.1.132 Update array_buffer JS test to adjust for https://chromium.googlesource.com/v8/v8/+/5cfe1a6b on Windows for 32-bit and ASAN builds. Change-Id: I7cfea684ab56d4a809989a7f029d7fc013eac372 Reviewed-on: https://pdfium-review.googlesource.com/c/44370 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-19Add static asserts for FPDFDOC_AACTION_* constants.Tom Sepez
These must match as we do an unchecked cast from int to the CPDF_AAction::AActionType enum. Tidy public header comments. Change-Id: Id4707a966dad6920b29f9fc8f4ab4e330d2658c3 Reviewed-on: https://pdfium-review.googlesource.com/c/44350 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-18Fully populate JS platform callbacks in pdfium_testTom Sepez
Adjust expected results accordingly. Order functions to match platform member order. Change-Id: I3d5f8e3ef8f532af0891b7fbbc1a8305d1922a75 Reviewed-on: https://pdfium-review.googlesource.com/c/44311 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-18One more round of IWYU in fxjs/.Lei Zhang
Also get rid of CFXJSE_FormCalcContext::m_pFMClass, which mostly goes unused. Change-Id: Idad72afaf5796e6174a5f23ad0460a8e0a93f9ab Reviewed-on: https://pdfium-review.googlesource.com/c/44273 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-18Try assigning more kinds of values to doc propsTom Sepez
Change-Id: I99b28f5f047f9043bd95f76f17970d1979276d63 Reviewed-on: https://pdfium-review.googlesource.com/c/44310 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-18Roll v8/ 41562c7c5..c623fabe5 (96 commits)chromium/3585Lei Zhang
https://chromium.googlesource.com/v8/v8.git/+log/41562c7c52bd..c623fabe5643 Version 7.1.130 Created with: roll-dep v8 TBR=tsepez@chromium.org Change-Id: I9263da1a6ef2f95e2c736e8d5487863a7d4a0664 Reviewed-on: https://pdfium-review.googlesource.com/c/44312 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-18Expand CJS_Document::mail{Doc,Form}() parametersTom Sepez
Use ExpandKeywordParams() rather than ad-hoc processing. Add test case for {} argument. Change-Id: I1f60a87b3995d62f4bead79245a1f58fd31b102e Reviewed-on: https://pdfium-review.googlesource.com/c/44290 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-18Remove PrintParams object.Tom Sepez
The only way to theoretically get one is via doc.getPrintParams(), and it always returns in error. Even if one were returend to JS, there aren't any methods/callbacks to change its properties. Even if there were methods to change its properties, the information it stores doesn't align with what is in the JS spec for this object. Even if it were aligned with the JS spec, the way we check for its presence as the ninth parameter in CJS_Document::print() doesn't match the way its use is documented in the spec as the sole first parameter. Instead implement the older, simpler behaviour as spec'd prior to 6.0, and toss this enhancement altogether. Move function to check the result of ExpandKeywordParams() to js_define.h so other files can use it. Update comment in that file to remove reference to deprecated enum. Expand test for API and introduce callback to log parameters. Change-Id: I047e2be0d2afbad91d6b58c6c74bbea083fed330 Reviewed-on: https://pdfium-review.googlesource.com/c/44271 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-10-18Do IWYU for core/fxcrt/xml headers.Lei Zhang
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>
2018-10-18Remove unused form of CFX_Matrix::TransformRect().Lei Zhang
Change-Id: I8e6c5fdf301ca408e76d9acfe6e62db9afd3d7a7 Reviewed-on: https://pdfium-review.googlesource.com/c/43575 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-18Do more IWYU in fxjs/.Lei Zhang
Change-Id: I778085c6e21904e697d5899a93f4e4e9fca92478 Reviewed-on: https://pdfium-review.googlesource.com/c/44272 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-10-18Remove some useless calls to the CFX_XMLNode ctor from subclasses.Lei Zhang
Also fix some nits: - Make member variable names consistent. - Make member variables const. - Make trivial getters return const-ref. Change-Id: Ibd34c9bc58ec0eed3edfc3a8ea39b533a41cad73 Reviewed-on: https://pdfium-review.googlesource.com/c/44151 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-10-18Do IWYU in core/fxcrt/css and fix lint errors.Lei Zhang
Change-Id: I6d2b35849e9f1935277986b6c72e6f507d976974 Reviewed-on: https://pdfium-review.googlesource.com/c/43948 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-10-18Add unit tests for CFX_Matrix::TransformRect().Lei Zhang
Change-Id: Id4bebae05116422b15019e7b972f5e8594317afe Reviewed-on: https://pdfium-review.googlesource.com/c/43949 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>