pdfium.git
4 years agoKill IFX_FontMapper
Tom Sepez [Fri, 31 Jul 2015 21:00:39 +0000]
Kill IFX_FontMapper

The design envisioned two kinds of font mappers: internal
(of type CFX_FontMapper), and external, both of which
implement a common interface.  But there isn't any means of
making an external one, so the interface is redundant.

IFX_FontMapper also appears in an apple-specific struct,
but was never non-null or used in any way.

The CFX_FontMapper class provides its own mechanism to
include platform-specific features, as it turns out.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1259123005 .

4 years agoRoll corpus to 2ddcfbd.
Tom Sepez [Fri, 31 Jul 2015 15:58:18 +0000]
Roll corpus to 2ddcfbd.

TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1266833003 .

4 years agoAdd simple script to regenerate expected results.
Tom Sepez [Thu, 30 Jul 2015 23:48:28 +0000]
Add simple script to regenerate expected results.

(I've been doing this by hand for far too long).

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1264873005 .

4 years agoFix return check in CFX_FolderFontInfo::ScanFile() fread.
Tom Sepez [Thu, 30 Jul 2015 22:53:59 +0000]
Fix return check in CFX_FolderFontInfo::ScanFile() fread.

If you want to check the number of bytes read, you need to
change the order of arguments.

TEST=testing/corpus/fx/mulobj/1/1_10_watermark.pdf.0.png
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1262453006 .

4 years agoRe-enable successful tests.
Tom Sepez [Thu, 30 Jul 2015 18:18:49 +0000]
Re-enable successful tests.

TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1258203005 .

4 years agoNew suppressions for bundled freetype
Tom Sepez [Thu, 30 Jul 2015 17:47:17 +0000]
New suppressions for bundled freetype

TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1255933006 .

4 years agoUse bundled freetype for the pdfium_test binary.
Tom Sepez [Thu, 30 Jul 2015 17:29:19 +0000]
Use bundled freetype for the pdfium_test binary.

But use platform freetype for library itself according to the rules
for the platform.

This should greatly reduce per-platform diffs in the corpus tests, but
requires that the corpus be rolled at the same time.

When this rolls into chromium, its src/BUILD.gn will need to be updated
to say third_party:fx_freetype instead of third_party:freetype.

R=jam@chromium.org

Review URL: https://codereview.chromium.org/1267493005 .

4 years agoMissing bExact -> iExact conversions
Tom Sepez [Tue, 28 Jul 2015 23:27:37 +0000]
Missing bExact -> iExact conversions

This is the cause of the mac embeddertest failure when fx_bool is
replaced by bool (an incorrect overload).  The types still
match on master, prior to the conversion, so it's not noticed.

Find other instances as well.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1262683003 .

4 years agoFix segv above CPDFSDK_Document::GetPageView()
Tom Sepez [Tue, 28 Jul 2015 18:08:51 +0000]
Fix segv above CPDFSDK_Document::GetPageView()

The refactoring at fb07e28 removed a null handle check.
BUG=514690
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1261923003 .

4 years agoFix FX_BOOL compilation errors under windows
Tom Sepez [Mon, 27 Jul 2015 21:38:43 +0000]
Fix FX_BOOL compilation errors under windows

 - Bool functions should not return -1 for error.
 - Bool variables should not be assigned 2
 - Bool / int32_t prototypes should match.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1254973004 .

4 years agoKill FX_READER_DLL symbol
Tom Sepez [Mon, 27 Jul 2015 21:25:15 +0000]
Kill FX_READER_DLL symbol

It is never defined, and the declspec()s based on it appear
inconsistently used.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1257163002 .

4 years agoKill CFX_ArchiveLoader / CFX_ArchiveSaver and subclasses
Tom Sepez [Mon, 27 Jul 2015 19:25:48 +0000]
Kill CFX_ArchiveLoader / CFX_ArchiveSaver and subclasses

These are unused until we get to XFA.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1255113003 .

4 years agoRevert "FX Bool considered harmful, part 3"
Tom Sepez [Mon, 27 Jul 2015 19:08:12 +0000]
Revert "FX Bool considered harmful, part 3"

This reverts commit ff46aaf499edcf153ee2f57c7016587aa96dcfa0.
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1255293002 .

4 years agoFX Bool considered harmful, part 3
Tom Sepez [Mon, 27 Jul 2015 18:55:29 +0000]
FX Bool considered harmful, part 3

Try to reland this patch after fixing underlying issues that
caused it to be reverted.

fx_system.h is the only manual edit.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1258093002 .

4 years agodocument.delay and document.external are boolean properties.
Tom Sepez [Thu, 23 Jul 2015 23:07:59 +0000]
document.delay and document.external are boolean properties.

This is the javascript test failure at 320b2313d198.
The spec says they are booleans, not ints, so correct the behaviour now.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1242263010 .

4 years agoFX_BOOL not always 0 or 1 in CPDF_PageObjects::m_ParserState
Tom Sepez [Thu, 23 Jul 2015 21:36:34 +0000]
FX_BOOL not always 0 or 1 in CPDF_PageObjects::m_ParserState

This fixes part of the failure encountered at 320b2313d198.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1257503002 .

4 years agoRevert "FX_BOOL considered harmful, part 2."
Tom Sepez [Thu, 23 Jul 2015 20:36:00 +0000]
Revert "FX_BOOL considered harmful, part 2."

This reverts commit 320b2313d19869333ed453af546e61a9fc2b81c9.
Reason for revert: build failure.

TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1255693002 .

4 years agoFX_BOOL considered harmful, part 2.
Tom Sepez [Thu, 23 Jul 2015 20:26:26 +0000]
FX_BOOL considered harmful, part 2.

Fully automatic change, execpt for cleanup in fx_system.h

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1254703002 .

4 years agoFix FX_BOOL type mismatches.
Tom Sepez [Thu, 23 Jul 2015 18:34:44 +0000]
Fix FX_BOOL type mismatches.

Extracted from https://codereview.chromium.org/1252613002/

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1253603002 .

4 years agoRe-land else-after-returns
Tom Sepez [Wed, 22 Jul 2015 22:14:14 +0000]
Re-land else-after-returns

Revert "Revert "Fix else-after-returns throughout pdfium.""
This reverts commit 4eb4d7f6c707cc2c23c806aa540d055c8832b55d.

Fix one naming conflict.

TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1243953004 .

4 years agoRevert "Fix else-after-returns throughout pdfium."
Tom Sepez [Wed, 22 Jul 2015 22:04:26 +0000]
Revert "Fix else-after-returns throughout pdfium."

This reverts commit 7cc97521db1e52d5927f5605de5f9a7102f8af40.

4 years agoFix else-after-returns throughout pdfium.
Tom Sepez [Wed, 22 Jul 2015 21:59:55 +0000]
Fix else-after-returns throughout pdfium.

Driven by CS search for
pcre:yes file:third_party/pdfium/ -file:pdfium/third_party/
\breturn\b[^;]*;\s*\n*\s*\}*\s*\n*\r*else

