pdfium.git
4 years ago_FETAL => _FATAL.
Tom Sepez [Wed, 22 Jul 2015 19:48:58 +0000]
_FETAL => _FATAL.

R=thestig@chromium.org

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

4 years agoMerge to XFA: Move extern fpdf_font_charset.cpp function prototypes.
Tom Sepez [Tue, 21 Jul 2015 23:54:32 +0000]
Merge to XFA: Move extern fpdf_font_charset.cpp function prototypes.

(cherry picked from commit c5fa7f2a36ebd4c92c935e1332a2f7db4f3594d9)
Orignal Review URL: https://codereview.chromium.org/1241173004 .

TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Tidy up CPDFDOC_Environment.
Tom Sepez [Fri, 17 Jul 2015 16:16:17 +0000]
Merge to XFA: Tidy up CPDFDOC_Environment.

Original Review URL: https://codereview.chromium.org/1235393002 .
(cherry picked from commit fb07e2843dad0774d5842c2b08e7792164efc14a)

R=thestig@chromium.org

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

4 years agoMerge to XFA: Sort unexpected test results.
Lei Zhang [Fri, 17 Jul 2015 01:46:57 +0000]
Merge to XFA: Sort unexpected test results.

No typos here.

R=tsepez@chromium.org

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

(cherry picked from commit d3611f9db615be393016a8ab5340ccea7f13832b)

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

4 years agoMerge to XFA: Cleanup: Do not check pointers before deleting them, part 2.
Lei Zhang [Fri, 17 Jul 2015 01:45:22 +0000]
Merge to XFA: Cleanup: Do not check pointers before deleting them, part 2.

R=tsepez@chromium.org

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

(cherry picked from commit 21bf242a31eff79f754c5e9c3b41c52e33483bb0)

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

4 years agoXFA: Add a comment regarding the shut down order.
Lei Zhang [Thu, 16 Jul 2015 17:06:11 +0000]
XFA: Add a comment regarding the shut down order.

R=tsepez@chromium.org

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

4 years agoMerge to XFA: Make ContentStreamParser members private, fix constructor
Tom Sepez [Wed, 15 Jul 2015 23:59:30 +0000]
Merge to XFA: Make ContentStreamParser members private, fix constructor

(cherry picked from commit 5b4f57cdc0a279bd9b8e03b8f5714b9d39e642a8)
Original Review URL: https://codereview.chromium.org/1219683007 .

TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Kill Func_Renderpage global function pointer.
Tom Sepez [Wed, 15 Jul 2015 23:35:53 +0000]
Merge to XFA: Kill Func_Renderpage global function pointer.

(cherry picked from commit e3db14f4d0e11ed30bd7e014ffa8cea9d6fb93ad)
Original Review URL: https://codereview.chromium.org/1233203004 .

R=thestig@chromium.org
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Add a null pointer check to CPDF_CalRGB::v_Load().
Lei Zhang [Wed, 15 Jul 2015 23:32:06 +0000]
Merge to XFA: Add a null pointer check to CPDF_CalRGB::v_Load().

BUG=492055
R=tsepez@chromium.org

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

(cherry picked from commit bf4598870df6b1ebd511d61d46bc55e1d814ce2d)

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

4 years agoXFA merge: Remove references to three deleted files.
Bruce Dawson [Wed, 15 Jul 2015 20:33:07 +0000]
XFA merge: 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.

Ported from https://codereview.chromium.org/1201273006.

TBR=tsepez@chromium.org
BUG=483424

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

4 years agoMerge to XFA: Move extern cmap declarations from .cpp files.
Tom Sepez [Wed, 15 Jul 2015 00:16:13 +0000]
Merge to XFA: Move extern cmap declarations from .cpp files.

(cherry picked from commit 759247991b5f1df71335294e6bfe3e3fe7aec7b4)
Original Review URL: https://codereview.chromium.org/1221503005 .

TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Move FPDFAPI_FlateInit() prototype and friends to .h file
Tom Sepez [Tue, 14 Jul 2015 23:43:54 +0000]
Merge to XFA: Move FPDFAPI_FlateInit() prototype and friends to .h file

(cherry picked from commit dacc22cdfea727a04bce086d9bfec9a4d1a29bd4)
Orignal Review URL: https://codereview.chromium.org/1240713004 .
TBR=thestig@chromium.org

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

