summaryrefslogtreecommitdiff
path: root/fxjs/cjx_eventpseudomodel.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-11 22:01:08 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-11 22:01:08 +0000
commitcb22f9ad9265f40b1104ed2b09488ccc6ec9e5aa (patch)
tree4aaa14dfb0528268fb9a9a94a4cac82df1af4602 /fxjs/cjx_eventpseudomodel.cpp
parent731526e3b9f32ceac1cdac600fe3ecd55a0bc9b5 (diff)
downloadpdfium-cb22f9ad9265f40b1104ed2b09488ccc6ec9e5aa.tar.xz
[xfa] Refactor CJX method signatures.
This CL changes the CJX methods from void (*)(CFXJSE_Arguments*) to CJS_Return (*)(CJS_V8* runtime, const std::vector<v8::Local<v8::Value>>& params) which is closer to how CJS works in practice. Change-Id: I3a3129268acfe4262dfeb04179919ed19f6c24e1 Reviewed-on: https://pdfium-review.googlesource.com/20491 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjx_eventpseudomodel.cpp')
-rw-r--r--fxjs/cjx_eventpseudomodel.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/fxjs/cjx_eventpseudomodel.cpp b/fxjs/cjx_eventpseudomodel.cpp
index f78890bc9f..092d39fa28 100644
--- a/fxjs/cjx_eventpseudomodel.cpp
+++ b/fxjs/cjx_eventpseudomodel.cpp
@@ -6,7 +6,8 @@
#include "fxjs/cjx_eventpseudomodel.h"
-#include "fxjs/cfxjse_arguments.h"
+#include <vector>
+
#include "fxjs/cfxjse_engine.h"
#include "fxjs/cfxjse_value.h"
#include "xfa/fxfa/cxfa_eventparam.h"
@@ -150,36 +151,42 @@ void CJX_EventPseudoModel::Target(CFXJSE_Value* pValue,
Property(pValue, XFA_Event::Target, bSetting);
}
-void CJX_EventPseudoModel::emit(CFXJSE_Arguments* pArguments) {
+CJS_Return CJX_EventPseudoModel::emit(
+ CJS_V8* runtime,
+ const std::vector<v8::Local<v8::Value>>& params) {
CFXJSE_Engine* pScriptContext = GetDocument()->GetScriptContext();
if (!pScriptContext)
- return;
+ return CJS_Return(true);
CXFA_EventParam* pEventParam = pScriptContext->GetEventParam();
if (!pEventParam)
- return;
+ return CJS_Return(true);
CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
if (!pNotify)
- return;
+ return CJS_Return(true);
CXFA_FFWidgetHandler* pWidgetHandler = pNotify->GetWidgetHandler();
if (!pWidgetHandler)
- return;
+ return CJS_Return(true);
pWidgetHandler->ProcessEvent(pEventParam->m_pTarget, pEventParam);
+ return CJS_Return(true);
}
-void CJX_EventPseudoModel::reset(CFXJSE_Arguments* pArguments) {
+CJS_Return CJX_EventPseudoModel::reset(
+ CJS_V8* runtime,
+ const std::vector<v8::Local<v8::Value>>& params) {
CFXJSE_Engine* pScriptContext = GetDocument()->GetScriptContext();
if (!pScriptContext)
- return;
+ return CJS_Return(true);
CXFA_EventParam* pEventParam = pScriptContext->GetEventParam();
if (!pEventParam)
- return;
+ return CJS_Return(true);
pEventParam->Reset();
+ return CJS_Return(true);
}
void CJX_EventPseudoModel::Property(CFXJSE_Value* pValue,