Note: Care is required to ensure the preceding block is not an else-if.

As usual, removed any tabs I saw.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1243883003 .

4 years agoRemove dead code found by Scythe.
Lei Zhang [Wed, 22 Jul 2015 20:33:43 +0000]
Remove dead code found by Scythe.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1249643003 .

4 years agoMerge to master: _FETAL => _FATAL.
Tom Sepez [Wed, 22 Jul 2015 19:52:18 +0000]
Merge to master: _FETAL => _FATAL.

(cherry picked from commit 8a0a834d2aea61fc92590839b86471ac73daa967)
Original Review URL: https://codereview.chromium.org/1247213002 .

Note: inadvertantly landed on XFA first.
TBR=thestig@chromium.org

Review URL: https://codereview.chromium.org/1252013002 .

4 years agoMove extern fpdf_font_charset.cpp function prototypes to header.
Tom Sepez [Tue, 21 Jul 2015 23:41:48 +0000]
Move extern fpdf_font_charset.cpp function prototypes to header.

Make others static while we're at it.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1241173004 .

4 years agoRefactor progressive renderer class.
Tom Sepez [Fri, 17 Jul 2015 17:29:25 +0000]
Refactor progressive renderer class.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1233453014 .

4 years agoCleanup: Do not check pointers before deleting them, part 2.
Lei Zhang [Fri, 17 Jul 2015 01:28:49 +0000]
Cleanup: Do not check pointers before deleting them, part 2.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1195363002 .