4 years agoAdd a few include rules for XFA-specific files.
Tom Sepez [Tue, 14 Jul 2015 23:39:16 +0000]
Add a few include rules for XFA-specific files.

Checkdeps is still pretty noisy on XFA.  There is some confusion
about finding include files since not all are relative.

R=thestig@chromium.org

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

4 years agoMerge to XFA: Tighten up DEPS include rules.
Tom Sepez [Tue, 14 Jul 2015 23:21:49 +0000]
Merge to XFA: Tighten up DEPS include rules.

Original Review URL: https://codereview.chromium.org/1233583004 .
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Fix an integer overflow issue in openJpeg
JUN FANG [Mon, 13 Jul 2015 13:34:20 +0000]
Merge to XFA: 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 agoMerge to XFA: Fix a crashier due to incorrect type conversion
JUN FANG [Mon, 13 Jul 2015 11:20:10 +0000]
Merge to XFA: Fix a crashier due to incorrect type conversion

BUG=issue179
R=tsepez@chromium.org

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

4 years agoCherry-pick to XFA: Remove a superfluous qualifier. No behavior change.
Nico Weber [Sat, 4 Jul 2015 22:07:29 +0000]
Cherry-pick to XFA: Remove a superfluous qualifier. No behavior change.

BUG=505296
R=brucedawson@chromium.org

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

4 years agoCherry-pick to XFA: Add parentheses around && within ||.
Nico Weber [Thu, 2 Jul 2015 21:40:08 +0000]
Cherry-pick to XFA: Add parentheses around && within ||.

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

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

4 years agoMerge to XFA: "Redo range check in CPDF_SampledFunc::v_Call().""
Tom Sepez [Wed, 1 Jul 2015 23:27:42 +0000]
Merge to XFA: "Redo range check in CPDF_SampledFunc::v_Call().""

Original Review URL: https://codereview.chromium.org/1214403002.
(cherry picked from commit 0b0f2130e403aaa558a04ffa664e6f4f0f38d1b1)

BUG=471990
TBR=jun_fang@foxitsoftware.com

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

4 years agoCherry-pick to XFA: Fix a clang warning about a dangling else.
Tom Sepez [Tue, 30 Jun 2015 21:48:48 +0000]
Cherry-pick to XFA: Fix a clang warning about a dangling else.

BUG=none
R=brucedawson@chromium.org

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

4 years agoCherry-pick to XFA: Fix some clang warnings with -Wmissing-braces in pdfium.
Nico Weber [Wed, 1 Jul 2015 21:08:08 +0000]
Cherry-pick to XFA: 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 agoMerge to XFA: Replace some CFX_MapPtrTemplates with std::map.
Lei Zhang [Sat, 20 Jun 2015 01:11:07 +0000]
Merge to XFA: Replace some CFX_MapPtrTemplates with std::map.

There are more CFX_MapPtrTemplate usage on the XFA branch, so it is
not removed.

R=tsepez@chromium.org

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

(cherry picked from commit e8d3691c82d1be805ffdce3329d00313af7ce0ab)

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

4 years agoMerge to XFA: Cleanup: Do not check pointers before deleting them.
Lei Zhang [Sat, 20 Jun 2015 00:26:17 +0000]
Merge to XFA: Cleanup: Do not check pointers before deleting them.

R=tsepez@chromium.org

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

(cherry picked from commit cfac954abcab7caf47d3fa3d641c553cba998271)

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

4 years agoMerge to XFA: Cleanup: Remove dead CPDF_InlineImages code.
Lei Zhang [Sat, 20 Jun 2015 00:20:35 +0000]
Merge to XFA: Cleanup: Remove dead CPDF_InlineImages code.

R=tsepez@chromium.org

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

(cherry picked from commit 59d60a587180cb6bbd49d4e739fb6ccd2b15d4d2)

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

4 years agoMerge to XFA: Small cleanup of CPDF_TextObject and other CPDF_PageObject subclasses.
Lei Zhang [Sat, 20 Jun 2015 00:19:23 +0000]
Merge to XFA: 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.

(cherry picked from commit df558514bf5cb5750d5a7000a843f45f4170d5a4)

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

4 years agoMerge to XFA: Make CPDF_PageModuleDef and CPDF_RenderModuleDef pure virtual.
Lei Zhang [Sat, 20 Jun 2015 00:17:54 +0000]
Merge to XFA: 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.

