summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/JS_Value.h
AgeCommit message (Collapse)Author
2017-10-30Move JS_Value into JS_DefineDan Sinclair
This CL moves CJS_Return to its own files and moves the remaining function definitions from JS_Value to JS_Define. Change-Id: Ic7058a02330153f22d1fff9fc6cdebd9167c498b Reviewed-on: https://pdfium-review.googlesource.com/17038 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-10-26Remove CJS_ArrayDan Sinclair
This CL removes the CJS_Array wrapper and uses the v8 objects directly. Change-Id: I904f76e59e27d65db4b4d0bbd503fddb3e8cfc6f Reviewed-on: https://pdfium-review.googlesource.com/16830 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-25Remove CJS_DateDan Sinclair
This CL removes the CJS_Date class and uses the v8::Local<v8::Date> directly. Change-Id: I4a59b0076bc0e5dc3142b36bd7125115605d416f Reviewed-on: https://pdfium-review.googlesource.com/16811 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-10-25Remove methods from CJS_DateDan Sinclair
This CL converts CJS_Date to a thin wrapper around a v8::Local<v8::Date>. Change-Id: I1510ae5ff7757677e4fe18deac4593cc75493c1b Reviewed-on: https://pdfium-review.googlesource.com/16810 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-10-25Remove CJS_ValueDan Sinclair
Not used anywhere, Removed. Change-Id: Idbdbe36e34fe97deceeb68601b0ceee31f4fdc35 Reviewed-on: https://pdfium-review.googlesource.com/16770 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-25Refactor JS method parameters and return values.Dan Sinclair
This CL removes the out parameters from the JS methods and changes the return from a |bool| to a |CJS_Return| value. The return value holds the returned v8 object, error string and a status code. Change-Id: I82488ff0d916475d7e3c8e51ed868639806181c9 Reviewed-on: https://pdfium-review.googlesource.com/16751 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-25Convert JS input params to v8::Local<v8::Value>>sdan sinclair
This CL converts the JS set_* methods and the JSMethod methods to accept v8::Local<v8::Value> objects instead of CJS_Value objects. Change-Id: I6de41305deff458eba515bdc3462522b502f74ad Reviewed-on: https://pdfium-review.googlesource.com/16670 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-24Move MaybeCoerceToNumber to CJS_RuntimeDan Sinclair
This CL moves MaybeCoerceToNumber from CJS_Value to CJS_Runtime. Change-Id: I22bb605045daa63f405ef256e4b8a5c7ffb78425 Reviewed-on: https://pdfium-review.googlesource.com/16617 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-10-24Remove IsArrayObject and IsDateObject methodsDan Sinclair
This CL removes the IsArrayObject and IsDateObject methods and asks the v8 objects directly. Change-Id: I4e2b957dbdfcddb426270f72666fce83854d92e0 Reviewed-on: https://pdfium-review.googlesource.com/16616 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-10-24Remove GetType from CJS_ValueDan Sinclair
This CL removes the GetType method from CJS_Value and, instead, retrieves the value from the v8 object directly. Change-Id: Ia8390f3ead163c09a39cae493e75fccdd41a0961 Reviewed-on: https://pdfium-review.googlesource.com/16615 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-24Remove the CJS_Value To* methods.Dan Sinclair
This CL removes all of the To* methods on the CJS classes except for ToV8Value. Change-Id: If01263c8cfa557ef7b00f573ddbf68b591d5ae9a Reviewed-on: https://pdfium-review.googlesource.com/16614 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-24Remove CJS_Value constructorsDan Sinclair
This CL removes most of the CJS_Value constructors and leaves the v8::Local<v8::Value> constructor as the only non-default construtor. Change-Id: Ie98260d10eff645d0ca688b353e7d40ba1aac157 Reviewed-on: https://pdfium-review.googlesource.com/16611 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-24Remove most CJS_Value Set methodsDan Sinclair
This CL removes all of the Set(*) methods from CJS_Value except for Set(v8::Local<v8::Value>). All uses of Set are changed to convert to a v8::Value before setting. Change-Id: I6e4d2cebec42fce5c039dc0a3abe46086cfdd34f Reviewed-on: https://pdfium-review.googlesource.com/16610 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-23Remove CJS_PropValueDan Sinclair
This CL removes the CJS_PropValue class and uses CJS_Value directly. The various Set methods have been moved to CJS_Value and the runtime provided as needed. Change-Id: Ib5d3b9efc9b6cf8182be8f19af98599379c3d7db Reviewed-on: https://pdfium-review.googlesource.com/16431 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-10-23Cleanup CJS_Valuechromium/3248Dan Sinclair
This CL removes unused methods; renames Attach to Set and generally cleans up the CJS_Value classes. Change-Id: I858082100908f3bc51f4b58c11ceda3357fadc70 Reviewed-on: https://pdfium-review.googlesource.com/16430 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-19Refactoring JS Callbacks.dan sinclair
This CL updates the fpdfsdk/javascript callbacks to have explicit get/set methods instead of one method which worked differently depending on the mode. This allows better ownership of the passed in params, (get takes a * and set takes a const&). The Value object was changed to have To* and Set methods to make the code clearer compared to the operator<< and operator>> overloading. Bug: Change-Id: Id6ff20a4e3252adfd0a78b643e50b9f095085018 Reviewed-on: https://pdfium-review.googlesource.com/16330 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-21Move CFX_UnownedPtr to UnownedPtrDan Sinclair
This CL moves CFX_UnownedPtr to UnownedPtr and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: I6d1fa463f365e5cb3aafa8c8a7a5f7eff62ed8e0 Reviewed-on: https://pdfium-review.googlesource.com/14620 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-18Convert string class namesRyan Harrison
Automated using git grep & sed. Replace StringC classes with StringView classes. Remove the CFX_ prefix and put string classes in fxcrt namespace. Change AsStringC() to AsStringView(). Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*, Foo). Couple of tests needed to have their names regularlized. BUG=pdfium:894 Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d Reviewed-on: https://pdfium-review.googlesource.com/14151 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-08-31Remove fx_basic.hDan Sinclair
This CL removes the fx_basic.h header and fixes up includes as needed. Change-Id: I49af32a8327bdbcda40c50a61ffbd75d06609040 Reviewed-on: https://pdfium-review.googlesource.com/12670 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-04Remove platform-specific IsFinite, JS_PortIsNan, and GetNan.Tom Sepez
Because C++11 gives us std::isfinite(), std::isnan() and std::nan(). Bug: pdfium:459 Change-Id: I128f332ec908df6aff66ef76012288fd22d423ed Reviewed-on: https://pdfium-review.googlesource.com/10190 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-05-25Mass conversion of all const-lifetime class membersTom Sepez
Sed + minimal conversions to compile, including moving some constructors into the .cpp file. Any that caused ASAN issues during the tests were omitted rather than trying to resolve the underlying issue. Change-Id: I00a421f33b253eb4071ffd9af3f2922c7443b335 Reviewed-on: https://pdfium-review.googlesource.com/5891 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-03-14Replace FX_CHAR and FX_WCHAR with underlying types.Dan Sinclair
Change-Id: I96e0a20d66b9184d22f64d8e4ce0dadd5a78c1e8 Reviewed-on: https://pdfium-review.googlesource.com/2967 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-01-12Custom toString() methods may delete annots.tsepez
In this case, we observe the destruction of the object, but have unfortunately saved a pointer to it in a local variable. BUG=679643 Review-Url: https://codereview.chromium.org/2628233002
2016-09-29Move fxjs/include to fxjsdsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2380713005
2016-09-29Move core/fxcrt/include to core/fxcrtdsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2382723003
2016-08-15Push v8::Isolate into CFXJS_Engine classchromium/2831tsepez
Nearly all the "loose" functions in FXJS become methods on the CFJXS_Engine. This is the "missing link" wrt some layering violatons that have been around forever. We can stop passing &m_ variables from CJS_ down into FXJS Initialization as a result. Review-Url: https://codereview.chromium.org/2245863002
2016-08-10Remove backpointer to CJS_Runtime from CJS_Valuetsepez
Review-Url: https://codereview.chromium.org/2227673005
2016-08-09Remove back-pointer to CJS_Runtime from CJS_Datetsepez
Review-Url: https://codereview.chromium.org/2224113003
2016-08-08Remove backpointer to runtime from CJS_Array.tsepez
This is always available elsewhere, so save the bytes and ease removal of CJS_Array since it now only contains a single v8 local. Review-Url: https://codereview.chromium.org/2217253002
2016-08-05Return v8::Date specialization not v8::Value where possiblechromium/2824chromium/2823chromium/2822chromium/2821tsepez
Also get rid of FXJS_ValueCopy() while we're at it. BUG=pdfium:556 Review-Url: https://codereview.chromium.org/2215093002
2016-07-25Tidy up JS_Value.htsepez
Use ToV8Object() instead of CJS_Value cast operator. Add some missing consts / explicits. Move code into empty namespace. Review-Url: https://codereview.chromium.org/2172813002
2016-07-25Remove unused CJS_Value::Attach() varianttsepez
Review-Url: https://codereview.chromium.org/2174513002
2016-07-15Remove type info from CJS_Value, interrogate v8 insteadtsepez
Review-Url: https://codereview.chromium.org/2154503002
2016-07-12Move fpdfsdk/jsapi into fxjs/dsinclair
This CL moves the fpdfsdk/sjapi code info fxjs/. The "fxjs" library is moved from being XFA specific to being compiled if V8 is enabled. The fxjs_v8 files are required when building for XFA (they have XFA defines in them) and are used in CFXJS_RuntimeData. The cfxjse_* files are only added if XFA is also enabled. Review-Url: https://codereview.chromium.org/2144603003
2016-06-15Make code compile with clang_use_chrome_plugin (part IV)weili
This change mainly contains files in fpdfsdk/ directory. This is part of the efforts to make PDFium code compilable by Clang chromium style plugins. The changes are mainly the following: -- move inline constructor/destructor of complex class/struct out-of-line; -- add constructor/destructor of complex class/struct if not explicitly defined; -- add explicit out-of-line copy constructor when needed; -- move inline virtual functions out-of-line; -- Properly mark virtual functions with 'override'; -- some minor cleanups plus removing an unused file and splitting cxfa_eventparam out from fxfa.h BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2062313002
2016-04-15Pass WideStrings without narrowing to c_str in javascript/tsepez
Avoid string duplication when the caller already has one. Review URL: https://codereview.chromium.org/1883273003
2016-04-06Move code from fpdfsdk/include to the sub directories.dsinclair
This CL moves the fxedit, jsapi and fpdfxfa code out of fpdfsdk/include to the various sub-include directories. Review URL: https://codereview.chromium.org/1863163002
2016-03-23Move core/include/fxcrt to core/fxcrt/include.Dan Sinclair
This CL moves the fxcrt code into the core/fxcrt directory. The only exception was fx_bidi.h which was moved into core/fxcrt as it is not used outside of core/. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1825953002 .
2016-03-14Move fpdfsdk/src up to fpdfsdk/.Dan Sinclair
This CL moves the files in fpdfsdk/src/ up one level to fpdfsdk/ and fixes up the include paths, include guards and build files. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1799773002 .