4 years agoFix typo from commit d3611f.
Lei Zhang [Thu, 16 Jul 2015 19:16:34 +0000]
Fix typo from commit d3611f.

TBR=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1242493003 .

4 years agoSort unexpected test results.
Lei Zhang [Thu, 16 Jul 2015 19:07:13 +0000]
Sort unexpected test results.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1232203003 .

4 years agoTidy up CPDFDOC_Environment.
Tom Sepez [Thu, 16 Jul 2015 18:09:12 +0000]
Tidy up CPDFDOC_Environment.

- untabify as encountered.
- Only put single-statement method in .h file, move more
  complex methods to .cpp (counting an if without braces as
  a single statement, killing braces as needed).
- Move invariant arguments to constructor and make
  corresponding members const.
- Make all members private and add accessor methods.
- Make existing accessor methods const where possible.
- Kill meaningless asserts.
- Add helper functions in place of duplicate code.
- Rename GetCurrentDoc() to GetSDKDocument(), since the class
  has two document members, one of CPDF_Document and one of
  CPDFSDK_Document, making it clear which one you get.
- Simplify some logic with early returns.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1235393002 .

4 years agoMake v8 embedder data slot configurable
Jochen Eisinger [Thu, 16 Jul 2015 07:37:48 +0000]
Make v8 embedder data slot configurable

Chrome already uses 0 and 1.

BUG=none
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1235303003 .

4 years agoFlip the shut down order in tests.
Lei Zhang [Thu, 16 Jul 2015 00:10:52 +0000]
Flip the shut down order in tests.

This matches the Chromium PDF plugin changes in
https://codereview.chromium.org/1230313006/

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1237233006 .

4 years agoMake ContentStreamParser members private, fix constructor
Tom Sepez [Wed, 15 Jul 2015 23:54:50 +0000]
Make ContentStreamParser members private, fix constructor

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1219683007 .

4 years agoAdd a null pointer check to CPDF_CalRGB::v_Load().
Lei Zhang [Wed, 15 Jul 2015 23:11:10 +0000]
Add a null pointer check to CPDF_CalRGB::v_Load().

BUG=492055
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1241923005 .

4 years agoKill Func_Renderpage global function pointer, it never changes.
Tom Sepez [Wed, 15 Jul 2015 22:30:18 +0000]
Kill Func_Renderpage global function pointer, it never changes.

Kill some unused macros along the way, and put prototypes
in header files.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1233203004 .

4 years agoRevert "Add test case for parsing endobj keywords."
Tom Sepez [Wed, 15 Jul 2015 17:10:53 +0000]
Revert "Add test case for parsing endobj keywords."

This reverts commit 5bd88ec07e79215400777f3095c6843e0627cade.

4 years agoAdd test case for parsing endobj keywords.
Tom Sepez [Wed, 15 Jul 2015 17:01:29 +0000]
Add test case for parsing endobj keywords.

There is no assurance that the expected result files are consistent
with other readers.  Jun will have to verify that after making his
parser changes for bug 493126.

BUG=493126
R=thestig@chromium.org, jun_fang@foxitsoftware.com

Review URL: https://codereview.chromium.org/1232803005 .

4 years agoAdd missing reinterpret_cast from void to v8::Isolate*
Jochen Eisinger [Wed, 15 Jul 2015 12:47:39 +0000]
Add missing reinterpret_cast from void to v8::Isolate*

BUG=none
TBR=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1241863003 .

4 years agoRevert "Pump the v8 message loop in tests"
Jochen Eisinger [Wed, 15 Jul 2015 12:47:01 +0000]
Revert "Pump the v8 message loop in tests"

This reverts commit 304578020122cc4d2a4a8c1598694ef2b9be92b5.

Turns out that in both cases v8 is already destructed at those points,
and we can't pump the message loops.

TBR=tsepez@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1236603003 .

4 years agoPlumb in an externally created v8::Isolate
Jochen Eisinger [Wed, 15 Jul 2015 12:31:29 +0000]
Plumb in an externally created v8::Isolate

In Chrome, all Isolates must be created by gin

R=tsepez@chromium.org, ulan@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1234053003 .