(cherry picked from commit 5fef754bc09e971f1bf1ba79da98c0a7ee1e1c8d)

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

4 years agoMerge to XFA: Do some IWYU cleanups.
Lei Zhang [Sat, 20 Jun 2015 00:15:41 +0000]
Merge to XFA: Do some IWYU cleanups.

R=tsepez@chromium.org

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

(cherry picked from commit 0ef0de55657db8a83372ad8eb22d84c5893afc4c)

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

4 years agoMerge to XFA: Remove some dead code.
Lei Zhang [Fri, 19 Jun 2015 23:48:22 +0000]
Merge to XFA: Remove some dead code.

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

(cherry picked from commit 38f5c338fdc2daf79668cf7567298d9f62e4ba23)

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

4 years agoMerge to XFA: Fix -Winconsistent-missing-override warnings.
Lei Zhang [Fri, 19 Jun 2015 23:46:40 +0000]
Merge to XFA: Fix -Winconsistent-missing-override warnings.

R=tsepez@chromium.org

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

(cherry picked from commit 8bd09648445aef8a9ae38d9f61618bd2013ac3f0)

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

4 years agoFix -Wnon-virtual-dtor warnings on the XFA branch.
Lei Zhang [Fri, 19 Jun 2015 21:58:28 +0000]
Fix -Wnon-virtual-dtor warnings on the XFA branch.

R=tsepez@chromium.org

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

4 years agoMerge to XF: Disintermediation.
Tom Sepez [Fri, 19 Jun 2015 20:56:28 +0000]
Merge to XF: Disintermediation.

(cherry picked from commit 012ada613a1462f109eb59790f8e5ee91aacdb7e)
Review URL: https://codereview.chromium.org/1199553002.

TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Move zlib to third_party/
Tom Sepez [Fri, 19 Jun 2015 19:57:10 +0000]
Merge to XFA: Move zlib to third_party/

(cherry picked from commit 959eb05140a8f5af7724a2da4cf5d04e2e50f4a6)
Original Review URL: https://codereview.chromium.org/1197693003.

TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Move libopenjpeg to third_party/
Tom Sepez [Fri, 19 Jun 2015 00:51:37 +0000]
Merge to XFA: Move libopenjpeg to third_party/

Original Review URL: https://codereview.chromium.org/1185373010.
TBR=thestig@chromium.org

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

4 years agoFix XFA builds under chromium checkouts
Tom Sepez [Fri, 19 Jun 2015 00:44:29 +0000]
Fix XFA builds under chromium checkouts

This pulls in from origin/master:
94dd28e Update GN build files w/ cpu_arch -> current_cpu changes.
1e580a1 Fix multiply defined macro in zlib.h

Add a missing file to BUILD.gn dropped at 1ed8a21.

TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Fix CPDF_ICCBasedCS::GetDefaultValue heap-buffer-overflow.
Tom Sepez [Thu, 18 Jun 2015 23:12:39 +0000]
Merge to XFA: Fix CPDF_ICCBasedCS::GetDefaultValue heap-buffer-overflow.

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

BUG=501889
TBR=thestig@chromium.org

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

4 years agoReplace some Release() calls with virtual destructors.
Tom Sepez [Thu, 18 Jun 2015 19:47:11 +0000]
Replace some Release() calls with virtual destructors.

Required fixing xfa-specific code.

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

R=thestig@chromium.org

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

4 years agoMerge to XFA: Run GYP after gclient sync.
Tom Sepez [Wed, 17 Jun 2015 22:56:43 +0000]
Merge to XFA: Run GYP after gclient sync.

TBR=thestig@chromium.org
Original Review URL: https://codereview.chromium.org/1193563002.

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

4 years agoMerge to XFA: Move libjpeg to third_party/
Tom Sepez [Wed, 17 Jun 2015 22:46:03 +0000]
Merge to XFA: Move libjpeg to third_party/

Original Review URL: https://codereview.chromium.org/1186113005.
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Move lcms2 into third_party
Tom Sepez [Wed, 17 Jun 2015 18:05:02 +0000]
Merge to XFA: Move lcms2 into third_party

Original Review URL: https://codereview.chromium.org/1181943008.
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Separate agg-authored code from fx-authored code.
Tom Sepez [Wed, 17 Jun 2015 17:01:00 +0000]
Merge to XFA: Separate agg-authored code from fx-authored code.

