summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-02-05Merge to XFA: Fix segv in CPDF_DataAvail::CheckRoot()Tom Sepez
Original Review URL: https://codereview.chromium.org/895933003 BUG=454695 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/901013003
2015-02-05Merge to XFA: Add namespace and-re-arrange PDFium's local copy of /base.Tom Sepez
Original revieww URL: https://codereview.chromium.org/900753002 TBR=jam@chromium.org Review URL: https://codereview.chromium.org/880603004
2015-02-04Merge to XFA: Prevent base::CheckedNumeric from leaking outside of pdfium.Tom Sepez
Original review URL: https://codereview.chromium.org/896023003 TBR=jam@chromium.org Review URL: https://codereview.chromium.org/897023005
2015-02-03Merge to XFA: Replace CFX_SmartPointer cast operator with Get() method.Tom Sepez
Original Review URL: https://codereview.chromium.org/889673003 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/900693003
2015-02-03Merge to XFA: Fix stack exhaustion in CPDF_DataAvail::HaveResourceAncestor()Tom Sepez
Original Review URL: https://codereview.chromium.org/880043004 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/893333003
2015-02-03Merge the following commit to XFA:John Abd-El-Malek
615082d Remove OpenJPEG header generator binary from PDFium build. by John Abd-El-Malek - 2 minutes ago master Review URL: https://codereview.chromium.org/875803004
2015-02-02Merge the following changes to XFA branch:John Abd-El-Malek
b3a788e Fix GN PDFium build when building all. by John Abd-El-Malek - 19 hours ago chromium/2293 f8af677 Always use the FreeType headers included in PDFium. by John Abd-El-Malek - 24 hours ago dc8c950 Don't export any OpenJPEG methods from PDFium. by John Abd-El-Malek - 3 days ago 71c24b8 Use system FreeType on Linux. by John Abd-El-Malek - 3 days ago R=tsepez@chromium.org Review URL: https://codereview.chromium.org/900433002
2015-02-02Merge to XFA: Add embedder test for fix to bug_452455.Tom Sepez
Original Review URL: https://codereview.chromium.org/887063003 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/895713003
2015-01-30Fix IXFA_ destructor compiler warnings.Tom Sepez
On the XFA branch, there are still some of these warnings that were fixed (mostly) in master. Correct a few more of these. Also tidy a few needless returns. R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/891003003
2015-01-30Merge to XFA: track formhandles in embeddder test class itselfTom Sepez
TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/891763003
2015-01-29Merge to XFA: Fix infinite recursion in CPDF_RenderStatus::RenderSingleObject().Tom Sepez
This brings in: 14b2bb0 Fix infinite recursion in CPDF_RenderStatus::RenderSingleObject(). 1d43e82 Add minimized test cases for stack exhaustion crash to repository. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/893493002
2015-01-29Add output scale factor command line parameter to pdfium_test.Tom Sepez
It turns out that pdfium rendering takes some significantly different paths when the output bitmap size is the same as the document size, since it can avoid work in that case. For example, to reproduce the referenced bug, a scale factor less than 1.0 is required, so we add a parameter to let pdfium_test cover that case. BUG=451265 R=thestig@chromium.org Review URL: https://codereview.chromium.org/861203003
2015-01-28Cover fpdftext.h API with embeddertests.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/878333003
2015-01-27Merge to XFA: Add embedder test for stream length beyond end of file.Tom Sepez
Original Review URL: https://codereview.chromium.org/878523003 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/876393003
2015-01-27Merge to XFA: Kill scattered extern _PDF_CharType declarations.Tom Sepez
TBR=brucedawson@chromium.org Original Review URL: https://codereview.chromium.org/880663003 Review URL: https://codereview.chromium.org/884473003
2015-01-26XFA: make FPDFViewEmbeddertest.Crashers test run successfully.Tom Sepez
XFA is pickier, and returns false when loading some mangled documents. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/864953004
2015-01-26Merge to XFA: Fix infinite recursion in CPDF_Parser::ParseIndirectObjectAt().Tom Sepez
Orignal Review URL: https://codereview.chromium.org/875263002 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/880753002
2015-01-23Fix test result under XFA. This gives an error at an earlierTom Sepez
stage, but is fine so long as the crashes don't happen. TBR=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/874743002
2015-01-23Merge to XFA: Fix null crash in CheckTrailer.Tom Sepez
This includes: fa370ac Fix test naming in previous commit. e0bbe4a Fix null crash in CheckTrailer. TBR=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/870173002
2015-01-22Merge to XFA: pdfium_embeddertests fixesTom Sepez
This pulls in: af9be4f Add pdfium_embeddertests to BUILD.gn 36faa4a Fix build of pdfium_embeddertest under V8_USE_EXTERNAL_STARTUP_DATA. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/873453005
2015-01-22Merge to XFA: Use IPDF_DataAvail interface to hide CPDF_DataAvail.Tom Sepez
Original CL at https://codereview.chromium.org/873523002/ TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/871773002
2015-01-22Merge to XFA: Add embeddertests.Tom Sepez
This brings in: 83f96a0 Add API tests: NamedDestsByName, DestGetPageIndex. 9dcd7b8 Add tests for GetNamedDests() API. TBR=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/849693007
2015-01-21Merge to XFA: Use signed long for FPDF_GetNamedDest buffer length.Bo Xu
Need to have return value -1 indicating insufficient buffer. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/862163002
2015-01-21Merge to XFA: Simplify UTF16LE_Encode and add unittest.Bo Xu
Previously, UTF16LE_Encode take an optional flag to indicate if the returned byte string has trailing zeros. In fact, no where needs the flag to be false. So just get rid of it so callers won't misuse. The bug is found by https://codereview.chromium.org/837723009 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/860973002
2015-01-16Merge to XFA: PDFium embeddertests.Tom Sepez
This consists of two origin/master CLs: Review URL: https://codereview.chromium.org/857483005 Review URL: https://codereview.chromium.org/827733006 It also fixes a couple of segv's in XFA when the library is initialized and destroyed multiple times in the same process. R=jam@chromium.org TBR=jam@chromium.org Review URL: https://codereview.chromium.org/856623004
2015-01-16Fix a PDF417 encoding bug for 45 digits numeric data.Bo Xu
This bug is fixed in https://github.com/zxing/zxing/commit/71d83953bdb2aa83a5c70e7e005adcbc523647dc R=tsepez@chromium.org Review URL: https://codereview.chromium.org/837663004
2015-01-15XFA: merge patch from CL 834703002, add APIs for getting bookmarks and named ↵Bo Xu
destinations. Also uses "((CPDFXFA_Document*)document)->GetPDFDoc();" in a various places Add APIs for getting bookmarks and named destinations. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/834703002
2015-01-15Merge to XFA: Ensure unittests are built when building all.Tom Sepez
Original Review URL: https://codereview.chromium.org/849113002 TBR=scottmg@chromium.org TBR=jam@chromium.org Review URL: https://codereview.chromium.org/841183003
2015-01-15Merge to XFA: Land patch from issue 854603005 at patchset 1 ↵Tom Sepez
(http://crrev.com/854603005#ps1) on behalf of qsr@ TBR=qsr@chromium.org Original CL at Review URL: https://codereview.chromium.org/852983003 Review URL: https://codereview.chromium.org/812993009
2015-01-13Fix a NULL dereference introduced from ↵Bo Xu
https://pdfium.googlesource.com/pdfium/+/5d9acf8ee5dbbaad838f14f1fa173d892c4300ab%5E%21 The test file is test/barcode_test.pdf R=tsepez@chromium.org Review URL: https://codereview.chromium.org/851713004
2015-01-12Fix include paths for pdfium_unittests under chromium checkout.Tom Sepez
Here, testing/gtest and testing/some-pdfium-stuff will be different directories, since we will use the gtest at top-level. For standalone, they happen to be the same. TBR=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/852493002
2015-01-09Organize barcode codes into modules.Bo Xu
Previously all the files in barcode are lumped together. The naming of some files are inconsistent, leading to difficult understanding of the structure. Now files are grouped based on different barcode type like in zxing. This also matches what it looks like in other xfa folders. The file names in each folder could be further modified to be consistent. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/842043002
2015-01-09Unit test for 417HighLevelEncoderTom Sepez
R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/840903002
2015-01-09Fix GN build under chromium checkout.Tom Sepez
Original patch at https://codereview.chromium.org/817813004 This suppresses the fatal compilation warnings introduced by https://pdfium.googlesource.com/pdfium/+/e4fc5ced45c8fcfbe2487ec64eab036bc7d57602 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/804253005
2015-01-09Merge to XFA: Add pdfium_unittests to BUILD.gnTom Sepez
Original at URL: https://codereview.chromium.org/840343005 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/809883005
2015-01-09XFA: merge patch from CL 839163002 to only request C++ 11 for C++Bruce Dawson
Only request C++11 when compiling C++ code. Linux pdfium builds have 215 warnings of this form: command line option -std=gnu++11 is valid for C++/ObjC++ but not for C The obvious fix is to not request C++11 for C compilations. The only complication was the the switch we are using is actually gnu++0x, not gnu++11. BUG=https://code.google.com/p/pdfium/issues/detail?id=102 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/839163002 Review URL: https://codereview.chromium.org/839323002
2015-01-09merge to XFA: Fix -Wnon-virtual-dtor compiler warnings.Tom Sepez
Original at URL: https://codereview.chromium.org/810883005 Note that the new code in XFA introduces many more of these, to be handled separately. TBR=brucedawson@chromium.org TBR=thestig@chromium.org BUG=https://code.google.com/p/pdfium/issues/detail?id=102 Review URL: https://codereview.chromium.org/842223004
2015-01-08Merge to XFA: Land: Protect against a seg fault in CPDF_StructElementImpl ↵Tom Sepez
constructor Original CL at https://codereview.chromium.org/841943003/ TBR=jam@chromium.org Review URL: https://codereview.chromium.org/845603004
2015-01-08Do not convert from string literal to wchar_t*Bo Xu
R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/841203002
2015-01-08Add original copyright notice for barcode module.Bo Xu
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/742243002
2015-01-08XFA: merge patch from CL 792953005, fix most warningsBruce Dawson
Includes fixes to XFA specific warnings -- benign truncations. Bug https://code.google.com/p/pdfium/issues/detail?id=104 was filed to track changing types to avoid some truncations. Resolve all but two VC++ build warnings in pdfium. pdfium builds on Win32 have about 85 warnings (250 in the XFA branch, totaling over 480 lines!), mostly from four lines in a header file and a warning that should be disabled. This change resolves all but two of them and turns on warning-as-errors. Bugs have been filed for the two remaining warnings: https://code.google.com/p/pdfium/issues/detail?id=100 the 64-bit warnings: https://code.google.com/p/pdfium/issues/detail?id=101 and the Linux warnings: https://code.google.com/p/pdfium/issues/detail?id=102 The fix to the double->float truncation bugs will also improve code-generation. R=bo_xu@foxitsoftware.com, tsepez@chromium.org Review URL: https://codereview.chromium.org/792953005 BUG= https://code.google.com/p/pdfium/issues/detail?id=100 Review URL: https://codereview.chromium.org/834413002
2015-01-07Merge to XFA: Finish unit test for CFX_ByteStringC class.Tom Sepez
Original CL at https://codereview.chromium.org/808553013 TBR=brucedawson@chromium.org Review URL: https://codereview.chromium.org/837253002
2015-01-07Merge to XFA: Add ostream helpers for FX String classes.Tom Sepez
Original CL at https://codereview.chromium.org/837843002 TBR=brucedawson@chromium.org Review URL: https://codereview.chromium.org/809313008
2015-01-07Merge to XFA: Re-enable pdfium_unittests.Tom Sepez
Original CL at https://codereview.chromium.org/835233002 R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/810153005
2015-01-05XFA: merge patch from CL 832703003, remove g_timeMap globalBruce Dawson
Get rid of g_timeMap global object. g_timeMap is a global variable with a constructor and destructor so it must be removed. BUG=441899 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/832703003 Review URL: https://codereview.chromium.org/837483006
2015-01-05XFA: merge patch from CL 792043005, run-time hashing.Bruce Dawson
Remove run-time calculation of hash constants in pdfium. PDFium static initializers must go. Static initializers are prohibited by the style guide. They have negative consequences including increased startup time (from pulling in additional code pages) and reduced sharing of data pages (since the variables can't go in the read-only data segment). This change uses a template struct and typed enums to reproduce JS_CalcHash at run-time. An unsigned long long constant and masking with 0xFFFFFFFF are used to avoid compile errors due to integer overflow of compile-time constants. The HashVerify class is used to check the results, necessary since none of the functions in global.cpp are called when pdfium_test.exe runs. const_expr would be a much cleaner way to implement this change but it is not yet widely supported. On the Windows release build this reduces the code size (.text virtual size) by 0x240 (576) bytes, the .data section by 0x20 bytes (for eight unsigned globals), and the .rdata section by 0x20 bytes (the unneeded string savings, minus the eight unsigned globals now being there). BUG=441899 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/792043005 Review URL: https://codereview.chromium.org/828883004
2015-01-05Fix XFA specific use of m_sTimeMap. This fixes a build break.Bruce Dawson
R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/823653004
2015-01-05XFA: merge patch from CL 831903002, m_sTimeMap fixesBruce Dawson
Get rid of fifteen copies of m_sTimeMap and their initializers. m_sTimeMap is a global variable with a constructor and destructor, which is not allowed. This change moves it to a function with a static pointer so that it is constructed on demand and then leaked, thus avoiding having startup and shutdown code. This also fixes a worrisome bug caused by having m_sTimeMap defined in a header file. Because m_sTimeMap was defined (and marked as static) in a header file there were fifteen separate copies of it, one for each source file which included the header file. This could easily lead to bugs because a timer that was added from one source file would be invisible to other source files. Each instance of m_sTimeMap added four entries to the dump-static-initializers.py report, for a total of sixty, so this fix significantly cleans up that report. BUG=441899 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/831903002 Review URL: https://codereview.chromium.org/800883004
2015-01-05XFA: merge patch from CL 828203002, clean up bookmark codesBo Xu
Clean up bookmark related codes. Remove CPDF_Dictionary*() operator in CPDF_Bookmark class. Unify naming conventions and coding styles. Change some functions to const. Change the name of function argument to |pDict| for FPDF_xxx type variable. This makes the code more clear and gives better variable naming R=tsepez@chromium.org Review URL: https://codereview.chromium.org/828203002 Conflicts: fpdfsdk/src/fpdfdoc.cpp
2015-01-05XFA: merge patch from CL 729293003, use FX_ArraySize for safetyBruce Dawson
Note that the merge of this fix to XFA found six bugs. Five were fixed in https://codereview.chromium.org/826573003 and one was fixed in https://codereview.chromium.org/831293002. These bugs are now impossible to compile. Replace manual/error-prone/hard-to-verify arraysize calculations with safe FX_ArraySize macro. pdfium has numerous places where the number of elements in an array is calculated with expressions like: sizeof(cFormats)/sizeof(FX_LPCWSTR) This is suboptimal because it is verbose, it is easy to get wrong, and it cannot be determined through casual inspection whether the code is correct. It will give incorrect results if cFormats is a pointer instead of an array and it will give incorrect results if FX_LPCWSTR is not the type of the array elements. The FX_WSTRC macro in fx_string.h which I fixed was particularly scary because it would silently misbehave if passed a pointer. The FX_ArraySize macro which I have added and started using (taken from arraysize in v8's macros.h) is easier to use and will always give correct results. If passed a pointer it will fail to compile. For this change I only fixed instances of sizeof(FX_LPCWSTR). There appear to be about 150 other places in the pdfium code that could benefit from using FX_ArraySize. TBR=bo_xu@foxitsoftware.com, tsepez@chromium.org Review URL: https://codereview.chromium.org/818193004