pdfium.git
4 years agoXFA merge: Fix pdfium standalone to compile with VS 2015.
Bruce Dawson [Thu, 16 Apr 2015 20:49:57 +0000]
XFA merge: Fix pdfium standalone to compile with VS 2015.

This change disables several warnings that fire frequently
in pdfium and are not practical to fix at this time.

Originally on https://codereview.chromium.org/1096463005

TBR=tsepez@chromium.org
BUG=440500

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

4 years agoMerge to XFA: Fix offset outside bounds of constant string warnings
JUN FANG [Wed, 15 Apr 2015 19:00:53 +0000]
Merge to XFA: Fix offset outside bounds of constant string warnings

BUG=380476
R=tsepez@chromium.org

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

4 years agoMerge to XFA: Make FX_NEW throw on OOM.
Tom Sepez [Wed, 15 Apr 2015 17:30:05 +0000]
Merge to XFA: Make FX_NEW throw on OOM.

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

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

4 years agoFix two new / free mismatches
Tom Sepez [Tue, 14 Apr 2015 22:55:35 +0000]
Fix two new / free mismatches

R=brucedawson@chromium.org

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

4 years agoFix XFA compile under clang
Tom Sepez [Tue, 14 Apr 2015 21:31:25 +0000]
Fix XFA compile under clang

TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Kill CFX_Object.
Tom Sepez [Tue, 14 Apr 2015 20:50:34 +0000]
Merge to XFA: Kill CFX_Object.

Not just a simple merge, but changes to remove CFX_Object from XFA.

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

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

4 years agoMerge to XFA: Fix a heap overflow in CJBig2_Context::parseSymbolDict
JUN FANG [Mon, 13 Apr 2015 17:34:10 +0000]
Merge to XFA: Fix a heap overflow in CJBig2_Context::parseSymbolDict

BUG=476107
R=tsepez@chromium.org

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

4 years agoMerge to XFA: Fix compiling warnings on Windows
Jun Fang [Sat, 11 Apr 2015 18:34:43 +0000]
Merge to XFA: Fix compiling warnings on Windows

TBR=tsepez@chromium.org

BUG=N/A

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

4 years agoMerge to XFA: Fix a heap buffer overflow issue in CPDF_CMap::GetNextChar
JUN FANG [Sat, 11 Apr 2015 16:33:23 +0000]
Merge to XFA: Fix a heap buffer overflow issue in CPDF_CMap::GetNextChar

Add a check to make sure offset is less than the size of string in the function of GetNextChar().

BUG=471651
R=tsepez@chromium.org

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

4 years agoXFA port: Fix the noisiest variable shadowing warnings in pdfium.
Bruce Dawson [Fri, 10 Apr 2015 22:18:07 +0000]
XFA port: Fix the noisiest variable shadowing warnings in pdfium.

Three functions in fx_coordinates.h account for 60% of the warnings
when building with VS 2015, due to variable shadowing. Renaming the
function parameters is safe, resolves the warnings, and reduces
confusion.

From https://codereview.chromium.org/1077083003

TBR=tsepez@chromium.org
BUG=440500

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

4 years agoMerge to XFA: Better fix for snprintf non-termination on windows.
Tom Sepez [Fri, 10 Apr 2015 21:54:13 +0000]
Merge to XFA: Better fix for snprintf non-termination on windows.

TBR=brucedawson@chromium.org

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

4 years agoMerge to XFA: Fix a stack overflow in CPDF_Parser::LoadCrossRefV5
JUN FANG [Fri, 10 Apr 2015 20:45:43 +0000]
Merge to XFA: Fix a stack overflow in CPDF_Parser::LoadCrossRefV5

A stack overflow was triggered by checked_cast due to
invalid index in pdf files like 'Index[45 -1661]'.

BUG=473400
R=tsepez@chromium.org

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

4 years agoMerge to XFA: Don't call FPDF_InitLibrary() in individual unit_tests.
Tom Sepez [Fri, 10 Apr 2015 17:40:55 +0000]
Merge to XFA: Don't call FPDF_InitLibrary() in individual unit_tests.

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

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

