summaryrefslogtreecommitdiff
path: root/fxjs/cjs_v8.h
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/cjs_v8.h
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/cjs_v8.h')
-rw-r--r--fxjs/cjs_v8.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/fxjs/cjs_v8.h b/fxjs/cjs_v8.h
index 9060f019ab..b79d236670 100644
--- a/fxjs/cjs_v8.h
+++ b/fxjs/cjs_v8.h
@@ -17,6 +17,10 @@
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/widestring.h"
+#ifdef PDF_ENABLE_XFA
+class CXFA_Object;
+#endif // PDF_ENABLE_XFA
+
class CJS_V8 {
public:
explicit CJS_V8(v8::Isolate* pIsolate);
@@ -42,9 +46,16 @@ class CJS_V8 {
bool ToBoolean(v8::Local<v8::Value> pValue);
double ToDouble(v8::Local<v8::Value> pValue);
WideString ToWideString(v8::Local<v8::Value> pValue);
+ ByteString ToByteString(v8::Local<v8::Value> pValue);
v8::Local<v8::Object> ToObject(v8::Local<v8::Value> pValue);
v8::Local<v8::Array> ToArray(v8::Local<v8::Value> pValue);
+#ifdef PDF_ENABLE_XFA
+ CXFA_Object* ToXFAObject(v8::Local<v8::Value> obj);
+ v8::Local<v8::Value> NewXFAObject(CXFA_Object* obj,
+ v8::Global<v8::FunctionTemplate>& tmpl);
+#endif // PDF_ENABLE_XFA
+
// Arrays.
unsigned GetArrayLength(v8::Local<v8::Array> pArray);
v8::Local<v8::Value> GetArrayElement(v8::Local<v8::Array> pArray,