Original Review URL: https://codereview.chromium.org/1152743007.
BUG=pdfium:166
R=brucedawson@chromium.org, thestig@chromium.org
TBR=brucedawson@chromium.org, thestig@chromium.org

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

4 years agoMerge to XF: Add constructor for CPDF_ColorSpace.
Tom Sepez [Tue, 16 Jun 2015 23:27:57 +0000]
Merge to XF: Add constructor for CPDF_ColorSpace.

Original review URL: https://codereview.chromium.org/1185903002.
BUG=pdfium:170
TBR=thestig@chromium.org

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

4 years agoXFA: Write new as "new" rather than using several macros.
Tom Sepez [Tue, 16 Jun 2015 23:00:24 +0000]
XFA: Write new as "new" rather than using several macros.

Really?

R=thestig@chromium.org

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

4 years agoMerge to XFA: Provide a constructor for CPDF_CountedObject.
Tom Sepez [Mon, 15 Jun 2015 23:58:19 +0000]
Merge to XFA: Provide a constructor for CPDF_CountedObject.

Original Review URL: https://codereview.chromium.org/1182903002.
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Remove unneeded checks in CPDF_DocPageData::GetFontFileStreamAcc().
Lei Zhang [Sat, 13 Jun 2015 08:01:06 +0000]
Merge to XFA: 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.

(cherry picked from commit 1972b16849fedfda675eacd5c8594b54dbd1264d)

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

4 years agoRemove trailing whitespaces in core, XFA edition.
Lei Zhang [Sat, 13 Jun 2015 07:58:06 +0000]
Remove trailing whitespaces in core, XFA edition.

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

4 years agoRemove trailing whitespaces in fpdfsdk, XFA edition.
Lei Zhang [Sat, 13 Jun 2015 07:48:38 +0000]
Remove trailing whitespaces in fpdfsdk, XFA edition.

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

4 years agoMerge to XFA: Remove unused reflow code.
Lei Zhang [Sat, 13 Jun 2015 07:44:09 +0000]
Merge to XFA: Remove unused reflow code.

R=tsepez@chromium.org

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

(cherry picked from commit f25db681003f0247e97bfef22be56a8aa02b7595)

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

4 years agoMerge to XFA: Cleanup: Get this rid of "this->" in fpdfsdk/
Lei Zhang [Sat, 13 Jun 2015 07:41:00 +0000]
Merge to XFA: 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.

(cherry picked from commit eda202769e5c79eba1d2fb5090f6e9cf176e2d4a)

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

4 years agoMerge to XFA: Cleanup: Remove uses of "this->" in core/
Lei Zhang [Sat, 13 Jun 2015 07:31:30 +0000]
Merge to XFA: Cleanup: Remove uses of "this->" in core/

R=tsepez@chromium.org

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

(cherry picked from commit 2b5e0d5b20654d116045484868c9e015ed698124)

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

4 years agoMerge to XFA: Corpus tests check for unexpected successes.
Tom Sepez [Fri, 12 Jun 2015 16:27:46 +0000]
Merge to XFA: Corpus tests check for unexpected successes.

Original Review URL: https://codereview.chromium.org/1178393002.
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Correct unexpected hinting fonts
Tom Sepez [Thu, 11 Jun 2015 22:24:26 +0000]
Merge to XFA: Correct unexpected hinting fonts

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

BUG=490814
TBR=jun_fang@foxitsoftware.com

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

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

4 years agoMerge to XFA: Kill FXSYS_mem{cpy,cmp,set.move}{32,8}.
Tom Sepez [Thu, 11 Jun 2015 19:17:45 +0000]
Merge to XFA: Kill FXSYS_mem{cpy,cmp,set.move}{32,8}.

Only manual merge was core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
follwed by scripts.

Original Review URL: https://codereview.chromium.org/1179693003.
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Convert CPDF_FontFileMap to std::map.
Lei Zhang [Thu, 11 Jun 2015 06:26:11 +0000]
Merge to XFA: Convert CPDF_FontFileMap to std::map.

R=tsepez@chromium.org

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

(cherry picked from commit f726c92cb2cf5739fd5b21e825e5bf510040c62f)

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

4 years agoMerge to XFA: Convert CPDF_IccProfileMap to use std::map.
Lei Zhang [Thu, 11 Jun 2015 06:23:45 +0000]
Merge to XFA: Convert CPDF_IccProfileMap to use std::map.