4 years agoMerge to XFA: Update DEPS to pull V8 from the new repository.
Tom Sepez [Thu, 9 Apr 2015 21:16:15 +0000]
Merge to XFA: Update DEPS to pull V8 from the new repository.

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

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

4 years agoXFA port: Include windows.h instead of the MFC header afxres.h
Bruce Dawson [Thu, 9 Apr 2015 20:52:02 +0000]
XFA port: Include windows.h instead of the MFC header afxres.h

VS 2015 RC ships without afxres.h, so fpdfsdkdll.rc fails to
compile. afxres.h is really intended for MFC apps so depending on
it is a bad idea anyway, so I changed both references to
windows.h. See http://stackoverflow.com/questions/1575559 for
some other perspective on this.

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

TBR=tsepez@chromium.org
BUG=440500

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

4 years agoMerge to XFA: testing utility combo patch
Tom Sepez [Thu, 9 Apr 2015 20:37:02 +0000]
Merge to XFA: testing utility combo patch

This pulls in the following CLs from master:
Review URL: https://codereview.chromium.org/1072613003
Review URL: https://codereview.chromium.org/1058463004
Review URL: https://codereview.chromium.org/1057983003
Review URL: https://codereview.chromium.org/1036073002
Review URL: https://codereview.chromium.org/1031203003
Review URL: https://codereview.chromium.org/1029193002
Review URL: https://codereview.chromium.org/1016613004
Review URL: https://codereview.chromium.org/1026903002

TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Fix ref to timezone variable - removed in VS 2015
Bruce Dawson [Thu, 9 Apr 2015 18:10:17 +0000]
Merge to XFA: Fix ref to timezone variable - removed in VS 2015

It turns out that 'timezone' has been deprecated for a while. If
deprecation messages are enabled then VS 2013 says this when 'timezone'
is referenced:

warning C4996: 'timezone': This function or variable may be unsafe.
Consider using _get_timezone instead.

Sometimes features stay deprecated for decades, but in this case
'timezone' is now gone.

Merged from change https://codereview.chromium.org/1075673002

TBR=tsepez@chromium.org
BUG=440500

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

4 years agoMerge to XFA: Fix a global buffer overflow in GCPDF_CIDFont::_CharCodeFromUnicode
Jun Fang [Thu, 9 Apr 2015 16:59:41 +0000]
Merge to XFA: Fix a global buffer overflow in GCPDF_CIDFont::_CharCodeFromUnicode

There is not a code page (CP) used for converting unicode to mutli-bytes
if the coding scheme is CID coding. Only return 0 if CID can't be retrieved.
The difference on Windows and other platforms should be the function used
for converting rather than others.

BUG=466790
R=tsepez@chromium.org

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

4 years agoMerge to XFA: Fix IWYU in formfiller/ directory.
Tom Sepez [Wed, 8 Apr 2015 23:19:33 +0000]
Merge to XFA: Fix IWYU in formfiller/ directory.

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

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

4 years agoMerge to XFA: Use pdfium-specific tree closer for gating landings
Tom Sepez [Wed, 8 Apr 2015 16:04:38 +0000]
Merge to XFA: Use pdfium-specific tree closer for gating landings

Original Review URL: https://codereview.chromium.org/1066413004
TBR=jam@chromium.org

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

4 years agoFFL_MIN and FFL_MAX are pointless and stupid.
Tom Sepez [Wed, 8 Apr 2015 15:29:46 +0000]
FFL_MIN and FFL_MAX are pointless and stupid.

Kill some nearby dead code while I'm at it.

R=thestig@chromium.org

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

4 years agoMerge to XFA: Fix a stack overflow issue caused by an invalid usage of snprintf
Jun Fang [Tue, 7 Apr 2015 23:59:05 +0000]
Merge to XFA: Fix a stack overflow issue caused by an invalid usage of snprintf

BUG=469244
R=tsepez@chromium.org

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

