summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-10-28Merge to XFA: Check if document was opened during testing.Dan Sinclair
When we call OpenDocument we fail to check if the document was actually opened. Currently we return true in all cases (assuming we read the file). This CL updates the code to check if the document was opened and return false if not. I've updated several tests to check for FALSE instead of TRUE. I verified the documents in fact don't open with my local (non-PDFium) PDF reader. BUG=pdfium:223 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1417893007 . (cherry picked from commit dd4cd523ef4546b43d68e8ca6ec0a97fbe8954e9) Review URL: https://codereview.chromium.org/1418563010 .
2015-10-28Merge to XFA: Add PositionIsInBounds to CPDF_StreamParserDan Sinclair
This Cl moves all of the m_Size <= m_Pos and m_Pos >= m_Size checks to an PositionIsInBounds() helper. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1412793008 . (cherry picked from commit b9d06fb2186d7002d6231d1805bcf97fc60144c5) Review URL: https://codereview.chromium.org/1414163007 .
2015-10-28Include cmath so we get std::isnandan sinclair
We need to include the <cmath> header so std::isnan exists. BUG=pdfium:250 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1411633006 .
2015-10-28Merge to XFA: Add helpers to check the PDF_CharType.Dan Sinclair
This CL adds helpers to provide more descriptive access to PDF_CharType. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1407913004 . (cherry picked from commit e3e5675bcdd26b8df7286e10a42d585df6d2321d) Review URL: https://codereview.chromium.org/1419893004 .
2015-10-28A crasher due to lacking 'template' node in XFA fileJun Fang
A template node is mandatory in XFA file. Pdfium should ignore processing it when no template node is found in XFA file. BUG=pdfium:216 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1423903002 .
2015-10-27Merge to XFA: Use static_cast for various CPDF_Object conversions.Dan Sinclair
This Cl converts a bunch of c-style casts to static_cast<CPDF_Object*>(). BUG=pdfium:201 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1428583003 . (cherry picked from commit 74b147b5747cf65a8936d201b3ed5b32454365cc) Review URL: https://codereview.chromium.org/1417583007 .
2015-10-27Merge to XFA: Give names to the shading typesDan Sinclair
Currently the shading types are referenced by number. This Cl creates and enum and updates the code to use the enum names instead of magic numbers. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1418623011 . (cherry picked from commit 468974316ed5f6b6f8e637ab2c7afedc7c2bfe6a) Review URL: https://codereview.chromium.org/1428573002 .
2015-10-27Merge to XFA: Add context to file load failures in pdfium_test.Dan Sinclair
Currently if pdfium_test fails to load the document it just says it failed. This CL adds some extra context by looking at the error set by the load and reporting it to the user. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1413923006 . (cherry picked from commit e6eae266a48cdcfd464f52df68c97183a4f7987a) Review URL: https://codereview.chromium.org/1423123002 .
2015-10-27Merge to XFA: Fix memory leak in FXJS_ReleaseRuntime.Oliver Chang
Should fix a bunch of JS related memory leaks reported by LSan/DrMemory. Clean merge. TBR=tsepez@chromium.org BUG=pdfium:242 Review URL: https://codereview.chromium.org/1417973009 . (cherry picked from commit fbbb3c3de517309b6808d7a8f4c441aa0abf7065) Review URL: https://codereview.chromium.org/1406053006 .
2015-10-27Merge to XFA: Type check the m_pShadingObj before assuming it's a stream.Dan Sinclair
The m_pShadingObj can be a stream or a dictionary depending on how it's used. This CL adds some simple type checking to make sure that the type of the object matches what we expect. BUG=chromium:547706 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1421973004 . (cherry picked from commit 4ef782ab57979add3e3910d6bcfde6ef59f65724) Review URL: https://codereview.chromium.org/1422253002 .
2015-10-27Revert accidental commits to XFA.Tom Sepez
Revert "Add an embedded test case" This reverts commit ec44186fdbca423eddf432be8b5c38914674023a. Revert "Update the format" This reverts commit 1df068061b5bb5e768a623318186523ffd251aaa. Revert "Update .in file" This reverts commit c13090439e1fbfd8a18c358058f137f897a7477b. Revert "Address review comments" This reverts commit 24967515b8be77a79aa1599f8fbf5d3ecbcd1769. TBR=jun_fang@foxitsoftware.com TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1414033007 .
2015-10-27Address review commentsJun Fang
2015-10-27Update .in fileJun Fang
2015-10-27Update the formatJun Fang
2015-10-27Add an embedded test caseJun Fang
2015-10-26Delete unused fpdfsdkdll.rc and resource.h.Lei Zhang
BUG=pdfium:241 R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1422193002 . (cherry picked from commit 24b2eab6351920dd60210b6dcd350c9921e7b3b5) Review URL: https://codereview.chromium.org/1421343004 .
2015-10-26Merge to XFA: Remove usage of std::vector::dataOliver Chang
Clean merge. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1412823005 . (cherry picked from commit 044c06f11fb5e62f0984f960be2717ab9bcb540d) Review URL: https://codereview.chromium.org/1413693010 .
2015-10-26Merge to XFA: Partial revert of commit c6d8683 to fix a GN + Win/Clang build ↵Lei Zhang
warning. BUG=547906 TBR=thakis@chromium.org Review URL: https://codereview.chromium.org/1420503012 . (cherry picked from commit f7a8b34f520f1d4892f009700972ab2995ed2681) Review URL: https://codereview.chromium.org/1415453004 .
2015-10-26XFA: Take style changes from master for fx_ge_font.cppTom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1420613006 .
2015-10-26Merge to XFA: Remove default argument from CPDF_Dictionary::SetAt().Lei Zhang
Also fix a potential object leak. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1414963005 . (cherry picked from commit f7992b39cec908e549fb995acae477a9efba538b) Review URL: https://codereview.chromium.org/1421253005 .
2015-10-26Remove CPDF_Reference::Create(), make logic match masterTom Sepez
Makes the files in this CL identical to master, since there are no XFA specifics. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1425663003 .
2015-10-26Merge to XFA: Fix a leak in CPDF_SyntaxParser::GetObject().Lei Zhang
As seen in FPDFViewEmbeddertest.Crasher_451830. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1385803002 . (cherry picked from commit a568ff2dddd3ef44f224d21b31afff8eb14b6d31) Review URL: https://codereview.chromium.org/1420303005 .
2015-10-26Merge to XFA: Revert "Revert "Add type cast definitions for CPDF_Reference.""Dan Sinclair
This reverts commit 7e155865c90cc1115cc7193b7646a341d8f9093e. Add type cast definitions for CPDF_Reference. This Cl adds ToReference, CPDF_Object::AsReference and CPDF_Object::IsReference and updates the src to use them as needed. BUG=pdfium:201 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1418923005 . (cherry picked from commit 6ee3484bcb413f4cce303e237fe15e2bdaf51ade) Review URL: https://codereview.chromium.org/1410073007 .
2015-10-26XFA: Fix stray comma in BUILD.gnTom Sepez
TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1421313002 .
2015-10-26Merge to XFA: Cleanup parts of CPDFSDK_AnnotIterator and CPDFSDK_PageView.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1411203007 . (cherry picked from commit 9b2741829b8a8c511ef0f2f313ff53d77ac96307) Review URL: https://codereview.chromium.org/1408263005 .
2015-10-26XFA: Remove unused FXSYS_i64tow()Tom Sepez
Missing merge from master. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1405133009 .
2015-10-23Merge to XFA: Convert some pointers in fpdf_parser_parser to unique_ptr and ↵Oliver Chang
std::vector. Clean merge. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1411043003 . (cherry picked from commit bef190fcacb7dde4fedc1360e3019ab9968db16a) Review URL: https://codereview.chromium.org/1418223004 .
2015-10-23XFA: take small tidying from master in fpdf_parser_parser.cppTom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1423693005 .
2015-10-23Take fx_apple_platform.cpp from masterTom Sepez
Also fx_quartz_device.cpp R=thestig@chromium.org Review URL: https://codereview.chromium.org/1424613002 .
2015-10-23Merge to XFA: Cleanup: Remove unused CPDF_Stream::Clone().Lei Zhang
Cloning a CPDF_Stream actually happens via CPDF_Object::Clone(). Transitively, remove: - GetStreamFilter() -- all the filters. Also remove CXFA_FileRead. R=jam@chromium.org Review URL: https://codereview.chromium.org/1288543002 . (cherry picked from commit c9a05f1c90860a97dbe4b8014bc4584bfa3a4580) Review URL: https://codereview.chromium.org/1297463002 .
2015-10-23XFA: make JBig2_HuffmanTable.cpp match masterTom Sepez
Includes one array bounds fix. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1412583003 .
2015-10-23XFA: Manually correct IsParsered to IsParsed in remaining places.Tom Sepez
Fix a few other master formatting diffs (no-{}, newlines). R=thestig@chromium.org Review URL: https://codereview.chromium.org/1405133008 .
2015-10-23XFA: Manually apply changes to fpdf_text.h and fx_font.h from masterTom Sepez
Driven off of https://codereview.chromium.org/1398383002/ Then make the other files as similar as possible. Note that this required changes to xfa/ code, and required adding some Set() methods. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1411833003 .
2015-10-22XFA: Make fx_codec_jpx_unittest.cpp match masterTom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1412453005 .
2015-10-22Merge to XFA: Set a recursion limit on CPDF_DataAvail::CheckPageNodeOliver Chang
This limit mirrors FX_MAX_PAGE_LEVEL in fpdf_parser_document.cpp Clean merge. TBR=thestig@chromium.org BUG=544880 Review URL: https://codereview.chromium.org/1421743003 . (cherry picked from commit 3bfb1dcf56f8470b693ad1126e24e65f9d17926c) Review URL: https://codereview.chromium.org/1418173003 .
2015-10-22Merge to XFA: Make parallelized run_corpus_tests.py handle ctrl-c.Lei Zhang
Thanks Stack Overflow! TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1421623002 . (cherry picked from commit 61fe6edb3f789feefa4bd0c8475b9645fae0d09e) Review URL: https://codereview.chromium.org/1420543004 .
2015-10-22Merge to XFA: Add type cast definitions for CPDF_Stream.Dan Sinclair
This Cl adds ToStream, CPDF_Object::AsStream and CPDF_Object::IsStream and updates the src to use them as needed. BUG=pdfium:201 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1402413004 . (cherry picked from commit 338805f1366dcdf9a5b48cf591541cf98d7490f1) Review URL: https://codereview.chromium.org/1422513004 .
2015-10-22Merge to XFA: Add type cast definitions for CPDF_Array.Dan Sinclair
This Cl adds ToArray, CPDF_Object::AsArray and CPDF_Object::IsArray and updates the src to use them as needed. BUG=pdfium:201 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1417893003 . (cherry picked from commit c2bfc000e502c42c9a3017038fd9104c7997d126) Review URL: https://codereview.chromium.org/1419643005 .
2015-10-22XFA: Sync build and documentation differences with master.Dan Sinclair
This Cl syncs the AUTHORS, and README.md and build scripts in XFA to match master where possible. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1415423002 .
2015-10-22Merge to XFA: Remove unused error variable from CFX_Font::AdjustMMParamsOliver Chang
Also fixes a potential memory leak. R=tsepez@chromium.org, thestig@chromium.org BUG=pdfium:156 Review URL: https://codereview.chromium.org/1409973003 . (cherry picked from commit de49cf173d12fe7a462168e2bf6c44971d7d28f8) Review URL: https://codereview.chromium.org/1420103002 .
2015-10-22Merge to XFA: Remove unused CPDFSDK_InterForm::DoFDFBuffer.Dan Sinclair
This method isn't used anywhere and the implementation doesn't really do anything. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1405163003 . (cherry picked from commit 162f227af9c5e28885a36e6ca06a09c12c6223e0) Review URL: https://codereview.chromium.org/1416283002 .
2015-10-21Merge to XFA: Make DEPS use relative paths to fix recipeLei Zhang
Context: DEPS was originally added to pdfium to allow its recipe to automatically check out its dependencies. The recipe used absolute paths, and so the checkout directory's name ('pdfium') had to be prefixed to the directory checkout of every dependency, as gclient in the recipe worked one level above the pdfium checkout itself. After change fe4537269fc7133320a5131638757f2ffa6bd854, the recipe no longer worked. To fix this, I'm making DEPS use relative paths. BUG=375773 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/724113003 (cherry picked from commit 39c6b4c50bb06336c2b592a407efa862ff6ed8ae) Review URL: https://codereview.chromium.org/1421703002 .
2015-10-21Merge to XFA: Make CFX_FontMgr member variables private. (try 2)Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1412733011 . (cherry picked from commit 5a5b6fb3759daf1201ffc9702f626f4b243922d0) Review URL: https://codereview.chromium.org/1414463006 .
2015-10-21Merge to XFA: (Reland) Switch builds to clang by default for Linux and OS X.Oliver Chang
Also adds support for ASan and sanitizer coverage. BUG=pdfium:1,pdfium:171 R=thestig@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/5478df43a8970257e9644ae6f57a6fe7513029c6 Review URL: https://codereview.chromium.org/1406843002 . (cherry picked from commit 3b2ab45f0a883046a7c457e8435b5a9b2c1c4156) Review URL: https://codereview.chromium.org/1412193010 .
2015-10-21Merge to XFA: Change DEPS hooks paths to include 'pdfium/'.Oliver Chang
This will break existing checkouts based on the instructions provided. Instead of having a single pdfium directory, checkouts will now compromise of: ("repo" can be named anything) repo/.gclient repo/pdfium/.git repo/pdfium/others... To convert an existing checkout, do something like: mkdir repo mv pdfium repo rm repo/pdfium/.gclient_entries # will be regenerated, with a warning mv repo/pdfium/.gclient repo edit repo/.gclient and change "name: '.'" to "name: 'pdfium'" Instructions for getting a new checkout are in README.md in this CL. R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1406383003 . Review URL: https://codereview.chromium.org/1422633002 .
2015-10-21XFA: Fix two minor build errors on WindowsQin Zhao
- remove unused local variable rtArrow in CFWL_WidgetTP::DrawArrow - remove ~ in class IFX_FontMgr BUG=none R=thestig@chromium.org Review URL: https://codereview.chromium.org/1416673005 .
2015-10-21XFA: add CPDFDocumentToFPDFDocument()Tom Sepez
Abstracts away that master returns CPDF_Documents directly, but XFA wraps them with a CPDFXFA_Document. Tidy dead code along the way. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1415803002 .
2015-10-21Merge to XFA: Remove FFL_Utils as it is unused.Dan Sinclair
None of the methods in this file are used and it is not included anywhere. Removing. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1417783004 . (cherry picked from commit 704da531215c4f81279eb763192de398f7d03748) Review URL: https://codereview.chromium.org/1413943004 .
2015-10-21Merge to XFA: Add type cast definitions for CPDF_Name.Dan Sinclair
This Cl adds ToName, CPDF_Object::AsName and CPDF_Object::IsName and updates the src to use them as needed. BUG=pdfium:201 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1417823005 . (cherry picked from commit 1c77edb7b34e03787605b7965784cea38ef9f1d7) Review URL: https://codereview.chromium.org/1417033004 .
2015-10-21Merge to XFA: Add type cast definitions for CPDF_String.Dan Sinclair
This Cl adds ToString, CPDF_Object::AsString and CPDF_Object::IsString and updates the src to use them as needed. BUG=pdfium:201 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1417933002 . (cherry picked from commit 53d3ab125ef583be8cfac907b308a6551b93067a) Review URL: https://codereview.chromium.org/1408323006 .