diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-02-08 21:01:01 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-08 21:01:01 +0000 |
commit | 3645652fb6cad1f94c9647f033a8e300bc37d521 (patch) | |
tree | 136dd8524455efdc4bbc32eed7914d3a3b5376e0 /fxjs/cjs_v8.cpp | |
parent | 3c62d20a385d31315a392206de53c9fe72a08db1 (diff) | |
download | pdfium-3645652fb6cad1f94c9647f033a8e300bc37d521.tar.xz |
Move XFA-specific methods out of CJS_V8.
These belong more properly in CFXJS_Engine, and a small amount of
casting is required to get to the sub-class.
Change-Id: Id954d182b7a7d51fe0a522c04a50a1b362746c72
Reviewed-on: https://pdfium-review.googlesource.com/26050
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjs_v8.cpp')
-rw-r--r-- | fxjs/cjs_v8.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/fxjs/cjs_v8.cpp b/fxjs/cjs_v8.cpp index 0a1674076d..e6948a37cf 100644 --- a/fxjs/cjs_v8.cpp +++ b/fxjs/cjs_v8.cpp @@ -6,11 +6,6 @@ #include "fxjs/cjs_v8.h" -#ifdef PDF_ENABLE_XFA -#include "fxjs/cfxjse_context.h" -#include "xfa/fxfa/parser/cxfa_object.h" -#endif // PDF_ENABLE_XFA - CJS_V8::CJS_V8(v8::Isolate* isolate) : m_isolate(isolate) {} CJS_V8::~CJS_V8() = default; @@ -199,29 +194,3 @@ v8::Local<v8::Array> CJS_V8::ToArray(v8::Local<v8::Value> pValue) { v8::Local<v8::Context> context = m_isolate->GetCurrentContext(); return v8::Local<v8::Array>::Cast(pValue->ToObject(context).ToLocalChecked()); } - -#ifdef PDF_ENABLE_XFA -CXFA_Object* CJS_V8::ToXFAObject(v8::Local<v8::Value> obj) { - ASSERT(!obj.IsEmpty()); - - if (!obj->IsObject()) - return nullptr; - - CFXJSE_HostObject* hostObj = - FXJSE_RetrieveObjectBinding(obj.As<v8::Object>(), nullptr); - if (!hostObj || hostObj->type() != CFXJSE_HostObject::kXFA) - return nullptr; - return static_cast<CXFA_Object*>(hostObj); -} - -v8::Local<v8::Value> CJS_V8::NewXFAObject( - CXFA_Object* obj, - v8::Global<v8::FunctionTemplate>& tmpl) { - v8::EscapableHandleScope scope(m_isolate); - v8::Local<v8::FunctionTemplate> klass = - v8::Local<v8::FunctionTemplate>::New(m_isolate, tmpl); - v8::Local<v8::Object> object = klass->InstanceTemplate()->NewInstance(); - FXJSE_UpdateObjectBinding(object, obj); - return scope.Escape(object); -} -#endif // PDF_ENABLE_XFA |