4 years agoMerge to XFA: Fix IWYU in pdfwindow/ directory.
Tom Sepez [Tue, 7 Apr 2015 23:12:46 +0000]
Merge to XFA: Fix IWYU in pdfwindow/ directory.

This incorporates class vs. struct fix in 34f5fc0f2a18
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Fix (nearly all) IWYU in fpdfskd/include/javascript/ headers.
Tom Sepez [Tue, 7 Apr 2015 22:35:48 +0000]
Merge to XFA: Fix (nearly all) IWYU in fpdfskd/include/javascript/ headers.

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

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

4 years agoMerge to XFA: Fix IWYU in fxcrt headers.
Tom Sepez [Mon, 6 Apr 2015 20:49:25 +0000]
Merge to XFA: Fix IWYU in fxcrt headers.

Note: new includes for XFA
Original Review URL: https://codereview.chromium.org/1064433005

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

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

4 years agoMerge to XFA: fix missing semicolons
JUN FANG [Mon, 6 Apr 2015 20:10:59 +0000]
Merge to XFA: fix missing semicolons

TBR=tsepez@chromium.org

BUG=N/A

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

4 years agoMerge to XFA: Fix a fatal error due to cloning a global document object
JUN FANG [Mon, 6 Apr 2015 19:39:51 +0000]
Merge to XFA: Fix a fatal error due to cloning a global document object

BUG=454595
R=tsepez@chromium.org

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

4 years agoMerge to XFA: Update the path of header file to avoid a compiling error in chrome
JUN FANG [Fri, 3 Apr 2015 21:39:18 +0000]
Merge to XFA: Update the path of header file to avoid a compiling error in chrome

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

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

4 years agoMerge to XFA: No-op change to poke the bots after being out of sequence.
Tom Sepez [Fri, 3 Apr 2015 19:59:41 +0000]
Merge to XFA: No-op change to poke the bots after being out of sequence.

Adds a comment and changes some whitespace.
TBR=jun_fang@foxitsoftware.com

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

4 years agoMerge to XFA: Fix a compiling error in fpdf_parser_parser_embeddertest.cpp
Jun Fang [Fri, 3 Apr 2015 11:31:02 +0000]
Merge to XFA: Fix a compiling error in fpdf_parser_parser_embeddertest.cpp

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

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

4 years agoMerge to XFA: Add embedder test comparing with the last patch.
JUN FANG [Fri, 3 Apr 2015 18:35:50 +0000]
Merge to XFA: Add embedder test comparing with the last patch.

When there is a wrong keyword like '??ze' in the dictionary
of the trailer, PDFium can't recognize it and aborts further
parsing. After this change, PDFium continues even it can't
get the right size at this moment. It will rebuild the cross
reference table later since the size of the table is missing.

BUG=459580
R=tsepez@chromium.org

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

4 years agoMerge to XFA: Fix uninitialized face in fx_ge_font.cpp
JUN FANG [Thu, 2 Apr 2015 17:05:06 +0000]
Merge to XFA: Fix uninitialized face in fx_ge_font.cpp

MSAN reported this issue when I tried to reproduce 460936 in the last version of freetype on Linux.

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

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

4 years agoMerge to XFA: doc.external - Check direction of property access before blindly getting.
Tom Sepez [Wed, 1 Apr 2015 17:12:47 +0000]
Merge to XFA: doc.external - Check direction of property access before blindly getting.

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

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

4 years agoMerge to XFA: Fix no text displayed issue when font embedded and font subsetting...
JUN FANG [Mon, 30 Mar 2015 23:24:09 +0000]
Merge to XFA: Fix no text displayed issue when font embedded and font subsetting enabled

BUG=465322
R=thestig@chromium.org

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

4 years agoMerge to XFA: Fix missing include for std::min
Tom Sepez [Fri, 20 Mar 2015 17:55:35 +0000]
Merge to XFA: Fix missing include for std::min

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

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

4 years agoMerge to XFA: Fix subtle issues in opj_skip_from_memory and add unit tests.
Tom Sepez [Thu, 19 Mar 2015 20:02:23 +0000]
Merge to XFA: Fix subtle issues in opj_skip_from_memory and add unit tests.

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

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