R=tsepez@chromium.org

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

(cherry picked from commit 77713645f64214b8d5e79f62a92bb03452ce232e)

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

4 years agoMerge to XFA: Convert CPDF_ImageMap to std::map.
Lei Zhang [Thu, 11 Jun 2015 06:21:52 +0000]
Merge to XFA: 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.

(cherry picked from commit a8a718c974210a919f2af0b099d540143cf330c6)

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

4 years agoMerge to XFA: Convert CPDF_PatternMap to std::map.
Lei Zhang [Thu, 11 Jun 2015 06:19:42 +0000]
Merge to XFA: Convert CPDF_PatternMap to std::map.

R=tsepez@chromium.org

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

(cherry picked from commit b3aa96cbee31e81d0a72a61027467a2713654499)

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

4 years agoMerge to XFA: Convert CPDF_ColorSpaceMap to std::map.
Lei Zhang [Thu, 11 Jun 2015 06:17:04 +0000]
Merge to XFA: Convert CPDF_ColorSpaceMap to std::map.

R=tsepez@chromium.org

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

(cherry picked from commit 22f429fc4875027b10ab071102c9ac8a88abf825)

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

4 years agoMerge to XFA: Convert CPDF_FontMap to std::map.
Lei Zhang [Thu, 11 Jun 2015 06:14:43 +0000]
Merge to XFA: Convert CPDF_FontMap to std::map.

R=tsepez@chromium.org

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

(cherry picked from commit 3c949d5d2b0d680839766ea99c86b263230b263d)

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

4 years agoMerge to XFA: Remove FX_BSTR and FX_WSTR typedefs.
Tom Sepez [Thu, 11 Jun 2015 00:38:11 +0000]
Merge to XFA: Remove FX_BSTR and FX_WSTR typedefs.

Nearly automatic merge + re-run script on new files.

Original Review URL: https://codereview.chromium.org/1180593004.
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Cleanup: Remove CFFL_IFormFiller::GetCommitKey() that always returns 0.
Lei Zhang [Wed, 10 Jun 2015 22:23:23 +0000]
Merge to XFA: 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.

(cherry picked from commit 35c3163d55bebea8095474181f807ddfb2f4f806)

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

4 years agoMerge to XFA: Cache the CPDF_Annot's subtype, since it should never changes.
Lei Zhang [Wed, 10 Jun 2015 21:51:39 +0000]
Merge to XFA: Cache the CPDF_Annot's subtype, since it should never changes.

BUG=495300
R=tsepez@chromium.org

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

(cherry picked from commit 7b2897c47245f04c806cfa8cee09458e31ba3777)

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

4 years agoMerge to XFA: Remove typdefs for pointer types in fx_system.h.
Tom Sepez [Wed, 10 Jun 2015 21:33:37 +0000]
Merge to XFA: Remove typdefs for pointer types in fx_system.h.

Original Review URL: https://codereview.chromium.org/1171733003

R=thestig@chromium.org

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

4 years agoMerge to XFA: Use stdint.h types throughout PDFium.
Tom Sepez [Tue, 9 Jun 2015 20:24:12 +0000]
Merge to XFA: Use stdint.h types throughout PDFium.

Near-automatic merge, plus re-running scripts to update
additional usage.

R=thestig@chromium.org

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

4 years agoMerge to XFA: Remove more cruft from fx_system.h
Tom Sepez [Tue, 9 Jun 2015 18:29:12 +0000]
Merge to XFA: Remove more cruft from fx_system.h

New manual edits in the following to fix compilation:
  fx_bmp.h, fx_gif.h, fx_graphics.h

Original Review URL: https://codereview.chromium.org/1169963003

R=thestig@chromium.org

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

4 years agoMerge to XFA: Fix potentially massive memory leak in CPDF_DIBSource::LoadJpxBitmap().
Lei Zhang [Mon, 8 Jun 2015 20:59:58 +0000]
Merge to XFA: Fix potentially massive memory leak in CPDF_DIBSource::LoadJpxBitmap().

Leaks can happen in several places. For this particular bug, it happens
when there is a colorspace component count mismatch.

BUG=497191
R=tsepez@chromium.org

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

(cherry picked from commit 2a824f1c0ed786aed0dd15a0ea60dc90999e2b2c)

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

