summaryrefslogtreecommitdiff
path: root/fxjs/cjx_signaturepseudomodel.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-07 22:33:43 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-07 22:33:43 +0000
commit93bb725b62f9779534c9444c1e1319fe8c28912e (patch)
treeaf0c758c1129dc076cbf67a89f1c23e4703e02bd /fxjs/cjx_signaturepseudomodel.cpp
parentce6979f8d064507300fe0b3a856687fb958c9a5c (diff)
downloadpdfium-chromium/3288.tar.xz
[xfa] Move JS method information to files.chromium/3288
This CL moves the XFA SOM JS Method information out of the c-array and into individual CJX class files. Change-Id: I401046a06aacaf1f04e5a51eb899e479de012e15 Reviewed-on: https://pdfium-review.googlesource.com/20450 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/cjx_signaturepseudomodel.cpp')
-rw-r--r--fxjs/cjx_signaturepseudomodel.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/fxjs/cjx_signaturepseudomodel.cpp b/fxjs/cjx_signaturepseudomodel.cpp
index 76cf989b7f..b50e5dc9ab 100644
--- a/fxjs/cjx_signaturepseudomodel.cpp
+++ b/fxjs/cjx_signaturepseudomodel.cpp
@@ -10,13 +10,22 @@
#include "fxjs/cfxjse_value.h"
#include "xfa/fxfa/parser/cscript_signaturepseudomodel.h"
+const CJX_MethodSpec CJX_SignaturePseudoModel::MethodSpecs[] = {
+ {"verify", verifySignature_static},
+ {"sign", sign_static},
+ {"enumerate", enumerate_static},
+ {"clear", clear_static},
+ {"", nullptr}};
+
CJX_SignaturePseudoModel::CJX_SignaturePseudoModel(
CScript_SignaturePseudoModel* model)
- : CJX_Object(model) {}
+ : CJX_Object(model) {
+ DefineMethods(MethodSpecs);
+}
CJX_SignaturePseudoModel::~CJX_SignaturePseudoModel() {}
-void CJX_SignaturePseudoModel::Verify(CFXJSE_Arguments* pArguments) {
+void CJX_SignaturePseudoModel::verifySignature(CFXJSE_Arguments* pArguments) {
int32_t iLength = pArguments->GetLength();
if (iLength < 1 || iLength > 4) {
ThrowParamCountMismatchException(L"verify");
@@ -28,7 +37,7 @@ void CJX_SignaturePseudoModel::Verify(CFXJSE_Arguments* pArguments) {
pValue->SetInteger(0);
}
-void CJX_SignaturePseudoModel::Sign(CFXJSE_Arguments* pArguments) {
+void CJX_SignaturePseudoModel::sign(CFXJSE_Arguments* pArguments) {
int32_t iLength = pArguments->GetLength();
if (iLength < 3 || iLength > 7) {
ThrowParamCountMismatchException(L"sign");
@@ -40,7 +49,7 @@ void CJX_SignaturePseudoModel::Sign(CFXJSE_Arguments* pArguments) {
pValue->SetBoolean(false);
}
-void CJX_SignaturePseudoModel::Enumerate(CFXJSE_Arguments* pArguments) {
+void CJX_SignaturePseudoModel::enumerate(CFXJSE_Arguments* pArguments) {
if (pArguments->GetLength() != 0) {
ThrowParamCountMismatchException(L"enumerate");
return;
@@ -48,7 +57,7 @@ void CJX_SignaturePseudoModel::Enumerate(CFXJSE_Arguments* pArguments) {
return;
}
-void CJX_SignaturePseudoModel::Clear(CFXJSE_Arguments* pArguments) {
+void CJX_SignaturePseudoModel::clear(CFXJSE_Arguments* pArguments) {
int32_t iLength = pArguments->GetLength();
if (iLength < 1 || iLength > 2) {
ThrowParamCountMismatchException(L"clear");