4 years agoMerge to XFA: Return OS status code from python test driver scripts.
Tom Sepez [Tue, 17 Mar 2015 20:30:11 +0000]
Merge to XFA: Return OS status code from python test driver scripts.

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

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

4 years agoMerge to XFA: Pull our new test case repository via deps.
Tom Sepez [Mon, 16 Mar 2015 22:27:19 +0000]
Merge to XFA: Pull our new test case repository via deps.

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

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

4 years agoMerge to XFA: Speculative fix for breakage in pdfum DEPS roll
Tom Sepez [Mon, 16 Mar 2015 21:58:06 +0000]
Merge to XFA: Speculative fix for breakage in pdfum DEPS roll

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

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

4 years agoMerge to XFA: Fix a bug that JPX images can't be shown
JUN FANG [Mon, 16 Mar 2015 18:22:52 +0000]
Merge to XFA: Fix a bug that JPX images can't be shown

In the process of opj_end_decompress, it will return fail when the end of coding stream is reached. However it returns true in the same scenario implemented in openJPEG. So the final solution is from openJPEG. Return true when the end of coding stream is reached.

BUG=452671
R=tsepez@chromium.org

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

4 years agoMerge to XFA: Fix potential integer overflow in fpdf_render_image.cpp
JUN FANG [Mon, 16 Mar 2015 17:56:16 +0000]
Merge to XFA: Fix potential integer overflow in fpdf_render_image.cpp

BUG=382661
R=tsepez@chromium.org

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

4 years agoXFA: bound memcpy length in _png_load_bmp_attribute()
Tom Sepez [Wed, 11 Mar 2015 21:41:17 +0000]
XFA: bound memcpy length in _png_load_bmp_attribute()

BUG=466338
R=thestig@chromium.org

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

4 years agoMerge to XFA: Kill remaining sprintfs
Tom Sepez [Wed, 11 Mar 2015 21:25:05 +0000]
Merge to XFA: Kill remaining sprintfs

There is fx_codec_png.cpp that has a sprintf under XFA
that was not present in master.

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

R=thestig@chromium.org

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

4 years agoRemove the calling 'FPDF_HasXFAField' in LoadXFADoc
JUN FANG [Mon, 9 Mar 2015 21:57:38 +0000]
Remove the calling 'FPDF_HasXFAField' in LoadXFADoc

BUG=NA
R=tsepez@chromium.org

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

4 years agoMerge to XFA: Make conversions for CPDF_Link explicit.
Tom Sepez [Fri, 6 Mar 2015 20:37:13 +0000]
Merge to XFA: Make conversions for CPDF_Link explicit.

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

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

4 years agoMerge to XFA: Make conversion between CPDF_Dest and its object explicit.
Tom Sepez [Fri, 6 Mar 2015 18:52:05 +0000]
Merge to XFA: Make conversion between CPDF_Dest and its object explicit.

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

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

4 years agoMerge to XFA: Add gmock to .gitignore
Tom Sepez [Fri, 6 Mar 2015 17:43:29 +0000]
Merge to XFA: Add gmock to .gitignore

Original Review URL: https://codereview.chromium.org/985833002
TBR=halyavin@chromium.org

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

4 years agoMerge to XFA: Make conversion between CPDF_Action and its dictionary explicit.
Tom Sepez [Fri, 6 Mar 2015 00:44:22 +0000]
Merge to XFA: Make conversion between CPDF_Action and its dictionary explicit.

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

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

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

4 years agoCheck whether a pdf has XFA fields before loading XFA fields
JUN FANG [Thu, 5 Mar 2015 21:39:21 +0000]
Check whether a pdf has XFA fields before loading XFA fields

BUG=452793
R=tsepez@chromium.org

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

4 years agoFix pdfium_embeddertests on XFA.
Tom Sepez [Tue, 3 Mar 2015 17:49:29 +0000]
Fix pdfium_embeddertests on XFA.