4 years agoMerge to XFA: Cleanup: Make CPDF_Annot::m_pAnnotDict private.
Lei Zhang [Fri, 5 Jun 2015 22:50:32 +0000]
Merge to XFA: Cleanup: Make CPDF_Annot::m_pAnnotDict private.

Remove dead code in CPDF_Annot as well.

R=tsepez@chromium.org
TBR=tsepez@chromium.org

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

(cherry picked from commit b7eb193dcec1594952cbc1dca356a40f66724159)

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

4 years agoMerge to XFA: Add move constructor for FX string types.
Tom Sepez [Fri, 5 Jun 2015 22:33:03 +0000]
Merge to XFA: Add move constructor for FX string types.

Original Review URL: https://codereview.chromium.org/1162203007

R=thestig@chromium.org
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Standalone checkout gets buildtools.
Tom Sepez [Fri, 5 Jun 2015 20:46:08 +0000]
Merge to XFA: Standalone checkout gets buildtools.

Original Review URL: https://codereview.chromium.org/1149623011
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Fix bad include path in fpdfview.cpp
Tom Sepez [Fri, 5 Jun 2015 20:32:52 +0000]
Merge to XFA: Fix bad include path in fpdfview.cpp

Also sort includes missing from previous patch (some xfa IWYU
prevents full sorting).

Original Review URL: https://codereview.chromium.org/1149213008
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Move fx_safe_types.h to include/ directory.
Tom Sepez [Fri, 5 Jun 2015 02:05:21 +0000]
Merge to XFA: Move fx_safe_types.h to include/ directory.

Original Review URL: https://codereview.chromium.org/1147353006
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Kill unused IPDF_ classes.
Tom Sepez [Wed, 3 Jun 2015 23:19:04 +0000]
Merge to XFA: Kill unused IPDF_ classes.

Original Review URL: https://codereview.chromium.org/1168503003
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Fix fx_basic_memmgr_unittest.cpp under stricter GN rules
Tom Sepez [Wed, 3 Jun 2015 19:23:31 +0000]
Merge to XFA: Fix fx_basic_memmgr_unittest.cpp under stricter GN rules

Original Review URL: https://codereview.chromium.org/1165863003
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Automated test case for 487928.
Tom Sepez [Wed, 3 Jun 2015 00:11:18 +0000]
Merge to XFA: Automated test case for 487928.
Original Review URL: https://codereview.chromium.org/1153213004

R=thestig@chromium.org
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: kill IPDF_DocParser().
Tom Sepez [Tue, 2 Jun 2015 21:29:00 +0000]
Merge to XFA: kill IPDF_DocParser().

Original Review URL: https://codereview.chromium.org/1158053003
TBR=thestig@chromium.org

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

4 years agoReplace XFA_HWIDGET with IXFA_Widget*
Tom Sepez [Tue, 2 Jun 2015 17:35:27 +0000]
Replace XFA_HWIDGET with IXFA_Widget*

A second case of casting willy-nilly between unrelated structures
to provide information hiding.  Bad Idea.  Remove dozens of casts
in the process.

R=thestig@chromium.org

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

4 years agoGet test running scripts to detect and report common error, XFA.
Bruce Dawson [Mon, 1 Jun 2015 21:53:02 +0000]
Get test running scripts to detect and report common error, XFA.

testing/tools/run_corpus_tests.py assumes a debug build and will
fail cryptically if only a release build is available.

Arguably there shouldn't be a default because having one could lead
to accidentally running a stale version, but that is probably too
much of a change.

TBR=tsepez@chromium.org

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

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

4 years agoAdd missing comma to third_party.gyp, integrated to XFA
Bruce Dawson [Mon, 1 Jun 2015 21:48:49 +0000]
Add missing comma to third_party.gyp, integrated to XFA

Original change by bungeman@chromium.org

A reference to nonstd_unique_ptr.h was added with
https://codereview.chromium.org/1091283002 but a comma is missing
after it. This causes this string to be concatenated with the next,
leading to broken sources. This went unnoticed by the build due to
the fact that the affected sources are both headers, but they should
be properly separated.

TBR=tsepez@chromium.org

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

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

4 years agoMerge to XFA: Fix ALL the include guards.
Tom Sepez [Thu, 28 May 2015 20:23:12 +0000]
Merge to XFA: Fix ALL the include guards.

Original Review URL: https://codereview.chromium.org/1160443004
TBR=thestig@chromium.org

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

