summaryrefslogtreecommitdiff
path: root/fxjs/cfxjse_formcalc_context.h
AgeCommit message (Collapse)Author
2018-08-07Remove WideString::Format() from ThrowException() methods.chromium/3516Tom Sepez
No need for variadic printf-like functions, since callers can cobble arguments into a string much more simply. Change-Id: I0e8d6f6a55a3715ef9d5c6940b73ce8bb2220a1a Reviewed-on: https://pdfium-review.googlesource.com/39611 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-08-02Simplify CFXJSE_FormCalcContext::unfoldArgs().Lei Zhang
Return results instead of writing them to an out parameter. Remove start index which is always 1. Change-Id: I4b969a1e27679fca56b2cde1a901a8967c7fa8ce Reviewed-on: https://pdfium-review.googlesource.com/39092 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-08-01Encapsulate some public static methods in CFXJSE_FormCalcContext.Lei Zhang
They are only used inside CFXJSE_FormCalcContext. Move into an anonymous namespace. Change-Id: Ib8a0ff9b90cf951459c04655bedada3bdb1979a4 Reviewed-on: https://pdfium-review.googlesource.com/39090 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-07-23Replace CFXJSE_HostObject::type_ with polymorphic conversion methodsTom Sepez
More foolproof technique, and saves one word in every instance at a cost of two pointers in every subclass vtable. Change-Id: Ied4f91d4d203b5e6d83abe751159eb7e55489bb5 Reviewed-on: https://pdfium-review.googlesource.com/38530 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-07-16Use UnownedPtr<> to v8::Isolates.Tom Sepez
Isolates are long-lived, but this may catch a few things. Introduce CFX_V8IsolateDeleter for unique_ptr<v8::Isolate> usage. Fix Dispose()/SetIsolate(nullptr) ordering in cjs_runtime.cpp Remove one unused isolate member. Flip protected -> private in one place. Change-Id: I26cdd120f799192e93b0d9d04dcde8f348dc21f3 Reviewed-on: https://pdfium-review.googlesource.com/37931 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-12-04Cleanup ResolveObjects params and returnDan Sinclair
The return value of ResolveObjects is always used as a boolean, so change from int32_t. The XFA_RESOLVENODE_RS object was made a pointer from a ref. Change-Id: I030036c01101680e36f4ddf524b468354a2e6850 Reviewed-on: https://pdfium-review.googlesource.com/20331 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-06Call CJX methods directly instead of proxyingDan Sinclair
This CL updates the XFA JS code to call the methods on the CJX objects directly instead of proxying through the CXFA objects. The script methods have been removed from the CXFA objects. Change-Id: I2d7b502473a8e88a7af88b10aa0da602d4998394 Reviewed-on: https://pdfium-review.googlesource.com/17851 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-01Move some XFA JS code into fxjs/Dan Sinclair
This CL renames cxfa_scriptcontext to cfxjse_engine and cxfa_fm2jscontext to cfxjse_formcalc_context. From reading the code, the script context appears to handle the v8 setup and object code. The formcalc context code is related to handling the JS code generated from the transpiler. I, think, these new names make the intended usage clearer. They also move the code into fxjs/ to keep along side the rest of the JS code. Change-Id: I50619fbe48ca1f553a44cf0e0cb0210be8e45e4f Reviewed-on: https://pdfium-review.googlesource.com/17130 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>