Required to avoid a DCHECK() due to recent changes
in V8 initialization.  This mirrors the changes introduced
at b045ed21 to pdfium_test.cpp in pdfium_embeddertest.cpp

R=jam@chromium.org

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

4 years agoFix a compiling error in fxjs_v8.h
JUN FANG [Tue, 3 Mar 2015 01:08:22 +0000]
Fix a compiling error in fxjs_v8.h

BUG=NA
R=thestig@chromium.org, tsepez@chromium.org

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

4 years agoMerge to XFA: Kill off JS_ErrorString type.
Tom Sepez [Mon, 2 Mar 2015 23:35:26 +0000]
Merge to XFA: Kill off JS_ErrorString type.

Orignal Review URL: https://codereview.chromium.org/971033002
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Return error information from pdfium to JS.
Tom Sepez [Mon, 2 Mar 2015 20:59:05 +0000]
Merge to XFA: Return error information from pdfium to JS.

Cherry-pick from b720d0a14601f1496ef15297bc46d401f5a2a890 +
Manually resolve merge conflicts +
Fix more IWYU to fix compile.

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

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

4 years agoMerge to XFA: Do hit tests against Annots in reverse order.
Lei Zhang [Sat, 28 Feb 2015 03:58:08 +0000]
Merge to XFA: Do hit tests against Annots in reverse order.

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

(cherry picked from commit 944ccad72d028ed5e37f53c5c8c0888866905bc3)

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

4 years agoMerge to XFA: Fix JPX image rendering that regressed due to several security fixes.
Lei Zhang [Sat, 28 Feb 2015 03:57:05 +0000]
Merge to XFA: Fix JPX image rendering that regressed due to several security fixes.

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

(cherry picked from commit 254360730190cc6d6e3de325ee101948b78c1e32)

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

4 years agoMerge to XFA: Fix some typos in fpdf_render_loadimage.cpp.
Lei Zhang [Sat, 28 Feb 2015 03:55:44 +0000]
Merge to XFA: Fix some typos in fpdf_render_loadimage.cpp.

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

(cherry picked from commit 900d7bf46efc26e0588e1777759f7716ed4f8dbd)

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

4 years agoMerge to XFA: Cleanup: Fix some unused-function warnings.
Lei Zhang [Sat, 28 Feb 2015 03:54:20 +0000]
Merge to XFA: Cleanup: Fix some unused-function warnings.

Original URL: https://codereview.chromium.org/891113002

(cherry picked from commit 44fc192f29a77c5864fabffe5ab63937dacdfd21)

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

4 years agoMerge to XFA: Cleanup parts of fpdf_render_loadimage.cpp.
Lei Zhang [Sat, 28 Feb 2015 03:52:52 +0000]
Merge to XFA: Cleanup parts of fpdf_render_loadimage.cpp.

Original URL: https://codereview.chromium.org/890883006

(cherry picked from commit 3f41851972a18762164d7110a82da3baed564b80)

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

4 years agoMerge to XFA: Check for NULL pointers in CJBig2_SymbolDict::DeepCopy().
Lei Zhang [Sat, 28 Feb 2015 03:51:26 +0000]
Merge to XFA: Check for NULL pointers in CJBig2_SymbolDict::DeepCopy().

Original URL: https://codereview.chromium.org/837093002

(cherry picked from commit f8105c665856863ad95da37fee6c12b98b953e2c)

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

4 years agoMerge to XFA: Cleanup: Get rid of CRLF line endings.
Lei Zhang [Sat, 28 Feb 2015 03:49:57 +0000]
Merge to XFA: Cleanup: Get rid of CRLF line endings.

Original URL: https://codereview.chromium.org/837533003

(cherry picked from commit 256ef88a26cff56fc7c23119d2d9e1b41468bd1a)

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

4 years agoMerge to XFA: Update externs in unicodenormalization.cpp to not have array sizes.
Lei Zhang [Sat, 28 Feb 2015 03:47:00 +0000]
Merge to XFA: Update externs in unicodenormalization.cpp to not have array sizes.

