summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript
AgeCommit message (Collapse)Author
2015-09-08Beef up app_props.in and tidy app.cpp.Tom Sepez
Some of the values returned are dubious; capture the current state of affairs. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1317393003 .
2015-09-08Change the JS app.viewerType() return value to "pdfium"Lei Zhang
BUG=pdfium:181 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1331633002 .
2015-08-31CJS_Context::compile unusedTom Sepez
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 .
2015-08-31Fix two issues shown by bug 489995Tom Sepez
- 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 .
2015-08-19Extern in .cpp files is a code smell.Tom Sepez
Part 1. Move to headers so compiler can type check against the definitions. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1299963002 .
2015-08-17CFX_MapByteStringToPtr considered harmful.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1297723002 .
2015-08-17Fix more sign comparison errors.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1290383003 .
2015-08-17js_global_data and global_alternate violate naming rules.Tom Sepez
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 .
2015-08-14Use override in more classes in fpdfsdk/Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1287193005 .
2015-08-13Tidy up JS_Object.h and JS_Object.cpp.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1293673003 .
2015-08-13Kill JS_TIMER_MAPARRAYTom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1286383004 .
2015-08-13Remove if checks after new.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1287863002 .
2015-08-11Fix some sign comparison warnings.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1279493003 .
2015-08-06clang-format all pdfium code, again.Nico Weber
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 .
2015-08-05Don't dispose the isolate if its provided by the embedderchromium/2474Jochen Eisinger
BUG=chromium:515718 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1269783005 .
2015-08-04Remove stringify macro (#) from JS_STATIC_CONST_ENTRY_*.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1256283005 .
2015-08-04Quick fix in Consts.cpp to make tests pass after the clang-format CL.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1269223002 .
2015-08-04clang-format all pdfium code.Nico Weber
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 See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1265503005 .
2015-07-27Revert "FX Bool considered harmful, part 3"Tom Sepez
This reverts commit ff46aaf499edcf153ee2f57c7016587aa96dcfa0. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1255293002 .
2015-07-27FX Bool considered harmful, part 3Tom Sepez
Try to reland this patch after fixing underlying issues that caused it to be reverted. fx_system.h is the only manual edit. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1258093002 .
2015-07-23document.delay and document.external are boolean properties.Tom Sepez
This is the javascript test failure at 320b2313d198. The spec says they are booleans, not ints, so correct the behaviour now. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1242263010 .
2015-07-23Revert "FX_BOOL considered harmful, part 2."Tom Sepez
This reverts commit 320b2313d19869333ed453af546e61a9fc2b81c9. Reason for revert: build failure. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1255693002 .
2015-07-23FX_BOOL considered harmful, part 2.Tom Sepez
Fully automatic change, execpt for cleanup in fx_system.h R=thestig@chromium.org Review URL: https://codereview.chromium.org/1254703002 .
2015-07-23Fix FX_BOOL type mismatches.Tom Sepez
Extracted from https://codereview.chromium.org/1252613002/ R=thestig@chromium.org Review URL: https://codereview.chromium.org/1253603002 .
2015-07-22Re-land else-after-returnsTom Sepez
Revert "Revert "Fix else-after-returns throughout pdfium."" This reverts commit 4eb4d7f6c707cc2c23c806aa540d055c8832b55d. Fix one naming conflict. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1243953004 .
2015-07-22Revert "Fix else-after-returns throughout pdfium."Tom Sepez
This reverts commit 7cc97521db1e52d5927f5605de5f9a7102f8af40.
2015-07-22Fix else-after-returns throughout pdfium.Tom Sepez
Driven by CS search for pcre:yes file:third_party/pdfium/ -file:pdfium/third_party/ \breturn\b[^;]*;\s*\n*\s*\}*\s*\n*\r*else Note: Care is required to ensure the preceding block is not an else-if. As usual, removed any tabs I saw. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1243883003 .
2015-07-22Remove dead code found by Scythe.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1249643003 .
2015-07-16Cleanup: Do not check pointers before deleting them, part 2.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1195363002 .
2015-07-16Tidy up CPDFDOC_Environment.Tom Sepez
- untabify as encountered. - Only put single-statement method in .h file, move more complex methods to .cpp (counting an if without braces as a single statement, killing braces as needed). - Move invariant arguments to constructor and make corresponding members const. - Make all members private and add accessor methods. - Make existing accessor methods const where possible. - Kill meaningless asserts. - Add helper functions in place of duplicate code. - Rename GetCurrentDoc() to GetSDKDocument(), since the class has two document members, one of CPDF_Document and one of CPDFSDK_Document, making it clear which one you get. - Simplify some logic with early returns. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1235393002 .
2015-07-16Make v8 embedder data slot configurablechromium/2460chromium/2459chromium/2458Jochen Eisinger
Chrome already uses 0 and 1. BUG=none R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1235303003 .
2015-07-15Add missing reinterpret_cast from void to v8::Isolate*Jochen Eisinger
BUG=none TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1241863003 .
2015-07-15Plumb in an externally created v8::IsolateJochen Eisinger
In Chrome, all Isolates must be created by gin R=tsepez@chromium.org, ulan@chromium.org BUG= Review URL: https://codereview.chromium.org/1234053003 .
2015-07-01Fix some clang warnings with -Wmissing-braces in pdfium.Nico Weber
Clang warns if there are missing braces around a subobject initializer. The most common idiom that triggers this is: STRUCT s = {0}; if the first field of STRUCT is itself a struct. This can be more simply written as: STRUCT s = {}; which also prevents the warning from firing. Other instances of the warning have been fixed by adding braces where appropriate. R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1213523004.
2015-06-22Fix Javascript tests after commit f55771af6429.chromium/2445chromium/2444chromium/2443chromium/2442chromium/2441chromium/2440Lei Zhang
- Return true instead of false. All the other unsupported JS functions return true. - Adjust test expectations accordingly. TBR=jam@chromium.org Review URL: https://codereview.chromium.org/1196163006.
2015-06-22Cleanup: Remove more checks for new returning NULL.Lei Zhang
R=jam@chromium.org Review URL: https://codereview.chromium.org/1198903002.
2015-06-22Delete dead code for deleting pages and icons.Lei Zhang
1) Document::deletePages() 2) CPDFSDK_Document::DeletePages() 3) Document::removeIcon() 4) IconTree::DeleteIconElement() Originally (1) called (2), but only when FOXIT_CHROME_BUILD was not defined. Since it was always defined for PDFium, this was effectively dead code the whole time. Ditto for (3) and (4). The functions were deemed unsafe in https://crbug.com/67100 R=jam@chromium.org Review URL: https://codereview.chromium.org/1193323002.
2015-06-19Cleanup: Do not check pointers before deleting them.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1192743004.
2015-06-15Do some IWYU cleanups.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1176333002.
2015-06-15Remove some dead code.Lei Zhang
Review URL: https://codereview.chromium.org/1186673005.
2015-06-11Remove trailing whitespaces in fpdfsdk.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1173343004.
2015-06-11Cleanup: Get this rid of "this->" in fpdfsdk/Lei Zhang
Also remove commented out code and trailing whitespaces. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1179653005.
2015-06-10Cleanup: Remove CFFL_IFormFiller::GetCommitKey() that always returns 0.Lei Zhang
Remove callers and related code that all just pass zeros around. Also remove CFFL_IFormFiller::GetKeyDown(). R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1149623012.
2015-06-10Remove typdefs for pointer types in fx_system.h.Tom Sepez
This involves fixing some multiple variable per line declarations, as the textually-substituted "*" applies only to the first one. This involves moving some consts around following the substitution. This involves replacing some typedefs used as constructors with better code. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1171733003
2015-06-09Use stdint.h types throughout PDFium.Tom Sepez
It's redundant nowadays to provide our own equivalents, now that this is done for us by the system header. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1177483002
2015-06-02Fix heap use after free in Document::DoFieldDelay and Document::delayTom Sepez
This fix removes CJS_DelayData object from m_DelayData array and copies them to a new array, before processing them. So contents of m_DelayData array cannot be used after they get freed. BUG=487928 R=tsepez@chromium.org TEST= Chrome pdf plugin should not crash when poc_stable,testuafdocument1.pdf and testuafdocument2.pdf are viewed. see crbug.com/487928 and crbug.com/487928#c18 for more details. Review URL: https://codereview.chromium.org/1163823002
2015-05-19Replace v8::Handle with v8::Local and v8::Persistent with v8::GlobalJochen Eisinger
those types are just aliases, and we should consistently use the new version R=tsepez@chromium.org BUG= Review URL: https://codereview.chromium.org/1138823004
2015-05-17Replace deprecated with non-deprecated V8 APIsJochen Eisinger
In most cases, we just CHECK() that no exception was thrown. Previously, we'd just crash. Ideally, this should all be fixed and the system should cope with those exceptions, but that's beyond this CL. R=tsepez@chromium.org BUG= Review URL: https://codereview.chromium.org/1126203010
2015-05-14Fix another batch of compiler warnings.Lei Zhang
Also fix typos and remove trailing spaces/tabs. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1141123002
2015-05-14Use phantom handles instead of weak handlesJochen Eisinger
Phantom handles allow for freeing objects with one pass of GC. However, this means that by the time the callback is invoked, the v8 object already does no longer exist. To avoid accidential access to the dead object, there are now two callbacks, where the first must only reset the handle, and the second does the clean-up work. R=tsepez@chromium.org BUG= Review URL: https://codereview.chromium.org/1129253004