4 years agoPump the v8 message loop in tests
Jochen Eisinger [Wed, 15 Jul 2015 12:28:17 +0000]
Pump the v8 message loop in tests

R=tsepez@chromium.org, ulan@chromium.org
BUG=none

Review URL: https://codereview.chromium.org/1230393006 .

4 years agoMove extern cmap declarations from .cpp files into new .h files.
Tom Sepez [Wed, 15 Jul 2015 00:06:23 +0000]
Move extern cmap declarations from .cpp files into new .h files.

That way, the compiler can check them against the definitions rather
than just relying on the linker to line things up.

Make the types of the declarations and definitions match exactly,
instead of being synonym typedefs of each other.

Fix some IWYU and use FX_ArraySize where possible.

BUG=https://code.google.com/p/pdfium/issues/detail?id=178
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1221503005 .

4 years agoMove FPDFAPI_FlateInit() prototype and friends to .h file
Tom Sepez [Tue, 14 Jul 2015 23:33:32 +0000]
Move FPDFAPI_FlateInit() prototype and friends to .h file

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1240713004 .

4 years agoTighten up DEPS include rules.
Tom Sepez [Tue, 14 Jul 2015 23:17:53 +0000]
Tighten up DEPS include rules.

Allows the following command to return only legitimate
warnings:
  buildtools/checkdeps/checkdeps.py --resolve-dotdot