4 years agoReplace XFA_HDOC with IXFA_Doc*
Tom Sepez [Wed, 27 May 2015 23:36:35 +0000]
Replace XFA_HDOC with IXFA_Doc*

There are better ways to provide information hiding than casting
willy-nilly from an unrelated structure.  Kill dozens of casts in
the process.

R=thestig@chromium.org

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

4 years agoMerge to XFA: Remove rendundant ../include from paths.
Tom Sepez [Wed, 27 May 2015 23:24:18 +0000]
Merge to XFA: Remove rendundant ../include from paths.

Original Review URL: https://codereview.chromium.org/1162453003
TBR=thestig@chromium.org

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

4 years agoMake CPDFXFA_App / IXFA_AppProvider saner
Tom Sepez [Wed, 27 May 2015 19:25:00 +0000]
Make CPDFXFA_App / IXFA_AppProvider saner

Move interface comments from the implementation header to the
interface header.

Replace Create / Release functions with static methods.

Replace dubious Release() methods with deletion via virtual dtor, also
for IXFA_App and IXFA_FontMgr while we're at it.

Untabify and fix (theoretically) illegal _CAP include guard definitions
for fpdfxfa/ headers.

R=thestig@chromium.org

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

4 years agoMerge to XFA: Upgrade openjpeg to r3002
JUN FANG [Tue, 26 May 2015 19:14:39 +0000]
Merge to XFA: Upgrade openjpeg to r3002

BUG=459215
R=tsepez@chromium.org

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

4 years agoMerge to XFA: Update copy of safe_math_impl.h to take a fix from upstream.
Tom Sepez [Thu, 21 May 2015 22:17:40 +0000]
Merge to XFA: Update copy of safe_math_impl.h to take a fix from upstream.

Original Review URL: https://codereview.chromium.org/1126243007
BUG=488302
TBR=eroman@chromium.org

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

4 years agoMerge to XFA: Fix four annoying warnings.
Tom Sepez [Thu, 21 May 2015 22:06:16 +0000]
Merge to XFA: Fix four annoying warnings.

Original Review URL: https://codereview.chromium.org/1148353002

R=thestig@chromium.org
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Fix an endless loop in CJBig2_HuffmanTable::parseFromCodedBuffer
JUN FANG [Thu, 21 May 2015 16:56:11 +0000]
Merge to XFA: Fix an endless loop in CJBig2_HuffmanTable::parseFromCodedBuffer

This issue is trigged by the conversion from unsigned int to signed int.
A large unsigned int is converted to int. It's represented as a negative
int which is used in the condition of while later.

BUG=482639
R=brucedawson@chromium.org

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

4 years agoMerge to XFA: Integer overflow in CJBig2_Image::expand
JUN FANG [Wed, 20 May 2015 19:25:56 +0000]
Merge to XFA: Integer overflow in CJBig2_Image::expand

1. New size should be larger than old size in JBig2_Realloc.
2. Arguments are integers but parameters are size_t in JBIG2_memset.
   After integer overflows, it will be presented as a huge
   unsigned number on 64 bits system.

BUG=483981
R=brucedawson@chromium.org, tsepez@chromium.org

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

4 years agoMerge to XFA: Tidy public fpdfview.h and fpdf_flatten.h.
Tom Sepez [Wed, 20 May 2015 17:20:35 +0000]
Merge to XFA: Tidy public fpdfview.h and fpdf_flatten.h.

Original Review URL: https://codereview.chromium.org/1139993003
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Remove FX_Alloc() null checks now that it can't return NULL.
Tom Sepez [Wed, 20 May 2015 16:50:37 +0000]
Merge to XFA: Remove FX_Alloc() null checks now that it can't return NULL.

Original Review URL: https://codereview.chromium.org/1142713005

R=thestig@chromium.org
TBR=thestig@chromium.org

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

4 years agoFix compilation on xfa branch and turn on v8 deprecation warnings
Jochen Eisinger [Wed, 20 May 2015 08:49:45 +0000]
Fix compilation on xfa branch and turn on v8 deprecation warnings

R=vogelheim@chromium.org
BUG=

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

4 years agoMerge to XFA: Fix Heap Overflow in CJBig2_Image::expand
JUN FANG [Tue, 19 May 2015 21:44:13 +0000]
Merge to XFA: Fix Heap Overflow in CJBig2_Image::expand