Original URL: https://codereview.chromium.org/825983004

(cherry picked from commit dd132d8d1e9a27673e5357a657db2b97dda9bcdb)

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

4 years agoMerge to XFA: Fix an array size mismatch.
Lei Zhang [Sat, 28 Feb 2015 03:43:10 +0000]
Merge to XFA: Fix an array size mismatch.

BUG=446057

Original Author: sebmarchand@chromium.org
Original CL: https://codereview.chromium.org/837523002/

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

(cherry picked from commit f96404951bc1505887e2567088b59206316c9297)

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

4 years agoMerge to XFA: Remove unused IDS_ constants from pdfium.
Tom Sepez [Fri, 27 Feb 2015 21:58:29 +0000]
Merge to XFA: Remove unused IDS_ constants from pdfium.

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

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

4 years agoMerge to XFA: Pull in gmock for standalone pdfium builds.
Tom Sepez [Fri, 27 Feb 2015 21:03:07 +0000]
Merge to XFA: Pull in gmock for standalone pdfium builds.

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

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

4 years agoMerge to XFA: Upgrade openjpeg to revision 2997.
JUN FANG [Fri, 27 Feb 2015 18:00:00 +0000]
Merge to XFA: Upgrade openjpeg to revision 2997.

BUG=457493
R=tsepez@chromium.org

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

4 years agoMerge to XFA: Implement a delegate for EmbedderTests.
Tom Sepez [Thu, 26 Feb 2015 00:08:18 +0000]
Merge to XFA: Implement a delegate for EmbedderTests.

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

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

4 years agoMerge to XFA: Kill off unused IFXJS interface methods.
Tom Sepez [Wed, 25 Feb 2015 22:54:36 +0000]
Merge to XFA: Kill off unused IFXJS interface methods.

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

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

4 years agoMerge https://codereview.chromium.org/935663003/ to XFA branch.
John Abd-El-Malek [Wed, 25 Feb 2015 19:08:16 +0000]
Merge https://codereview.chromium.org/935663003/ to XFA branch.

TBR=tsepez@chromium.org

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

4 years agoMerge to XFA: Add small flate decode unit test.
Tom Sepez [Tue, 24 Feb 2015 23:07:41 +0000]
Merge to XFA: Add small flate decode unit test.

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

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

4 years agoMerge to XFA: Kill multi-byte comments in fxet_list.h
Tom Sepez [Tue, 24 Feb 2015 22:32:52 +0000]
Merge to XFA: Kill multi-byte comments in fxet_list.h

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

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

4 years agoMerge to XFA: Convert pdfium expected test results to PNG format.
Tom Sepez [Tue, 24 Feb 2015 20:47:58 +0000]
Merge to XFA: Convert pdfium expected test results to PNG format.

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

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

4 years agoMerge to XFA: Replace second set of #defines with templates in JS_Define.h
Tom Sepez [Mon, 23 Feb 2015 18:22:51 +0000]
Merge to XFA: Replace second set of #defines with templates in JS_Define.h

Original Review URL: https://codereview.chromium.org/945623002
TBR=brucedawson@chromium.org

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

4 years agoMerge to XFA: Add test for PDF's JS "global".
Tom Sepez [Fri, 20 Feb 2015 00:04:32 +0000]
Merge to XFA: Add test for PDF's JS "global".

Original Review URL: https://codereview.chromium.org/943783002
TBR=jam@chromium.org

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

4 years agoMerge to XFA: Replace ugly JS_Define macros with templates.
Tom Sepez [Thu, 19 Feb 2015 18:00:55 +0000]
Merge to XFA: Replace ugly JS_Define macros with templates.

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

R=brucedawson@chromium.org

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

4 years agoKeep the declaration of FPDF_HasXFAField consistent with other XFA APIs
Jun Fang [Tue, 17 Feb 2015 14:50:08 +0000]
Keep the declaration of FPDF_HasXFAField consistent with other XFA APIs
It's an enhancement requested in issue 452794.

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

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