The remaining warnings consist of:
  - fx_parser_filters.cpp, due to inclusion of
    third_party/zlib_v128/zlib.h, showing the lack
    of a header and some prototypes in that .cpp file.

  - third_party/*, due to inclusion of fx_system.h and
    the like, indicating adulterated libraries that should
    be restored to their pristine state.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1233583004 .

4 years agoFix an integer overflow issue in openJpeg
JUN FANG [Mon, 13 Jul 2015 13:34:20 +0000]
Fix an integer overflow issue in openJpeg

Fixing this issue for an urgent request. It should be fixed in OpenJPEG side.

BUG=506763
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1231933008 .

4 years agoFix a crashier due to incorrect type conversion
JUN FANG [Mon, 13 Jul 2015 11:20:10 +0000]
Fix a crashier due to incorrect type conversion

BUG=issue179
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1217093006 .

4 years agoMake CJBig2_Object::operator delete accept nullptr
Vitaly Buka [Fri, 10 Jul 2015 22:40:59 +0000]
Make CJBig2_Object::operator delete accept nullptr

Standard delete operator should do noting for nullptr.
Overloaded CJBig2_Object::operator delete de-referenced
provided pointer causing crashes after
https://codereview.chromium.org/1192743004/

TBR=thestig
BUG=508197

Review URL: https://codereview.chromium.org/1230763007 .

4 years agoRemove a superfluous qualifier. No behavior change.
Nico Weber [Sat, 4 Jul 2015 22:07:29 +0000]
Remove a superfluous qualifier. No behavior change.

BUG=505296
R=brucedawson@chromium.org

Review URL: https://codereview.chromium.org/1221673007.

4 years agoAdd parentheses around && within ||.
Nico Weber [Thu, 2 Jul 2015 21:40:08 +0000]
Add parentheses around && within ||.

BUG=504699
R=raymes@chromium.org, thakis@chromium.org

Review URL: https://codereview.chromium.org/1213433005.

4 years agoRevert "Revert "Redo range check in CPDF_SampledFunc::v_Call().""
Tom Sepez [Wed, 1 Jul 2015 23:14:29 +0000]
Revert "Revert "Redo range check in CPDF_SampledFunc::v_Call().""

This reverts commit 327080bacabb3d90094144e66ae57037d4a8d8e6.
This re-lands the patch, but removes the tests which would require
512MB buffers to be reliably allocatable on small bots. It
also adds
small fixes accumulated while diagnosing it.

R=sanqingsong@gmail.com

Review URL: https://codereview.chromium.org/1214403002.

4 years agoFix some clang warnings with -Wmissing-braces in pdfium.
Nico Weber [Wed, 1 Jul 2015 21:08:08 +0000]
Fix some clang warnings with -Wmissing-braces in pdfium.

Clang warns if there are missing braces around a subobject
initializer. The most common idiom that triggers this is:
  STRUCT s = {0};
if the first field of STRUCT is itself a struct. This can
be more simply written as:
  STRUCT s = {};
which also prevents the warning from firing.

Other instances of the warning have been fixed by adding
braces where appropriate.

R=brucedawson@chromium.org

Review URL: https://codereview.chromium.org/1213523004.

4 years agoFix a clang warning about a dangling else.
Tom Sepez [Tue, 30 Jun 2015 21:48:48 +0000]
Fix a clang warning about a dangling else.

BUG=none
R=brucedawson@chromium.org

Review URL: https://codereview.chromium.org/1223433002.

4 years agoRevert "Redo range check in CPDF_SampledFunc::v_Call()."
Tom Sepez [Tue, 30 Jun 2015 19:28:46 +0000]
Revert "Redo range check in CPDF_SampledFunc::v_Call()."

This reverts commit 74742a75ac7a07c08cf36fe6f4eaa91bed8236a3.

4 years agoRedo range check in CPDF_SampledFunc::v_Call().
Tom Sepez [Tue, 30 Jun 2015 19:18:55 +0000]
Redo range check in CPDF_SampledFunc::v_Call().

The current |bitpos1| calculation protects the passed argument to
_GetBits32(): |bitpos.ValueOrDie() + j * m_nBitsPerSample|, but doesn't
account for adding in the sample length in that routine.

Also bound bits per sample to something reasonable to avoid undefined
behaviour on the shift to compute the max value.

BUG=471990
R=jun_fang@foxitsoftware.com

Review URL: https://codereview.chromium.org/1219663003.

4 years agoRemove references to three deleted files.
Bruce Dawson [Mon, 29 Jun 2015 20:13:28 +0000]
Remove references to three deleted files.

The gyp-to-ninja conversion process doesn't check for missing files, so
they creep in. This change deletes three files that were deleted or
never added but which are referenced from .gyp files.

To see warnings about deleted files (Windows only) set GYP_GENERATORS
to msvs-ninja,ninja before running build\gyp_pdfium. The msvs-ninja
generator warns on missing files.

R=tsepez@chromium.org
BUG=483424

Review URL: https://codereview.chromium.org/1201273006.

4 years agoFix Javascript tests after commit f55771af6429.
Lei Zhang [Mon, 22 Jun 2015 22:36:49 +0000]
Fix Javascript tests after commit f55771af6429.

- Return true instead of false. All the other unsupported JS
  functions return true.
- Adjust test expectations accordingly.

TBR=jam@chromium.org

Review URL: https://codereview.chromium.org/1196163006.

4 years agoCleanup: Get rid of CPDF_Reference::Create().
Lei Zhang [Mon, 22 Jun 2015 22:16:15 +0000]
Cleanup: Get rid of CPDF_Reference::Create().

Just call new CPDF_Reference instead.

R=jam@chromium.org

Review URL: https://codereview.chromium.org/1194343002.

4 years agoCleanup: Remove more checks for new returning NULL.
Lei Zhang [Mon, 22 Jun 2015 22:13:36 +0000]
Cleanup: Remove more checks for new returning NULL.

R=jam@chromium.org

Review URL: https://codereview.chromium.org/1198903002.

4 years agoCleanup: Remove CFX_MapPtrToPtr from fpdfppo.cpp.
Lei Zhang [Mon, 22 Jun 2015 22:11:56 +0000]
Cleanup: Remove CFX_MapPtrToPtr from fpdfppo.cpp.

R=jam@chromium.org

Review URL: https://codereview.chromium.org/1194153002.

4 years agoDelete dead code for deleting pages and icons.
Lei Zhang [Mon, 22 Jun 2015 22:10:28 +0000]
Delete dead code for deleting pages and icons.

1) Document::deletePages()
2) CPDFSDK_Document::DeletePages()
3) Document::removeIcon()
4) IconTree::DeleteIconElement()

Originally (1) called (2), but only when FOXIT_CHROME_BUILD was not
defined. Since it was always defined for PDFium, this was effectively
dead code the whole time. Ditto for (3) and (4). The functions were
deemed unsafe in https://crbug.com/67100

R=jam@chromium.org

Review URL: https://codereview.chromium.org/1193323002.

4 years agoCleanup: Remove dead formfiller code.
Lei Zhang [Mon, 22 Jun 2015 22:09:03 +0000]
Cleanup: Remove dead formfiller code.

R=jam@chromium.org

Review URL: https://codereview.chromium.org/1196853002.

4 years agoCleanup: Remove dead CPDF_InlineImages code.
Lei Zhang [Fri, 19 Jun 2015 22:11:20 +0000]
Cleanup: Remove dead CPDF_InlineImages code.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1192413007.

4 years agoReplace CFX_MapPtrTemplate with std::map.
Lei Zhang [Fri, 19 Jun 2015 22:09:45 +0000]
Replace CFX_MapPtrTemplate with std::map.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1181593003.

4 years agoCleanup: Do not check pointers before deleting them.
Lei Zhang [Fri, 19 Jun 2015 21:51:10 +0000]
Cleanup: Do not check pointers before deleting them.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1192743004.

4 years agoSmall cleanup of CPDF_TextObject and other CPDF_PageObject subclasses.
Lei Zhang [Fri, 19 Jun 2015 21:43:51 +0000]
Small cleanup of CPDF_TextObject and other CPDF_PageObject subclasses.

- Add overrides
- Remove empty overrides
- Remove dead friends
- Cleanup bad formatting

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1199563002.

4 years agoDisintermediation.
Tom Sepez [Fri, 19 Jun 2015 20:38:19 +0000]
Disintermediation.

Removed several header files that simply proxy other headers.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1199553002.

4 years agoMove zlib to third_party/
Tom Sepez [Fri, 19 Jun 2015 19:39:19 +0000]
Move zlib to third_party/

Remove some fx_* files that simply included other files along the way.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1197693003.

4 years agoMove libopenjpeg to third_party/
Tom Sepez [Fri, 19 Jun 2015 00:05:27 +0000]
Move libopenjpeg to third_party/

We get to delete a whole bunch of fx_foo.c files that did nothing
but #include "foo.c" after defining _CRT_SECURE_NO_WARNINGS. Do this
from the .gyp/.gn files instead.

Also sort some "config"s in .gn file.

R=thestig@chromium.org

Committed: https://pdfium.googlesource.com/pdfium/+/c7a17bf9cdb0d646aa8b653e6ab2678a1837ed6a

Review URL: https://codereview.chromium.org/1185373010.

4 years agoFix CPDF_ICCBasedCS::GetDefaultValue heap-buffer-overflow.
Tom Sepez [Thu, 18 Jun 2015 22:58:26 +0000]
Fix CPDF_ICCBasedCS::GetDefaultValue heap-buffer-overflow.

Introduced in ea44bd0.  Re-animating the dead (code) usually turns
out badly, and this is no exception.  Make both of the uncallable
methods go away.

BUG=501889
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1179773007.

4 years agoRevert "Move libopenjpeg to third_party/"
Tom Sepez [Thu, 18 Jun 2015 00:30:47 +0000]
Revert "Move libopenjpeg to third_party/"

This reverts commit c7a17bf9cdb0d646aa8b653e6ab2678a1837ed6a.

4 years agoMove libopenjpeg to third_party/
Tom Sepez [Thu, 18 Jun 2015 00:17:14 +0000]
Move libopenjpeg to third_party/

We get to delete a whole bunch of fx_foo.c files that did nothing
but #include "foo.c" after defining _CRT_SECURE_NO_WARNINGS. Do this
from the .gyp/.gn files instead.

Also sort some "config"s in .gn file.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1185373010.

4 years agoReplace some Release() calls with virtual destructors.
Tom Sepez [Wed, 17 Jun 2015 23:38:51 +0000]
Replace some Release() calls with virtual destructors.

A virtual method that does |delete this| is an anti-pattern.
Some classes can be de-virtualized instead.
Throw in some unique_ptrs and delete dead code for good measure.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1192013002.

4 years agoRun GYP after gclient sync.
Tom Sepez [Wed, 17 Jun 2015 22:46:38 +0000]
Run GYP after gclient sync.

Makes the behaviour consistent with chromium.
Also fix some indentation.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1193563002.

4 years agoMove libjpeg to third_party/
Tom Sepez [Wed, 17 Jun 2015 22:24:01 +0000]
Move libjpeg to third_party/

Removal of fpdfapi_ suffix can be part of a future CL.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1186113005.

4 years agoMove lcms2 into third_party
Tom Sepez [Wed, 17 Jun 2015 17:48:05 +0000]
Move lcms2 into third_party

Second CL to apply less restrictive flags to third party.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1181943008.

4 years agoSeparate agg-authored code from fx-authored code.
Tom Sepez [Tue, 16 Jun 2015 23:29:44 +0000]
Separate agg-authored code from fx-authored code.

Creates a separate library so we can apply less-strict warnings to
the code we can't change from upstream vs. the code we can change,
reducing noise in the standalone build.

Remove needless foo.{cpp,h} files that merely perform indirection
via #include "some_other_path/foo.{cpp,h}".

BUG=pdfium:166
R=brucedawson@chromium.org, thestig@chromium.org

Review URL: https://codereview.chromium.org/1152743007.

4 years agoAdd constructor for CPDF_ColorSpace.
Tom Sepez [Tue, 16 Jun 2015 23:18:47 +0000]
Add constructor for CPDF_ColorSpace.

Prevents sub-classes from tweaking parent class instance vars.

Also "fix" https://code.google.com/p/pdfium/issues/detail?id=170, assuming 0 is a good value.

BUG=pdfium:170
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1185903002.

4 years agoMake CPDF_PageModuleDef and CPDF_RenderModuleDef pure virtual.
Lei Zhang [Tue, 16 Jun 2015 00:15:12 +0000]
Make CPDF_PageModuleDef and CPDF_RenderModuleDef pure virtual.

Get rid of the dummy implementations, which are never used when
the modules have been initialized.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1177383003.

4 years agoDo some IWYU cleanups.
Lei Zhang [Mon, 15 Jun 2015 23:44:14 +0000]
Do some IWYU cleanups.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1176333002.

4 years agoProvide a constructor for CPDF_CountedObject.
Tom Sepez [Mon, 15 Jun 2015 23:43:26 +0000]
Provide a constructor for CPDF_CountedObject.

Make members protected and remove external manipulations.
Move "*" into template since its always an indirection.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1182903002.

4 years agoRemove some dead code.
Lei Zhang [Mon, 15 Jun 2015 18:45:48 +0000]
Remove some dead code.

Review URL: https://codereview.chromium.org/1186673005.

4 years agoFix -Winconsistent-missing-override warnings.
Lei Zhang [Mon, 15 Jun 2015 18:41:44 +0000]
Fix -Winconsistent-missing-override warnings.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1187463003.

4 years agoRemove unneeded checks in CPDF_DocPageData::GetFontFileStreamAcc().
Lei Zhang [Sat, 13 Jun 2015 02:14:11 +0000]
Remove unneeded checks in CPDF_DocPageData::GetFontFileStreamAcc().

The input cannot be null. Same for CPDF_Document::LoadFontFile().

Also set the contract for CPDF_Document::LoadFont() and adjust callers
accordingly.

Also remove unused CPDF_Document::FindFont().

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1184673002.

4 years agoCorpus tests check for unexpected successes.
Tom Sepez [Fri, 12 Jun 2015 16:11:00 +0000]
Corpus tests check for unexpected successes.

Update run_corpus_tests.py to always run all test cases, and just
ignore the results that are supposed to fail.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1178393002.

4 years agoRemove trailing whitespaces in core.
Lei Zhang [Thu, 11 Jun 2015 22:17:59 +0000]
Remove trailing whitespaces in core.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1177973008.

4 years agoRemove unused reflow code.
Lei Zhang [Thu, 11 Jun 2015 21:59:16 +0000]
Remove unused reflow code.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1181803002.

4 years agoRemove trailing whitespaces in fpdfsdk.
Lei Zhang [Thu, 11 Jun 2015 21:00:52 +0000]
Remove trailing whitespaces in fpdfsdk.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1173343004.

4 years agoCorrect unexpected hinting fonts
Tom Sepez [Thu, 11 Jun 2015 20:25:12 +0000]
Correct unexpected hinting fonts

If the font is 'tricky', it needs to be hinted by default according to the description in freetype.

BUG=490814
R=tsepez@chromium.org

Committed: https://pdfium.googlesource.com/pdfium/+/7a2fcd8d1256c267380b40f2d2d8e98c3b181cee

Review URL: https://codereview.chromium.org/1170313003.

4 years agoCleanup: Get this rid of "this->" in fpdfsdk/
Lei Zhang [Thu, 11 Jun 2015 20:03:09 +0000]
Cleanup: Get this rid of "this->" in fpdfsdk/

Also remove commented out code and trailing whitespaces.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1179653005.

4 years agoKill FXSYS_mem{cpy,cmp,set.move}{32,8}.
Tom Sepez [Thu, 11 Jun 2015 19:05:04 +0000]
Kill FXSYS_mem{cpy,cmp,set.move}{32,8}.

At one point in time, it may have made sense to indicate the
expected alignment of the memory you're about to copy, but that
was last century. The compiler will take care of it just fine.

I stopped short of removing the FXSYS_ wrapper macros entirely.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1179693003.

4 years agoCleanup: Remove uses of "this->" in core/
Lei Zhang [Thu, 11 Jun 2015 06:33:26 +0000]
Cleanup: Remove uses of "this->" in core/

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1173223002.

4 years agoConvert CPDF_FontFileMap to std::map.
Lei Zhang [Thu, 11 Jun 2015 02:24:29 +0000]
Convert CPDF_FontFileMap to std::map.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1144333008.

4 years agoConvert CPDF_IccProfileMap to use std::map.
Lei Zhang [Thu, 11 Jun 2015 02:23:32 +0000]
Convert CPDF_IccProfileMap to use std::map.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1143133008.

4 years agoRemove FX_BSTR and FX_WSTR typedefs.
Tom Sepez [Wed, 10 Jun 2015 23:51:15 +0000]
Remove FX_BSTR and FX_WSTR typedefs.

These stand for const CFX_{Byte,Wide}StringC&, which is just
monumentally confusing, since there are so many string types
running around here.

The following had manual changes:
core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
core/src/fpdfdoc/doc_form.cpp
fpdfsdk/src/fpdf_ext.cpp

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1180593004.

4 years agoFix font rendering issues because of an incorrect transform.
John Abd-El-Malek [Wed, 10 Jun 2015 22:44:42 +0000]
Fix font rendering issues because of an incorrect transform.

This regressed in https://pdfium.googlesource.com/pdfium/+/71c24b839498fb89184002ed30fcff353e1e402c. The code would reach into FreeType internals and reset transform_flags. This would effectively set the font's transform matrix to the identity (since a transform is only used if the flag is set). I removed it because I assumed this is only a cache, and any other place that would call FT_Load_Glyph would have set a transform first. Apparently that's not the case (verified through adding some additional code). The fix is to reset the transform matrix after changing it. This is functionally equivalent to the previous behavior, since if the flag was 0 but there was a transform, it would be ignored until another transform is set.

BUG=479434
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1163423005.

4 years agoConvert CPDF_ImageMap to std::map.
Lei Zhang [Wed, 10 Jun 2015 22:25:22 +0000]
Convert CPDF_ImageMap to std::map.

Also simplify CPDF_DocPageData::ReleaseIccProfile() since its first
argument is always null.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1149273004.

4 years agoCache the CPDF_Annot's subtype, since it should never changes.
Lei Zhang [Wed, 10 Jun 2015 20:29:24 +0000]
Cache the CPDF_Annot's subtype, since it should never changes.

BUG=495300
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1178513002.

4 years agoConvert CPDF_PatternMap to std::map.
Lei Zhang [Wed, 10 Jun 2015 20:18:06 +0000]
Convert CPDF_PatternMap to std::map.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1162123004.

4 years agoCleanup: Remove CFFL_IFormFiller::GetCommitKey() that always returns 0.
Lei Zhang [Wed, 10 Jun 2015 18:47:08 +0000]
Cleanup: Remove CFFL_IFormFiller::GetCommitKey() that always returns 0.

Remove callers and related code that all just pass zeros around.

Also remove CFFL_IFormFiller::GetKeyDown().

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1149623012.

4 years agoConvert CPDF_ColorSpaceMap to std::map.
Lei Zhang [Wed, 10 Jun 2015 18:32:54 +0000]
Convert CPDF_ColorSpaceMap to std::map.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1154963003.