Integer overflow in CJBig2_Image::expand.
It causes the size of reallocated is not
expected.

BUG=483981
R=tsepez@chromium.org

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

4 years agoMerge to XFA: Cleanup if early return from opj_j2k_copy_default_tcp_and_create_tcd().
Tom Sepez [Mon, 18 May 2015 22:53:57 +0000]
Merge to XFA: Cleanup if early return from opj_j2k_copy_default_tcp_and_create_tcd().

Original Review URL: https://codereview.chromium.org/1138033007
BUG=486538
TBR=jun_fang@foxitsoftware.com

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

4 years agoMerge V8 API updates to xfa branch
Jochen Eisinger [Mon, 18 May 2015 22:38:00 +0000]
Merge V8 API updates to xfa branch

Set pointers in internal fields directly instead of wrapping them
Review URL: https://codereview.chromium.org/1139853003

Use phantom handles instead of weak handles
Review URL: https://codereview.chromium.org/1129253004

Replace deprecated with non-deprecated V8 APIs
Review URL: https://codereview.chromium.org/1126203010

Add myself to OWNERS file
Review URL: https://codereview.chromium.org/1133333005

Replace v8::Handle with v8::Local and v8::Persistent with v8::Global
Review URL: https://codereview.chromium.org/1138823004

TBR=tsepez@chromium.org
BUG=

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

4 years agoMerge to XFA: Change FX_Alloc to FX_Try_Alloc in _JpegEncode
JUN FANG [Mon, 18 May 2015 21:36:00 +0000]
Merge to XFA: Change FX_Alloc to FX_Try_Alloc in _JpegEncode

This CL is used for:
1. keeping the same logic as before (the behaviour
   of FX_Alloc was changed for OOM).
2. fixing a potential integer overflow.

BUG=N/A
R=tsepez@chromium.org

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

4 years agoMerge to XFA: Add safe FX_Alloc2D() macro
Tom Sepez [Mon, 18 May 2015 21:29:22 +0000]
Merge to XFA: Add safe FX_Alloc2D() macro

Original Review URL: https://codereview.chromium.org/1143663004

TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Abort on OOM by default in FX_Alloc().
Tom Sepez [Fri, 15 May 2015 23:30:52 +0000]
Merge to XFA: Abort on OOM by default in FX_Alloc().

Original Review URL: https://codereview.chromium.org/1128043009
Original Review URL: https://codereview.chromium.org/1142463005

R=thestig@chromium.org
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Fix leaks in embedder test's FlateEncode() usage and in FlateEncode().
Lei Zhang [Fri, 15 May 2015 23:10:35 +0000]
Merge to XFA: Fix leaks in embedder test's FlateEncode() usage and in FlateEncode().

For FlateEncode(), error handling code leaked memory.

R=tsepez@chromium.org

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

(cherry picked from commit 1962d61b28df03284e3e5c6de6a19f397a066e68)

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

4 years agoMerge to XFA: Initialize members of CPDF_TextPageFind class.
Lei Zhang [Fri, 15 May 2015 22:38:01 +0000]
Merge to XFA: Initialize members of CPDF_TextPageFind class.

R=tsepez@chromium.org

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

(cherry picked from commit acae9257203971ee1e34d8d7573b7ba9a50041af)

BUG=

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

4 years agoMerge to XFA: Fix leaks in the embedder tests themselves.
Lei Zhang [Fri, 15 May 2015 22:36:02 +0000]
Merge to XFA: Fix leaks in the embedder tests themselves.

Also change EmbedderTest::TearDown() to match the destruction order in
Chromium's PDF code.

R=tsepez@chromium.org

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

(cherry picked from commit 61ffad8df484ab9b3f7d2f5519ec470fbc023b88)

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

4 years agoMerge to XFA: Remove FX_NEW_VECTOR() macros.
Tom Sepez [Fri, 15 May 2015 21:01:28 +0000]
Merge to XFA: Remove FX_NEW_VECTOR() macros.

Original Review URL: https://codereview.chromium.org/1135273004

R=thestig@chromium.org
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Fix potential UAF in ConcatInPlace.
Tom Sepez [Fri, 15 May 2015 16:09:22 +0000]
Merge to XFA: Fix potential UAF in ConcatInPlace.

Original Review URL: https://codereview.chromium.org/1130763007
TBR=thestig@chromium.org

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