summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-10-08Relax the check on 0 length streams.chromium/2531Lei Zhang
CPDF_SyntaxParser::ReadStream() originally created stream objects when the length is 0. Commit 2526930 tightened the constraint and returned NULL. This has some adverse affects, as seen in Chromium's print preview of PDFs. Instead, relax the constraint a little so when the length is 0, return a CPDF_Stream with NULL data and size 0. BUG=531835 Review URL: https://codereview.chromium.org/1394743002 .
2015-10-08Remove some dead code from CCodec_Jbig2Module. Variable was only ever set to ↵David Lattimore
false. R=thestig@chromium.org BUG= Review URL: https://codereview.chromium.org/1393153002 .
2015-10-07Rename IFXJS_Runtime and IFXJS_Context to IJS_.Tom Sepez
Nothing but sed. FXJS is a layer that makes it easier to define objects in V8, but has no knowledge of PDF-specific native objects. It could in theory be used to implement other sets of native objects. JS is the layer that implements PDF-specific native objects on top of FXJS. Therefore, the classes used to interface to JS should be named using IJS_. IFXJS_ is reserved for someday adding better API for FXJS iteslf. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1386173002 .
2015-10-07Update README.md to reflect added .png supportTom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1391023004 .
2015-10-07Stop inlining CJBig2_BitStream.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1393823002 .
2015-10-07Fix the Windows build after commit 8a9ce57.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1396533002 .
2015-10-07Remove gotos in JBig2 code.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1382613003 .
2015-10-07Move build instructions to README.mdJochen Eisinger
That way, they'll be automatically displayed on gitiles BUG= R=andybons@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1378073003 .
2015-10-06Roll DEPS for v8 to 9081ee1.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1391733002 .
2015-10-07Fix include paths for fx_system.hDavid Lattimore
R=thestig@chromium.org BUG= Review URL: https://codereview.chromium.org/1390863002 .
2015-10-06Remove unused global argument from FXJS_CONSTRUCTOR.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1389003003 .
2015-10-06Store object definition ID in each js_class.Tom Sepez
Avoids doing a lookup via FXJS_V8 for something already known in CJS layer. Also: Consolidate repeated code in JS macros. Remove knowledge that Document is global from FXJS layer R=thestig@chromium.org Review URL: https://codereview.chromium.org/1382263002 .
2015-10-06Run FXJS_V8 embedder tests against a shared isolate.Tom Sepez
Start to back-fill some tests for the recent isolate work. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1377293004 .
2015-10-06Make the vast majority of JS headers private to src/javascript.Tom Sepez
The fpdfsdk/include/javascript/IJavascript.h is the sole API. This required moving a creaton method to it from JS_Runtime. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1389783002 .
2015-10-05Fix regression in JBIG2 decoding from commit ce37d73.chromium/2530chromium/2529Lei Zhang
many callers can tolerate CJBig2_ArithIntDecoder::decode() OOB failure. BUG=539749, pdfium:209 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1384663007 .
2015-10-05Remove JavaScript.hTom Sepez
It merely includes a bunch of other .h files which are handled better since we fixed IWYU. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1385983002 .
2015-10-05Original patch by forshaw.Tom Sepez
Added a fallback Win32 font information class for win32k lockdown. This is to support running PDFIUM within the Win32k lockdown by removing dependancies on USER32/GDI for the font information code. It falls back to using a freetype/directory enumeration implementation if it detects the win32k system calls have been disabled by policy. BUG=523278 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1306883002 .
2015-10-05Disable JBIG2 cache; prevent data corruption - try 2.Lei Zhang
Also change CJBig2_SymbolDict::DeepCopy() to return a unique_ptr to prevent a potential leak if the cache size was 0. BUG=pdfium:207 R=tsepez@chromium.org, jbreiden@google.com Review URL: https://codereview.chromium.org/1374633004 .
2015-10-04Fix a leak with g_DefaultGlobalObjectTemplate.chromium/2528Lei Zhang
As seen when running FXJSV8Embeddertest.Getters. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1380993003 .
2015-10-04Remove pointless CPDFSDK_PageView usage in CJS_Object / CJS_EmbedObj.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1374723004 .
2015-10-04Only call DefineJSObjects() once for the global V8 isolate.Lei Zhang
BUG=539106 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1386823002 .
2015-10-04CJS_Timer should observe CJS_Runtime destruction.Lei Zhang
Also remove dead CJS_EmbedObj::{Begin,End}Timer code. BUG=539107 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1384883002 .
2015-10-03Fix NULL pointer dereference in CPDF_InterForm.Lei Zhang
BUG=537772 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1387703002 .
2015-10-03Refcount external V8 isolate initialization / release.chromium/2527Lei Zhang
BUG=531339 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1377463005 .
2015-10-02Pass v8::Isolate to PDFium at init time.Tom Sepez
Move the external isolate and embedder slot from the IPDF_JSPlatforms struct supplied at the FPDFDOC_InitFormFillEnvironment() call time to arguments to the FPDF_InitLibraryWithConfig() call. This has several benefits: -- Avoids the crash that could happen if multiple FPDFDOC_InitFormFillEnvironmen() calls should happen to be made by an embedder with different slot values. -- Down the road, for XFA, there may be XFA but no FormFill environment. We support both forms for the time being, until the chrome side catches up, at which point we will deprecate the old way. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1367033002 .
2015-10-02Do not call into formfiller code with a NULL PageView.Lei Zhang
BUG=537173 R=jun_fang@foxitsoftware.com, tsepez@chromium.org Review URL: https://codereview.chromium.org/1376093002 .
2015-10-02Get rid of gotos in CPDF_SyntaxParser and FlateUncompress().Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1360103002 .
2015-10-02Prevent divide by zeros in CJBig2_GSIDProc::decode_MMR().Lei Zhang
Check the image size before attempting to decode. BUG=538103 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1377493005 .
2015-10-02Fix a leak in PDF_DataDecode() on failure.Lei Zhang
Found using the test examples from https://crbug.com/537780 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1376413003 .
2015-10-02Turn a couple functions that always return true to return void.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1386463003 .
2015-10-02Fix PNG decoding divide by zero error due to zero row count.Lei Zhang
BUG=537790 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1379243002 .
2015-10-02Correct mistakes in test case for 507316Tom Sepez
Original patch by chamalsl. Trailer size in bug_507316 was wrong. embedder_test.cpp's GetPageTrampoline passed null parameter. It will affect future test cases even if it does not affect this. BUG=507316 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1377403003 .
2015-10-01Fix static initializer in fxjs_v8.cppTom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1372103004 .
2015-10-01Disable JBIG2 cache; prevent data corruptionLei Zhang
BUG=pdfium:207 Original author: jbreiden@google.com Original CL: http://codereview.chromium.org/1362133003/ R=jbreiden@google.com Review URL: https://codereview.chromium.org/1382073002 .
2015-10-01Clean up some image decoder classes:Lei Zhang
- Use std::vector<uint8_t> instead of raw uint8_t* - Make ICodec_ScanlineDecoder::GetScanline() return const uint8_t* - Add FxFreeDeleter, use it in CCodec_ImageDataCache. - Make CCodec_ImageDataCache encapsulate its data members. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1361053002 .
2015-10-01Cleanup JBig2_ArithIntDecoder.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1359013003 .
2015-10-01Revert "Leak per-isolate data in pdfium"Raymes Khoury
This reverts commit 3e144b8c23d7c52ed36329e87f0cb01f38ec1ed7. This may be causing the failures seen in crbug.com/537799. BUG=537799 Review URL: https://codereview.chromium.org/1382433003 .
2015-09-30Add signatures to FXJS_V8.Tom Sepez
BUG=chromium:529012 R=jochen@chromium.org, krasin@google.com Review URL: https://codereview.chromium.org/1353193004 .
2015-09-30Leak per-isolate data in pdfiumchromium/2525chromium/2524Raymes Khoury
Right now we're freeing per-isolate data everytime a document is destroyed even though it may be in use by other documents. For now we leak the per-isolate data until crbug.com/531339 is fixed. BUG=531339 R=jochen@chromium.org Review URL: https://codereview.chromium.org/1372353002 . Patch from Raymes Khoury <raymes@chromium.org>.
2015-09-29Cleanup CJBig2_ArithDecoder.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1368153003 .
2015-09-29Roll DEPS for v8 to d7f813b.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1380663003 .
2015-09-29Refactor some common code for bounding boxes.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1373333002 .
2015-09-29Fix blank page issue caused by too strict correction on bpcchromium/2523Jun Fang
For bit per component (bpc), PDF spec mentions that a RunLengthDecode or DCTDecode filter shall always deliver 8-bit samples. However, some PDF files don't follow this rule. We can find that filter is RunLengthDecode but bpc is 1 in the provided test file. In this case, pdfium will correct bpc to 8 but the actual bpc is 1. It causes a failure because the data is much more than the expected. To handle this case, pdfium doesn't correct bpc to 8 when the original bpc is 1. BUG=512557 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1328213002 .
2015-09-28Cleanup some fx_codec_fax.cpp code.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1367633005 .
2015-09-28Fix test diff caused by v8 version updateTom Sepez
Also changes DEPS to specify a specific v8 version, this will require us to manually update this version from time to time, but also solves a longstanding problem where going back to an older version (say for bisecting) wouldn't always work. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1372963003 .
2015-09-28Introduce kPerIsolateDataIndex and tidy JS_Define.hTom Sepez
Follow-up from https://codereview.chromium.org/1366053003/ - use kPerIsolateDataIndex rather than magic constant 1. - make a helper function for common code in JS_Define.h - remove dead prototypes missed in earlier CL. - fxjs_v8 can't include generic fpdfsdk includes (layering). R=jochen@chromium.org Review URL: https://codereview.chromium.org/1367813003 .
2015-09-25Add Mac-specific pixel test expectations.chromium/2522chromium/2521Lei Zhang
The font is slightly different from Linux/Windows. BUG=524043 R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/1366363002 .
2015-09-25Revert "Revert "Fix the issue that pdfium swallows 'fi' or 'ff' in some pdf ↵Jun Fang
files"" This reverts commit fa9756f77ad6145940d3dc697814b84f5755ae17. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1307353005/
2015-09-25Revert "Fix the issue that pdfium swallows 'fi' or 'ff' in some pdf files"Jun Fang
This reverts commit 9bd18183ba8210c91d71c3060146235750a4c71c.
2015-09-25Fix the issue that pdfium swallows 'fi' or 'ff' in some pdf filesJun Fang
Pdfium swallows 'fi' or 'ff' in some tested files because it doesn't load the embedded font file correctly. The root cause is that there is incorrect keyword like 'ngendstream' in the stream of the embedded font file. Pdfium tries to find another correct keyword but uses wrong offset rather than accumulated offset. BUG=524043 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1307353005 .