4 years agoMerge to XFA: Tidy up JS_Defines.h
Tom Sepez [Tue, 17 Feb 2015 21:30:23 +0000]
Merge to XFA: Tidy up JS_Defines.h

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

TBR=brucedawson@chromium.org

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

4 years agoFix pdfium_test build inside Chromium.
John Abd-El-Malek [Tue, 17 Feb 2015 21:26:45 +0000]
Fix pdfium_test build inside Chromium.

R=tsepez@chromium.org

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

4 years agoSet the view pointer as NULL after its xfa doc is released
Jun Fang [Tue, 17 Feb 2015 12:52:09 +0000]
Set the view pointer as NULL after its xfa doc is released

BUG=452794
R=tsepez@chromium.org

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

4 years agoMerge to XFA: Run javascript/pixel tests via automated script.
Tom Sepez [Sat, 14 Feb 2015 00:54:48 +0000]
Merge to XFA: Run javascript/pixel tests via automated script.

This pulls in:
7435e8e Run pixel tests via automated script.
83c87e5 run_javascript_tests.py: Be more flexible about directory layout.
5898509 Test top-level Document JS properties.
9f93baf Create run_javascript_tests.py

TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Fix an error 'Use-of-uninitialized-value in CPDF_Function::Call'
JUN FANG [Thu, 12 Feb 2015 12:38:03 +0000]
Merge to XFA: Fix an error 'Use-of-uninitialized-value in CPDF_Function::Call'

This issue was introduced in https://codereview.chromium.org/886953002/.

BUG=454280
R=tsepez@chromium.org

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

4 years agoMerge to XFA: CPDF_Object() constructor should set its internal m_Type variable.
Tom Sepez [Wed, 11 Feb 2015 20:56:51 +0000]
Merge to XFA: CPDF_Object() constructor should set its internal m_Type variable.

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

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

4 years agoMerge to XFA: Fix uninitialized value in CFX_ByteString::FormatInteger
JUN FANG [Tue, 10 Feb 2015 16:13:01 +0000]
Merge to XFA: Fix uninitialized value in CFX_ByteString::FormatInteger

BUG=449845
R=tsepez@chromium.org

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

4 years agoMerge to XFA: Fix heap buffer overflow in CPDF_SampledFunc::v_Call
JUN FANG [Sat, 31 Jan 2015 18:12:50 +0000]
Merge to XFA: Fix heap buffer overflow in CPDF_SampledFunc::v_Call

This issue was caused by integer overflow in CPDF_SampledFunc::v_Call.
The root cause of this issue is that the content in the test pdf file
was damaged. The solution is to check whether an integer is overflow
before using it.

BUG=452455
R=tsepez@chromium.org

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

4 years agoMerge https://codereview.chromium.org/897973002/ and https://codereview.chromium...
John Abd-El-Malek [Tue, 10 Feb 2015 17:15:12 +0000]
Merge https://codereview.chromium.org/897973002/ and https://codereview.chromium.org/902753002/ to XFA branch

R=jochen@chromium.org

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

4 years agoMerge to XFA: Add JavaScript test for constants in Consts.cpp.
Tom Sepez [Tue, 10 Feb 2015 17:10:11 +0000]
Merge to XFA: Add JavaScript test for constants in Consts.cpp.

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

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

4 years agoAdd first pixel diffing test.
Tom Sepez [Sat, 7 Feb 2015 00:06:49 +0000]
Add first pixel diffing test.

This is just a simple example of font scaling, so we have some
bits to diff against. I've added a /pixel directory to separate
these from the embeddertest resources.

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

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

4 years agoMerge to XFA: First JavaScript testing implementation.
Tom Sepez [Sat, 7 Feb 2015 00:05:23 +0000]
Merge to XFA: First JavaScript testing implementation.

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

TBR=jam@chromium.org
TBR=thestig@chromium.org

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

4 years agoFix XFA build after combining PDFium into Chromium binary.
John Abd-El-Malek [Fri, 6 Feb 2015 23:51:11 +0000]
Fix XFA build after combining PDFium into Chromium binary.

