pdfium.git
3 years agoImplement FPDFAction_GetFilePath().
Lei Zhang [Tue, 15 Sep 2015 21:45:29 +0000]
Implement FPDFAction_GetFilePath().

The API is the same as the Foxit version, except the encoding is
specified as UTF-8 instead of local encoding.

Also remove CPDF_LWinParam since it's unused.

BUG=chromium:517713
R=jun_fang@foxitsoftware.com

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

3 years agoFix build broken at 09ed30750282
Tom Sepez [Tue, 15 Sep 2015 21:14:25 +0000]
Fix build broken at 09ed30750282

Wrong parameter set to nullptr during one of the CL revisions.

TBR=thestig@chromium.org

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

3 years agoRefactor fxjs_v8 and add embeddertests for it.
Tom Sepez [Tue, 15 Sep 2015 21:03:52 +0000]
Refactor fxjs_v8 and add embeddertests for it.

This forces the layer defined by fxjs_v8.h to be (more)
self-contained, so that it can be tested apart from the
CJS_* objects (in fpdfsdk/{src,include}/javascript. This
implies the array buffer allocator must be part of fxjs_v8.

One wrinkle is that we'd like to be able to test an isolate
upon which no native objects have been added, so some
initialization that would have occurred as part of object
definition must be made explicit.

R=thestig@chromium.org

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

3 years agoFix build broken at ac8fda05418b on windows
Tom Sepez [Tue, 15 Sep 2015 17:28:01 +0000]
Fix build broken at ac8fda05418b on windows

|constexpr| not supported on windows.

TBR=thestig@chromium.org

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

3 years agoAdd move ctor to nonstd::unique_ptr.
Tom Sepez [Tue, 15 Sep 2015 17:18:52 +0000]
Add move ctor to nonstd::unique_ptr.

R=jyasskin@chromium.org

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

3 years agoCleanup JBig2_GeneralDecoder.cpp.
Lei Zhang [Tue, 15 Sep 2015 08:12:55 +0000]
Cleanup JBig2_GeneralDecoder.cpp.

- FX_Alloc() can't fail and return.
- Use unique_ptr / remove gotos.
- NULL -> nullptr.
- Combine common code.

R=tsepez@chromium.org

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

3 years agoCleanup: Fix a typo. s/Processive/Processing/
Lei Zhang [Tue, 15 Sep 2015 08:11:58 +0000]
Cleanup: Fix a typo. s/Processive/Processing/

R=tsepez@chromium.org

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

3 years agoAdd a missing #include that's needed for call to FXSYS_tolower.
David Lattimore [Mon, 14 Sep 2015 21:40:12 +0000]
Add a missing #include that's needed for call to FXSYS_tolower.

BUG=
R=thestig@chromium.org

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

3 years agoGet CJS_RuntimeFactory out of the CJS_GlobalData management business.
Tom Sepez [Mon, 14 Sep 2015 21:32:33 +0000]
Get CJS_RuntimeFactory out of the CJS_GlobalData management business.

First part of getting rid of CJS_RuntimeFactory.  The factory design
pattern isn't appropriate here since we only ever make one kind of
object.

CJS_GlobalData is now perfectly capable of managing itself through
internal ref counts. I'm philosophically opposed to keeping ref-counts
outside the object (do you hear me std::shared_ptr, you're bad!)

R=thestig@chromium.org

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

3 years agoConvert some unneeded gotos into returns.
Lei Zhang [Fri, 11 Sep 2015 20:15:02 +0000]
Convert some unneeded gotos into returns.

R=tsepez@chromium.org

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

3 years agoCleanup casting of FX_Alloc() return values.
Lei Zhang [Fri, 11 Sep 2015 20:13:31 +0000]
Cleanup casting of FX_Alloc() return values.

Also convert some FX_AllocOrDie() calls to FX_Alloc().

R=tsepez@chromium.org

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

3 years agoFix strings, remove stringify macros, void return types for Consts.h.
Tom Sepez [Fri, 11 Sep 2015 20:04:48 +0000]
Fix strings, remove stringify macros, void return types for Consts.h.

Replace multiple #defines of the same strings with externs.
Fix strings mangled by interaction of # and clang-format.
Remove macros as possible.
Make more JS_ functions void and simplify.

R=thestig@chromium.org

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

3 years agoRename Init methods to more accurately describe purpose
Tom Sepez [Fri, 11 Sep 2015 15:18:47 +0000]
Rename Init methods to more accurately describe purpose

R=thestig@chromium.org

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

3 years agoGuard against null image data in CJBig2_GRRDProc.
Lei Zhang [Thu, 10 Sep 2015 23:13:31 +0000]
Guard against null image data in CJBig2_GRRDProc.

Credit to karl at skomski.com for the initial version of the CL.

BUG=527174
R=tsepez@chromium.org

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

3 years agoRemove CJBig2_Object, CJBig2_Module, and friends.
Lei Zhang [Thu, 10 Sep 2015 23:12:44 +0000]
Remove CJBig2_Object, CJBig2_Module, and friends.

R=tsepez@chromium.org

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

3 years agoRemove some abstractions in fxjs_v8.h.
Tom Sepez [Thu, 10 Sep 2015 18:56:37 +0000]
Remove some abstractions in fxjs_v8.h.

It's too hard to keep mapping between v8 and fx abstractions; the lack
of transparency prevents those skilled in v8 only from working on this
code.

Apparently, the original intention was to confine v8 types to
fpdfsdk/{include,src}/jsapi, but fpdfsdk/{include,src}/javascript
is already well-polluted with v8 types.

Also remove no-op JS_SetThisObj().

Also remove unused ParserParams() [noticed because it was incorrectly
passing handles as pointers].

Also remove cast operator from CJS_Runtime and call GetIsolate()
explicitly.

R=thestig@chromium.org

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

3 years agoFix JS_GetArrayElement to not return an empty handle on success
Jochen Eisinger [Thu, 10 Sep 2015 11:44:04 +0000]
Fix JS_GetArrayElement to not return an empty handle on success

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

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

3 years agoResolve bad cast to CJS_EventHandler
foxit [Thu, 10 Sep 2015 06:57:54 +0000]
Resolve bad cast to CJS_EventHandler

At line 2026 in pdfsdk/src/javascript/PublicMethods.cpp,
the writer wants to perform type cast like line 2027 but
he made a mistake to make type conversion on m_pValue.
Even at line 2027, it's redundant to make type conversion.
The returned type of pContext->GetEventHandler() is
CJS_EventHandler*.

BUG=529310
R=tsepez@chromium.org

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

3 years agoRemove existing generated images before running a test.
Lei Zhang [Wed, 9 Sep 2015 19:49:19 +0000]
Remove existing generated images before running a test.

R=tsepez@chromium.org

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

3 years agoFix heap use after free in CPDFSDK_Annot::GetPDFAnnot.
Tom Sepez [Wed, 9 Sep 2015 16:58:10 +0000]
Fix heap use after free in CPDFSDK_Annot::GetPDFAnnot.

Use two seperate loops to kill current focus annot and to release annots
in current page. Loop to kill current focus annot is run first, so it
will not access deleted annots.

BUG=507316

R=tsepez@chromium.org

TEST=Reproduction steps mentioned in issue 507316 should not crash
     chrome.
     Unit test added to pdfium.
     Run pdfium_embeddertests.exe.

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

3 years agoTest files for issue 507316
Tom Sepez [Wed, 9 Sep 2015 16:53:32 +0000]
Test files for issue 507316
Upload pdf test files for codereview 1312313006.

BUG=507316
R=tsepez@chromium.org

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

3 years agoBeef up app_props.in and tidy app.cpp.
Tom Sepez [Tue, 8 Sep 2015 23:23:39 +0000]
Beef up app_props.in and tidy app.cpp.

Some of the values returned are dubious; capture the
current state of affairs.

R=thestig@chromium.org

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

3 years agoChange the JS app.viewerType() return value to "pdfium"
Lei Zhang [Tue, 8 Sep 2015 22:17:51 +0000]
Change the JS app.viewerType() return value to "pdfium"

BUG=pdfium:181
R=tsepez@chromium.org

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

3 years agoRemove unneeded checks for CPDF_Object::GetDict() return values.
Lei Zhang [Tue, 8 Sep 2015 17:17:25 +0000]
Remove unneeded checks for CPDF_Object::GetDict() return values.

CPDF_Object::GetDict() always returns a valid pointer for dictionaries.

R=tsepez@chromium.org

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

3 years agoFix typos, nits and remove dead code in fpdf_text_int.cpp.
Lei Zhang [Fri, 4 Sep 2015 21:11:03 +0000]
Fix typos, nits and remove dead code in fpdf_text_int.cpp.

R=tsepez@chromium.org

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

3 years agoRemove CJBig2_Module::JBig2_Error and friends.
Lei Zhang [Fri, 4 Sep 2015 01:00:27 +0000]
Remove CJBig2_Module::JBig2_Error and friends.

R=tsepez@chromium.org

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

3 years agoMake a bunch of JBig2 classes independent of CJBig2_Object.
Lei Zhang [Thu, 3 Sep 2015 23:03:42 +0000]
Make a bunch of JBig2 classes independent of CJBig2_Object.

R=tsepez@chromium.org

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

3 years agoTurn a failing assert into an actual check.
Lei Zhang [Thu, 3 Sep 2015 21:13:19 +0000]
Turn a failing assert into an actual check.

BUG=522131
R=tsepez@chromium.org

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

3 years agoChange fixup_pdf_template.py to open files in binary mode.
Lei Zhang [Wed, 2 Sep 2015 23:31:33 +0000]
Change fixup_pdf_template.py to open files in binary mode.

Fix for the pixel test failure on Windows from commit 870b5b6793fa.
Seems to work for me on Windows.

TBR=tsepez@chromium.org

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

3 years agoRemove dead JBig2 code.
Lei Zhang [Wed, 2 Sep 2015 20:52:56 +0000]
Remove dead JBig2 code.

R=tsepez@chromium.org

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

3 years agoReapply Foxit's libopenjpeg modifications.
Lei Zhang [Wed, 2 Sep 2015 20:52:01 +0000]
Reapply Foxit's libopenjpeg modifications.

They were lost in commit d53e6fd.

BUG=pdfium:168
R=tsepez@chromium.org

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

3 years agoCleanup dead code in CPDF_DIBSource::LoadJpxBitmap() and friends.
Lei Zhang [Tue, 1 Sep 2015 22:42:00 +0000]
Cleanup dead code in CPDF_DIBSource::LoadJpxBitmap() and friends.

R=tsepez@chromium.org

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

3 years agoRemove IPDFSDK_AnnotHandler interface.
Tom Sepez [Tue, 1 Sep 2015 22:01:58 +0000]
Remove IPDFSDK_AnnotHandler interface.

It's pointless to have an abstract interface and its only concrete
implementation defined in the same header.  We can de-virtualize along
the way and get a small savings.

Rename CPDFSDK_BFAnnotHandler along the way, since its the only kind
of AnnotHandler, and I can't imagine what BF stands for.

R=thestig@chromium.org

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

3 years agoCPDFSDK_MediaActionHandler is unused.
Tom Sepez [Tue, 1 Sep 2015 20:53:19 +0000]
CPDFSDK_MediaActionHandler is unused.

It's never instantiated, and any pointers to it are always NULL.
Also kill an unused arg to CPDFSDK_ActionHandler ctor along the way.

R=thestig@chromium.org

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

3 years agoCJS_Context::compile unused
Tom Sepez [Mon, 31 Aug 2015 23:54:42 +0000]
CJS_Context::compile unused

This, in turn, allows us to get rid of the DoJob method and its clumsy
mode parameter conditional.

Add explicit and consts, and remove pointless asserts along the way.

R=thestig@chromium.org

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

3 years agoFix two issues shown by bug 489995
Tom Sepez [Mon, 31 Aug 2015 21:44:21 +0000]
Fix two issues shown by bug 489995

- Handle NULL in buffer operator<< under JS mailForm() calls.
- Ensure correct type in JS addIcon() calls.

BUG=489995
R=brucedawson@chromium.org, thestig@chromium.org

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

3 years agoMove configs out of targets in GN build files.
Brett Wilson [Mon, 31 Aug 2015 20:45:07 +0000]
Move configs out of targets in GN build files.

I'm trying to disallow this since it's confusing. It looks like it provides
scoping for the inner config, but it is actually no different than declaring
the config at the top level. For clarify, all configs and targets should be
declared at the top level.

R=jam@chromium.org

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

3 years agoFix infinite loop for objects that reference themselves.
Lei Zhang [Mon, 31 Aug 2015 05:45:08 +0000]
Fix infinite loop for objects that reference themselves.

BUG=pdfium:193
R=jun_fang@foxitsoftware.com

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

3 years agoReplace signed char with int8_t. Fix Linux ARM build after r7830e9e.
Lei Zhang [Sat, 29 Aug 2015 06:43:11 +0000]
Replace signed char with int8_t. Fix Linux ARM build after r7830e9e.

TBR=tsepez@chromium.org

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

3 years agoCheck array bounds for opj_dwt_decode_1() and friends.
Lei Zhang [Sat, 29 Aug 2015 04:59:24 +0000]
Check array bounds for opj_dwt_decode_1() and friends.

Based on an earlier patch by jun_fang@foxitsoftware.com.

BUG=450844
R=jun_fang@foxitsoftware.com

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

3 years agoFix some -Wmaybe-uninitialized errors.
Lei Zhang [Thu, 20 Aug 2015 21:43:45 +0000]
Fix some -Wmaybe-uninitialized errors.

- Break up CPDF_DIBSource::DownSampleScanline() into smaller functions.

R=tsepez@chromium.org

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

3 years agoRemove a bunch of dead JBIG2 code.
Lei Zhang [Thu, 20 Aug 2015 21:35:53 +0000]
Remove a bunch of dead JBIG2 code.

R=tsepez@chromium.org

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

3 years agoExtern in .cpp file is a code smell, part 2.
Tom Sepez [Wed, 19 Aug 2015 20:25:44 +0000]
Extern in .cpp file is a code smell, part 2.

Fixes the remaining issues, except for JBIG2/Skia ...

R=thestig@chromium.org

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

3 years agoExtern in .cpp files is a code smell.
Tom Sepez [Wed, 19 Aug 2015 17:28:50 +0000]
Extern in .cpp files is a code smell.

Part 1.  Move to headers so compiler can type check against
the definitions.

R=thestig@chromium.org

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

3 years agoFix mac build after commit e1ce94e.
Lei Zhang [Tue, 18 Aug 2015 23:02:32 +0000]
Fix mac build after commit e1ce94e.

TBR=tsepez@chromium.org

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

3 years agoCleanup CFX_Font a bit.
Lei Zhang [Tue, 18 Aug 2015 22:39:59 +0000]
Cleanup CFX_Font a bit.

- Make methods const.
- Make variables non-public.
- Remove LoadFile() method.

R=tsepez@chromium.org

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

3 years agoRemove unused code warnings found by clang.
Lei Zhang [Tue, 18 Aug 2015 19:24:53 +0000]
Remove unused code warnings found by clang.

R=tsepez@chromium.org

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

3 years agoFX_CMapDwordToDword considered harmful.
Tom Sepez [Tue, 18 Aug 2015 16:20:29 +0000]
FX_CMapDwordToDword considered harmful.

Lookups are log(n), but random insertions could result in n^2
behaviour.  Replace with maps and sets.

R=thestig@chromium.org

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

3 years agoRemove more dead code from fx_basic.h
Tom Sepez [Tue, 18 Aug 2015 15:56:47 +0000]
Remove more dead code from fx_basic.h

R=thestig@chromium.org

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

3 years agoClean up IFX_BidiChar
Lei Zhang [Tue, 18 Aug 2015 01:00:48 +0000]
Clean up IFX_BidiChar

- Replace IFX_BidiChar with just CFX_BidiChar
- Document implementation
- Change out parameters to pointers
- Remove dead code
- Add an enum for bidi directions
- Move several externs to a header
- Add unit tests

R=tsepez@chromium.org

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

3 years agoFix fix fix fix of breakage on mac.
Tom Sepez [Tue, 18 Aug 2015 00:27:26 +0000]
Fix fix fix fix of breakage on mac.

R=thestig@chromium.org

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

3 years agoFix fix fix of mac build breakage at 9cf44c2e
Tom Sepez [Tue, 18 Aug 2015 00:07:25 +0000]
Fix fix fix of mac build breakage at 9cf44c2e

R=thestig@chromium.org

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

3 years agoFix fix of mac build breakage at 2a2a6aa
Tom Sepez [Mon, 17 Aug 2015 23:55:26 +0000]
Fix fix of mac build breakage at 2a2a6aa

TBR=thestig@chromium.org

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

3 years agoFix mac build breakage at ce4ffb8.
Tom Sepez [Mon, 17 Aug 2015 23:49:56 +0000]
Fix mac build breakage at ce4ffb8.

R=thestig@chromium.org

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

3 years agoCFX_MapByteStringToPtr considered harmful.
Tom Sepez [Mon, 17 Aug 2015 23:26:03 +0000]
CFX_MapByteStringToPtr considered harmful.

R=thestig@chromium.org

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

3 years agoCleanup CFX_UnicodeEncoding and remove IFX_FontEncoding.
Lei Zhang [Mon, 17 Aug 2015 22:05:46 +0000]
Cleanup CFX_UnicodeEncoding and remove IFX_FontEncoding.

R=tsepez@chromium.org

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

3 years agoFix more sign comparison errors.
Lei Zhang [Mon, 17 Aug 2015 19:20:05 +0000]
Fix more sign comparison errors.

R=tsepez@chromium.org

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

3 years agojs_global_data and global_alternate violate naming rules.
Tom Sepez [Mon, 17 Aug 2015 18:58:34 +0000]
js_global_data and global_alternate violate naming rules.

They look too much like locals; use JSGlobalData and JSGlobalAlternate
instead.  Kill some commented out code.

R=thestig@chromium.org

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

3 years agoSuppress -Wswitch for pdfium's fxge target for now.
Nico Weber [Mon, 17 Aug 2015 04:17:54 +0000]
Suppress -Wswitch for pdfium's fxge target for now.

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

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

3 years agoFix -Wunused-function warnings on Windows.
Nico Weber [Mon, 17 Aug 2015 04:17:02 +0000]
Fix -Wunused-function warnings on Windows.

BUG=505316
R=thestig@chromium.org

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

3 years agoFix a incorrectly placed comment from 0f6b51c
Lei Zhang [Sat, 15 Aug 2015 05:26:56 +0000]
Fix a incorrectly placed comment from 0f6b51c

TBR=tsepez@chromium.org

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

3 years agoClean: Fix some unneeded semi-colons and bad spacing.
Lei Zhang [Sat, 15 Aug 2015 04:39:51 +0000]
Clean: Fix some unneeded semi-colons and bad spacing.

TBR=tsepez@chromium.org

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

3 years agoAdd new public APIs to find the z-order for links and widgets.
Lei Zhang [Sat, 15 Aug 2015 02:02:30 +0000]
Add new public APIs to find the z-order for links and widgets.

- Implement FPDFLink_GetLinkZOrderAtPoint().
- Implement FPDFPage_FormFieldZOrderAtPoint().
- Mark FPDPage_HasFormFieldAtPoint() as deprecated.
- Modify CPDF_LinkList and CPDF_InterForm to support new APIs.
- Clean up dead code in CPDF_LinkList and CPDF_InterForm.

BUG=chromium:515837
R=jun_fang@foxitsoftware.com, tsepez@chromium.org

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

3 years agoDon't bother checking pointers before delete[] and FX_Free().
Lei Zhang [Fri, 14 Aug 2015 22:45:39 +0000]
Don't bother checking pointers before delete[] and FX_Free().

R=tsepez@chromium.org

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

3 years agoUse override in more classes in fpdfsdk/
Lei Zhang [Fri, 14 Aug 2015 21:23:57 +0000]
Use override in more classes in fpdfsdk/

R=tsepez@chromium.org

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

3 years agoUse override in more classes in core/
Lei Zhang [Fri, 14 Aug 2015 21:07:43 +0000]
Use override in more classes in core/

R=tsepez@chromium.org

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

3 years agoCleanup: Remove unused CPDF_Metadata::m_pDoc.
Lei Zhang [Fri, 14 Aug 2015 20:35:32 +0000]
Cleanup: Remove unused CPDF_Metadata::m_pDoc.

Also remove unused kAddinNameCJK variable.

R=tsepez@chromium.org

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

3 years agoCPDF_ModuleMgr::m_SecurityHandlerMap only used by dead code.
Tom Sepez [Fri, 14 Aug 2015 19:39:55 +0000]
CPDF_ModuleMgr::m_SecurityHandlerMap only used by dead code.

R=thestig@chromium.org

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

3 years agoFix build after commit 22ece1a. Too many if's.
Lei Zhang [Fri, 14 Aug 2015 01:04:27 +0000]
Fix build after commit 22ece1a. Too many if's.

TBR=tsepez@chromium.org

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

3 years agoRemove last uses of FOXIT_CHROME_BUILD.
Lei Zhang [Fri, 14 Aug 2015 00:54:22 +0000]
Remove last uses of FOXIT_CHROME_BUILD.

BUG=pdfium:46
R=tsepez@chromium.org

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

3 years agoCleanup: s/Torelance/Tolerance/
Lei Zhang [Fri, 14 Aug 2015 00:50:20 +0000]
Cleanup: s/Torelance/Tolerance/

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

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

3 years agoOutputText() is dead code.
Tom Sepez [Fri, 14 Aug 2015 00:38:23 +0000]
OutputText() is dead code.

R=thestig@chromium.org

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

3 years agoTidy up JS_Object.h and JS_Object.cpp.
Tom Sepez [Thu, 13 Aug 2015 23:43:10 +0000]
Tidy up JS_Object.h and JS_Object.cpp.

R=thestig@chromium.org

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

3 years agoKill JS_TIMER_MAPARRAY
Tom Sepez [Thu, 13 Aug 2015 22:54:56 +0000]
Kill JS_TIMER_MAPARRAY

R=thestig@chromium.org

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

3 years agoCleanup: Remove unused CPDF_Stream::Clone().
Lei Zhang [Thu, 13 Aug 2015 22:43:09 +0000]
Cleanup: Remove unused CPDF_Stream::Clone().

Cloning a CPDF_Stream actually happens via CPDF_Object::Clone().

Transitively, remove:
- GetStreamFilter()
-- all the filters.

R=jam@chromium.org

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

3 years agoMake standalone PDFium DEPS pull clang-format.
Tom Sepez [Thu, 13 Aug 2015 22:41:25 +0000]
Make standalone PDFium DEPS pull clang-format.

R=thakis@chromium.org

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

3 years agoRemove if checks after new.
Lei Zhang [Thu, 13 Aug 2015 22:24:19 +0000]
Remove if checks after new.

R=tsepez@chromium.org

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

3 years agoSuppress -Wunused-function for pdfium's third-party libraries.
Nico Weber [Thu, 13 Aug 2015 22:03:21 +0000]
Suppress -Wunused-function for pdfium's third-party libraries.

Also add a missing header file.

BUG=505316
R=thestig@chromium.org

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

3 years agoAllow external font-path configuration from pdfium_test.
Tom Sepez [Thu, 13 Aug 2015 18:52:45 +0000]
Allow external font-path configuration from pdfium_test.

R=thestig@chromium.org

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

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

3 years agoRevert "Allow external font-path configuration from pdfium_test."
Tom Sepez [Thu, 13 Aug 2015 18:32:36 +0000]
Revert "Allow external font-path configuration from pdfium_test."

This reverts commit d8b5e73d8609b74e6a995ee1768d20d47bd4b089.
Broke corpus tests

TBR=thestig@chromium.org

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

3 years agoAllow external font-path configuration from pdfium_test.
Tom Sepez [Thu, 13 Aug 2015 18:22:54 +0000]
Allow external font-path configuration from pdfium_test.

R=thestig@chromium.org

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

3 years agoFix a small leak in CPDF_DataAvail::CheckTrailer().
Lei Zhang [Tue, 11 Aug 2015 21:00:22 +0000]
Fix a small leak in CPDF_DataAvail::CheckTrailer().

R=tsepez@chromium.org

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

3 years agoFix some sign comparison warnings.
Lei Zhang [Tue, 11 Aug 2015 20:55:52 +0000]
Fix some sign comparison warnings.

R=tsepez@chromium.org

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

3 years agoRemove dead code from CPDF_Metadata. Add missing nullptr check.
Lei Zhang [Tue, 11 Aug 2015 20:54:33 +0000]
Remove dead code from CPDF_Metadata. Add missing nullptr check.

BUG=pdfium:117
R=tsepez@chromium.org

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

3 years agoCleanup: Mark methods with the override keyword.
Lei Zhang [Mon, 10 Aug 2015 07:06:39 +0000]
Cleanup: Mark methods with the override keyword.

- Delete unneeded CFFL_ComboBox::CanCopy() and friends.
- Delete unneeded CFFL_FormFiller::CanCopy() and friends.
- Delete unneeded CFFL_TextField::CanCopy() and friends.
- Delete unneeded FormFiller::DoCopy() and friends.
- Rename CFFL_FormFiller::On{Set,Kill}Focus to avoid conflicts.

BUG=pdfium:185
R=thakis@chromium.org

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

3 years agoReally Really fix tests broken at 9778206.
Tom Sepez [Fri, 7 Aug 2015 23:31:03 +0000]
Really Really fix tests broken at 9778206.

Stub out failing platform entirely

TBR=thestig@chromium.org

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

3 years agoReally fix tests broken at 9778206.
Tom Sepez [Fri, 7 Aug 2015 23:20:26 +0000]
Really fix tests broken at 9778206.

Stub out failing platform.
TBR=thestig@chromium.org

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

3 years agoFix win unit tests broken at 9778206.
Tom Sepez [Fri, 7 Aug 2015 23:08:29 +0000]
Fix win unit tests broken at 9778206.

Windows uses the system implementation of itoa which goes
to 36.

TBR=thestig@chromium.org

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

3 years agoFix FXSYS_itoa() implementation.
Tom Sepez [Fri, 7 Aug 2015 22:28:21 +0000]
Fix FXSYS_itoa() implementation.

I thought about removing it, but decided to fix it instead until c++11
hits and there may be better alternatives.

Remove unused variants.

BUG=517854
R=brucedawson@chromium.org, thestig@chromium.org

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

3 years agoConvert all files on the master branch to unix line endings.
Nico Weber [Fri, 7 Aug 2015 18:42:26 +0000]
Convert all files on the master branch to unix line endings.

Luckily, it's just one file.

BUG=none
R=tsepez@chromium.org

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

3 years agoclang-format all pdfium code, again.
Nico Weber [Thu, 6 Aug 2015 21:38:03 +0000]
clang-format all pdfium code, again.

Also add a presubmit that checks for this so I don't have to keep doing it.
No behavior change.

Generated by:
  find . -name '*.cpp' -o -name '*.h' | \
  grep -E -v 'third_party|thirdparties|lpng_v163' | \
  xargs ../../buildtools/mac/clang-format -i

BUG=none
R=thestig@chromium.org

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

3 years agoAdd CFX_FontFaceInfo constructor.
Tom Sepez [Thu, 6 Aug 2015 18:41:17 +0000]
Add CFX_FontFaceInfo constructor.

(Having renamed CFontFaceInfo to follow naming pattern).
Also cleanup some initialization-order noise in CFX_FontMapper.

R=thestig@chromium.org

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

3 years agoEarly object closing in PDF via premature 'endobj' keyword
JUN FANG [Thu, 6 Aug 2015 00:07:07 +0000]
Early object closing in PDF via premature 'endobj' keyword

Adobe acrobat defines keywords "\nendstream\n" and "\nendobj\n" in object's stream.
However, Pdfium searches "endstream" and "endobj" as the keywords in the streams of objects.
Some words like "(endstream)" are wrongly treated as keywords in pdfium.
This fix follows Adobe's solution.

BUG=493126
R=tsepez@chromium.org

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

3 years agoRemove the unused IFX_StreamRead::SetRange() mechanism.
Tom Sepez [Wed, 5 Aug 2015 22:13:08 +0000]
Remove the unused IFX_StreamRead::SetRange() mechanism.
This, in turn make m_bUseRange always false, so remove it.

R=thestig@chromium.org

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

3 years agoCPDF_Parser shouldnt be in the business of opening files
Tom Sepez [Wed, 5 Aug 2015 17:39:02 +0000]
CPDF_Parser shouldnt be in the business of opening files

Move that operation closer to the embedder's call.

R=thestig@chromium.org

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

3 years agoFPDF_Creator can only create file through embedder-supplied callback.
Tom Sepez [Wed, 5 Aug 2015 17:00:59 +0000]
FPDF_Creator can only create file through embedder-supplied callback.

Hence, some of the routines taking filename strings are unused. This,
in turn allows us to get rid of some other fopen-ishy looking things
inside the library.

R=thestig@chromium.org

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

3 years agoDon't dispose the isolate if its provided by the embedder
Jochen Eisinger [Wed, 5 Aug 2015 06:55:39 +0000]
Don't dispose the isolate if its provided by the embedder

BUG=chromium:515718
R=thestig@chromium.org

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

3 years agoAdd a license header for testing/tools/make_expected.sh.
Lei Zhang [Tue, 4 Aug 2015 21:23:05 +0000]
Add a license header for testing/tools/make_expected.sh.

R=tsepez@chromium.org

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

3 years agoRemove stringify macro (#) from JS_STATIC_CONST_ENTRY_*.
Tom Sepez [Tue, 4 Aug 2015 20:56:45 +0000]
Remove stringify macro (#) from JS_STATIC_CONST_ENTRY_*.

R=thestig@chromium.org

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

3 years agoAdd a .clang-format config file.
Nico Weber [Tue, 4 Aug 2015 20:55:17 +0000]
Add a .clang-format config file.

This is the .clang-format file I used to format everything.

BUG=none
R=tsepez@chromium.org

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