summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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 .
2015-09-25Revert "Revert "Merge to master: contention over isolate data slots""Tom Sepez
This reverts commit 3b4382a847b5a7439a3107512dbe54c317108579. The difference between this CL and the one that failed is fxjs_v8.cpp:271. In master, we pass the runtime information as: v8::isolate -> v8::Context -> FXJS Runtime, but in XFA: V8::Isolate -> PerIsolate struct -> FXJS Runtime. The master way is more correct, in that FXJS_Runtime is 1:1 with v8 contexts and many:1 (in theory) with isolates. It looks like the XFA branch missed a patch along the way. I'll do that next. Having made this change, the only data in the per-isolate struct will be the ptr array (on master); it will also include the XFA context (on XFA). I've kept the struct on master for the sake of similarity. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1365733003 .
2015-09-24Fix a leak in CJBig2_Context.chromium/2520Lei Zhang
- Remove dead code - Use unique_ptr BUG=pdfium:202 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1365903002 .
2015-09-24Split up JBig2_GeneralDecoder.cpp.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1359233002 .
2015-09-23Fix a leak in CJBig2_CachePair.Lei Zhang
R=jbreiden@google.com Review URL: https://codereview.chromium.org/1346043003 .
2015-09-23Flip conditionals to positive logic in pdfium_test.Lei Zhang
Also merge a check for failed document loads from XFA. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1362143002 .
2015-09-23Fix a couple potential file handle leaks in pdfium_test.Lei Zhang
Fix lint issues / git cl format. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1357423006 .
2015-09-22Change nonstd::unique_ptr to take a custom deleter.Lei Zhang
Code is mostly stolen from Chromium's scoped_ptr. - Add unit tests. - Use this to fix a leak. BUG=chromium:531408 R=jyasskin@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1351383004 .
2015-09-22Revert "Merge to master: contention over isolate data slots"Tom Sepez
Reason for revert: embeddertests failed. This reverts commit 70bc04b16646c92f221c5aa56831b01d6ec7c1ca. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1358263004 .
2015-09-22Merge to master: contention over isolate data slotsTom Sepez
Work on this was first performed on the XFA branch, since it has additional requirements (FXJSE layer) that needed to be accomodated by the solution. (cherry picked from commit ed7b2b50aa1744e0bc5a60bef12c61fa91d863b7) Original Review URL: https://codereview.chromium.org/1351173002 . R=thestig@chromium.org Review URL: https://codereview.chromium.org/1354593004 .
2015-09-22Use std::set<> to track active event handlers.Tom Sepez
This avoids some custom linked-list code. Also note that we use a local copy to be sure we removed the same thing that was added no matter how our callees may muck with the handler. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1352393003 .
2015-09-22Add nonstd::unique_ptr move assigment operator.Tom Sepez
std::unique_ptr supports move assignment as in: ptr2 = std::move(ptr1); R=jyasskin@chromium.org Review URL: https://codereview.chromium.org/1358163002 .
2015-09-22Add missing 'return' keyword.Lei Zhang
Discovered with experimental Clang plugin that flags temporary objects that are immediately destroyed. patch from issue 1359063003 at patchset 1 (http://crrev.com/1359063003#ps1) A=mdempsky@chromium.org R=mdempsky@chromium.org Review URL: https://codereview.chromium.org/1359103002 .
2015-09-22[Docs] Add wiki content to Markdown docsTom Sepez
BUG=none R=tsepez@chromium.org, jam@chromium.org, thestig@chromium.org Review URL: https://codereview.chromium.org/1356323002 .
2015-09-21Remove CJS_RuntimeFactorychromium/2519chromium/2518chromium/2517Tom Sepez
The Factory Design Pattern isn't buying us anything here over just new'ing the object we want. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1360523004 .
2015-09-21More tidy of CJS_Object, kill implicit cast operatorTom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1349423006 .
2015-09-17Don't pass null isolates to FXJS_ when we have a real isolate.Tom Sepez
Kill some now unused functions as a result. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1350703003 .
2015-09-18Fix a #include in fpdf_page_func.cpp.David Lattimore
Not sure why building with gyp was working despite the missing '../' but it wasn't working in stricter build systems. BUG= R=thestig@chromium.org Review URL: https://codereview.chromium.org/1321293003.
2015-09-16Remove several dead functions from fxjs_v8.{cpp,h}.Tom Sepez
Re-arrange things in the header so function overloads are next to each other, and related things are near each other. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1348693003 .
2015-09-16Make pdfium_embeddertests link in debug component builds.chromium/2516chromium/2515chromium/2514chromium/2513chromium/2512chromium/2511Nico Weber
Target v8 has: 'direct_dependent_settings': { 'defines': [ 'V8_SHARED', 'USING_V8_SHARED', ], }, For this to work, targets using v8 headers have to depend on v8 directly, else the V8_EXPORT macro won't work. Add a direct dependency on v8. BUG=none TEST=do a debug component build of pdfium_embeddertests on Win, should work without linker errors R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1349843002 .
2015-09-16Fix build broken at 506df426d5d6.Tom Sepez
Move header file includes when usage moved. Windows-only section missing a ")". TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1349783003 .
2015-09-16Ensure functions in FXJS_V8 are prefixed by FXJS_.Tom Sepez
Currently, its hard to tell which functions come from the JS_ layer at fpdfsdk/include/javascript vs. which functions come from the FXJS_V8 layer at fpdfsdk/include/jsapi. Until we take up the task of using namespaces, at least make the prefix consistent. Move objects out of FXJS_V8 that are really part of JS_. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1347833002 .
2015-09-15Check for empty embedder data before using it in PDFium JS bindings.chromium/2510Tom Sepez
This was guarded by an assert, but the path is hit. BUG=528015 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1345923002 .
2015-09-15gyp_pdfium should use ninja by default.Lei Zhang
R=thakis@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1330173002 .
2015-09-15Fix typo from commit a9d4bc5. (Autocomplete fail)Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1345883003 .
2015-09-15Fix build on Windows after commit 0b3c8f7.Lei Zhang
MSVS can't figure out the value of strlen(kConstString) at compile time. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1342263002 .
2015-09-15Implement FPDFAction_GetFilePath().Lei Zhang
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 .
2015-09-15Fix build broken at 09ed30750282Tom Sepez
Wrong parameter set to nullptr during one of the CL revisions. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1344483005 .
2015-09-15Refactor fxjs_v8 and add embeddertests for it.Tom Sepez
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 .
2015-09-15Fix build broken at ac8fda05418b on windowsTom Sepez
|constexpr| not supported on windows. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1347723002 .
2015-09-15Add move ctor to nonstd::unique_ptr.Tom Sepez
R=jyasskin@chromium.org Review URL: https://codereview.chromium.org/1338383002 .
2015-09-15Cleanup JBig2_GeneralDecoder.cpp.Lei Zhang
- 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 .
2015-09-15Cleanup: Fix a typo. s/Processive/Processing/Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1338573002 .
2015-09-15Add a missing #include that's needed for call to FXSYS_tolower.David Lattimore
BUG= R=thestig@chromium.org Review URL: https://codereview.chromium.org/1329343002.
2015-09-14Get CJS_RuntimeFactory out of the CJS_GlobalData management business.Tom Sepez
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 .
2015-09-11Convert some unneeded gotos into returns.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1332193002 .
2015-09-11Cleanup casting of FX_Alloc() return values.Lei Zhang
Also convert some FX_AllocOrDie() calls to FX_Alloc(). R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1332173002 .
2015-09-11Fix strings, remove stringify macros, void return types for Consts.h.Tom Sepez
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 .
2015-09-11Rename Init methods to more accurately describe purposeTom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1335763002 .
2015-09-10Guard against null image data in CJBig2_GRRDProc.chromium/2509chromium/2508Lei Zhang
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 .
2015-09-10Remove CJBig2_Object, CJBig2_Module, and friends.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1326953006 .
2015-09-10Remove some abstractions in fxjs_v8.h.Tom Sepez
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 .
2015-09-10Fix JS_GetArrayElement to not return an empty handle on successchromium/2507Jochen Eisinger
BUG=chromium:528376 R=ulan@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1337433002 .
2015-09-10Resolve bad cast to CJS_EventHandlerfoxit
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 .
2015-09-09Remove existing generated images before running a test.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1314443007 .
2015-09-09Fix heap use after free in CPDFSDK_Annot::GetPDFAnnot.Tom Sepez
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 .
2015-09-09Test files for issue 507316Tom Sepez
Upload pdf test files for codereview 1312313006. BUG=507316 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1325533004 .