R=tsepez@chromium.org

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

4 years agoMerge to XFA: Fix GN build, fpdf_font_utility.cpp no longer present.
Tom Sepez [Fri, 6 Feb 2015 01:55:02 +0000]
Merge to XFA: Fix GN build, fpdf_font_utility.cpp no longer present.

Original Review URL: https://codereview.chromium.org/903903003
TBR=jam@chromium.org

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

4 years agoMerge to XFA: Kill off some more unreachable fopen's.
Tom Sepez [Fri, 6 Feb 2015 01:39:07 +0000]
Merge to XFA: Kill off some more unreachable fopen's.

Original Review URL: https://codereview.chromium.org/902943003
TBR=jam@chromium.org

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

4 years agoKill off some dodgy JS callbacks
Tom Sepez [Thu, 5 Feb 2015 23:27:25 +0000]
Kill off some dodgy JS callbacks

None of these are currently reachable because the IsSafeMode
method always returns true.  This, in turn, will let us kill
off some file (as in fopen()) based parsing. That, in turn,
will let us kill of some more now-unreachable code.

In general, we don't want to have unsafe modes.

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

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

4 years agoFix build of pdfium_diff
Tom Sepez [Thu, 5 Feb 2015 23:21:19 +0000]
Fix build of pdfium_diff

Commit af18cb3 didn't build standalone.
TBR=thestig@chromium.org

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

4 years agoXFA: Support PNG format in pdfium_test and add image diffing
Tom Sepez [Thu, 5 Feb 2015 23:06:01 +0000]
XFA: Support PNG format in pdfium_test and add image diffing

Lays the groundwork for pixel-diffing tests in pdfium.

This is a port of chromium's tools/image_diff/image_diff_png.cc onto the
top of the fxcodec-provided version of libpng. pdfium_test is modified
to support the new format, and the tools/image_diff.cc image comparison
utility is provided, stripped of its base/ dependencies.

Unfortunately, this can't be back-ported to origin/main, since the
underlying PNG support isn't present inside pdfium.

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

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

4 years agoMerge to XFA: Fix segv in CPDF_DataAvail::CheckRoot()
Tom Sepez [Thu, 5 Feb 2015 18:51:54 +0000]
Merge to XFA: Fix segv in CPDF_DataAvail::CheckRoot()

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

BUG=454695
TBR=thestig@chromium.org

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

4 years agoMerge to XFA: Add namespace and-re-arrange PDFium's local copy of /base.
Tom Sepez [Thu, 5 Feb 2015 18:03:18 +0000]
Merge to XFA: Add namespace and-re-arrange PDFium's local copy of /base.

Original revieww URL: https://codereview.chromium.org/900753002
TBR=jam@chromium.org

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

4 years agoMerge to XFA: Prevent base::CheckedNumeric from leaking outside of pdfium.
Tom Sepez [Wed, 4 Feb 2015 18:48:28 +0000]
Merge to XFA: Prevent base::CheckedNumeric from leaking outside of pdfium.

Original review URL: https://codereview.chromium.org/896023003
TBR=jam@chromium.org

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

4 years agoMerge to XFA: Replace CFX_SmartPointer cast operator with Get() method.
Tom Sepez [Wed, 4 Feb 2015 00:32:45 +0000]
Merge to XFA: Replace CFX_SmartPointer cast operator with Get() method.

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

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

4 years agoMerge to XFA: Fix stack exhaustion in CPDF_DataAvail::HaveResourceAncestor()
Tom Sepez [Wed, 4 Feb 2015 00:24:43 +0000]
Merge to XFA: Fix stack exhaustion in CPDF_DataAvail::HaveResourceAncestor()

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

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

4 years agoMerge the following commit to XFA:
John Abd-El-Malek [Tue, 3 Feb 2015 17:14:41 +0000]
Merge the following commit to XFA:

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

4 years agoMerge the following changes to XFA branch:
John Abd-El-Malek [Tue, 3 Feb 2015 00:52:07 +0000]
Merge the following changes to XFA branch:

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