From cb22f9ad9265f40b1104ed2b09488ccc6ec9e5aa Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 11 Dec 2017 22:01:08 +0000 Subject: [xfa] Refactor CJX method signatures. This CL changes the CJX methods from void (*)(CFXJSE_Arguments*) to CJS_Return (*)(CJS_V8* runtime, const std::vector>& params) which is closer to how CJS works in practice. Change-Id: I3a3129268acfe4262dfeb04179919ed19f6c24e1 Reviewed-on: https://pdfium-review.googlesource.com/20491 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- xfa/fxfa/cxfa_widgetacc.cpp | 2 +- xfa/fxfa/fxfa_basic.h | 10 ---------- xfa/fxfa/parser/cscript_datawindow.cpp | 1 - xfa/fxfa/parser/cscript_eventpseudomodel.cpp | 1 - xfa/fxfa/parser/cscript_hostpseudomodel.cpp | 1 - xfa/fxfa/parser/cscript_layoutpseudomodel.cpp | 1 - xfa/fxfa/parser/cscript_logpseudomodel.cpp | 1 - xfa/fxfa/parser/cscript_signaturepseudomodel.cpp | 1 - 8 files changed, 1 insertion(+), 17 deletions(-) (limited to 'xfa') diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp index ef5904c946..86d1da5ed4 100644 --- a/xfa/fxfa/cxfa_widgetacc.cpp +++ b/xfa/fxfa/cxfa_widgetacc.cpp @@ -607,7 +607,7 @@ std::pair CXFA_WidgetAcc::ExecuteBoolScript( pContext->SetNodesOfRunScript(&refNodes); } - auto pTmpRetValue = pdfium::MakeUnique(pContext->GetRuntime()); + auto pTmpRetValue = pdfium::MakeUnique(pContext->GetIsolate()); ++m_nRecursionDepth; bool bRet = pContext->RunScript(eScriptType, wsExpression.AsStringView(), pTmpRetValue.get(), m_pNode); diff --git a/xfa/fxfa/fxfa_basic.h b/xfa/fxfa/fxfa_basic.h index b5acd2df40..96b483d978 100644 --- a/xfa/fxfa/fxfa_basic.h +++ b/xfa/fxfa/fxfa_basic.h @@ -7,10 +7,8 @@ #ifndef XFA_FXFA_FXFA_BASIC_H_ #define XFA_FXFA_FXFA_BASIC_H_ -#include "fxjs/cfxjse_arguments.h" #include "fxjs/fxjse.h" -class CFXJSE_Arguments; class CJX_Object; class CXFA_Measurement; enum class XFA_ObjectType; @@ -966,14 +964,6 @@ enum class XFA_Unit : uint8_t { Unknown = 255, }; -typedef void (CJX_Object::*XFA_METHOD_CALLBACK)(CFXJSE_Arguments* pArguments); - -struct XFA_METHODINFO { - uint32_t uHash; - const wchar_t* pName; - XFA_METHOD_CALLBACK callback; -}; - typedef void (CJX_Object::*XFA_ATTRIBUTE_CALLBACK)(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute); diff --git a/xfa/fxfa/parser/cscript_datawindow.cpp b/xfa/fxfa/parser/cscript_datawindow.cpp index e8ffdaa114..25ad589fe5 100644 --- a/xfa/fxfa/parser/cscript_datawindow.cpp +++ b/xfa/fxfa/parser/cscript_datawindow.cpp @@ -6,7 +6,6 @@ #include "xfa/fxfa/parser/cscript_datawindow.h" -#include "fxjs/cfxjse_arguments.h" #include "fxjs/cjx_datawindow.h" #include "third_party/base/ptr_util.h" #include "xfa/fxfa/parser/cxfa_document.h" diff --git a/xfa/fxfa/parser/cscript_eventpseudomodel.cpp b/xfa/fxfa/parser/cscript_eventpseudomodel.cpp index c09ba76c47..8f4e049a4f 100644 --- a/xfa/fxfa/parser/cscript_eventpseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_eventpseudomodel.cpp @@ -6,7 +6,6 @@ #include "xfa/fxfa/parser/cscript_eventpseudomodel.h" -#include "fxjs/cfxjse_arguments.h" #include "fxjs/cjx_object.h" #include "third_party/base/ptr_util.h" diff --git a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp index 9ca3828961..8122aa32f7 100644 --- a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp @@ -6,7 +6,6 @@ #include "xfa/fxfa/parser/cscript_hostpseudomodel.h" -#include "fxjs/cfxjse_arguments.h" #include "third_party/base/ptr_util.h" CScript_HostPseudoModel::CScript_HostPseudoModel(CXFA_Document* pDocument) diff --git a/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp b/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp index 675e79531e..73033d5bea 100644 --- a/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp @@ -6,7 +6,6 @@ #include "xfa/fxfa/parser/cscript_layoutpseudomodel.h" -#include "fxjs/cfxjse_arguments.h" #include "third_party/base/ptr_util.h" CScript_LayoutPseudoModel::CScript_LayoutPseudoModel(CXFA_Document* pDocument) diff --git a/xfa/fxfa/parser/cscript_logpseudomodel.cpp b/xfa/fxfa/parser/cscript_logpseudomodel.cpp index 7a9c410aba..1c2d80204c 100644 --- a/xfa/fxfa/parser/cscript_logpseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_logpseudomodel.cpp @@ -6,7 +6,6 @@ #include "xfa/fxfa/parser/cscript_logpseudomodel.h" -#include "fxjs/cfxjse_arguments.h" #include "third_party/base/ptr_util.h" CScript_LogPseudoModel::CScript_LogPseudoModel(CXFA_Document* pDocument) diff --git a/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp b/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp index a8a67429be..c5f4e6425f 100644 --- a/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp @@ -6,7 +6,6 @@ #include "xfa/fxfa/parser/cscript_signaturepseudomodel.h" -#include "fxjs/cfxjse_arguments.h" #include "third_party/base/ptr_util.h" CScript_SignaturePseudoModel::CScript_SignaturePseudoModel( -- cgit v1.2.3