diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-02-01 19:23:03 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-01 19:23:03 +0000 |
commit | fb25606e584e14d60fc243e8b56eef399a4a54bd (patch) | |
tree | 4b7feb8bc4e4bd0201b50d51ef51805bd2db21c5 /fxjs | |
parent | e899dd7d820ec1ab7cb27bfd23dbe0a09ec3a0c3 (diff) | |
download | pdfium-fb25606e584e14d60fc243e8b56eef399a4a54bd.tar.xz |
Make FXJSE_Engine constructed from FXJS_Engine.
No change in functionality yet, just passing higher level object.
Precursor to maybe sharing v8 context between fxjs / fxjse.
Mark unimplemented ctors / assignment operator as "delete".
Change-Id: I100de7755909eec2eed96f6f51216d85923ffbb2
Reviewed-on: https://pdfium-review.googlesource.com/25050
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs')
-rw-r--r-- | fxjs/cfxjse_context.h | 5 | ||||
-rw-r--r-- | fxjs/cfxjse_engine.cpp | 8 | ||||
-rw-r--r-- | fxjs/cfxjse_engine.h | 5 |
3 files changed, 10 insertions, 8 deletions
diff --git a/fxjs/cfxjse_context.h b/fxjs/cfxjse_context.h index 48816eb629..c6949fc850 100644 --- a/fxjs/cfxjse_context.h +++ b/fxjs/cfxjse_context.h @@ -40,9 +40,8 @@ class CFXJSE_Context { protected: friend class CFXJSE_ScopeUtil_IsolateHandleContext; - CFXJSE_Context(); - CFXJSE_Context(const CFXJSE_Context&); - CFXJSE_Context& operator=(const CFXJSE_Context&); + CFXJSE_Context(const CFXJSE_Context&) = delete; + CFXJSE_Context& operator=(const CFXJSE_Context&) = delete; v8::Global<v8::Context> m_hContext; v8::Isolate* m_pIsolate; diff --git a/fxjs/cfxjse_engine.cpp b/fxjs/cfxjse_engine.cpp index 325895f566..6b3ea1014d 100644 --- a/fxjs/cfxjse_engine.cpp +++ b/fxjs/cfxjse_engine.cpp @@ -14,6 +14,7 @@ #include "fxjs/cfxjse_class.h" #include "fxjs/cfxjse_resolveprocessor.h" #include "fxjs/cfxjse_value.h" +#include "fxjs/fxjs_v8.h" #include "third_party/base/ptr_util.h" #include "third_party/base/stl_util.h" #include "xfa/fxfa/cxfa_eventparam.h" @@ -91,10 +92,11 @@ CXFA_Object* CFXJSE_Engine::ToObject(CFXJSE_Value* pValue, return static_cast<CXFA_Object*>(pHostObj); } -CFXJSE_Engine::CFXJSE_Engine(CXFA_Document* pDocument, v8::Isolate* pIsolate) - : CJS_V8(pIsolate), +CFXJSE_Engine::CFXJSE_Engine(CXFA_Document* pDocument, + CFXJS_Engine* fxjs_engine) + : CJS_V8(fxjs_engine->GetIsolate()), m_pDocument(pDocument), - m_JsContext(CFXJSE_Context::Create(pIsolate, + m_JsContext(CFXJSE_Context::Create(fxjs_engine->GetIsolate(), &GlobalClassDescriptor, pDocument->GetRoot())), m_pJsClass(nullptr), diff --git a/fxjs/cfxjse_engine.h b/fxjs/cfxjse_engine.h index 0b360bdbb2..1fcbc5eacb 100644 --- a/fxjs/cfxjse_engine.h +++ b/fxjs/cfxjse_engine.h @@ -20,8 +20,9 @@ #define XFA_RESOLVENODE_TagName 0x0002 -class CXFA_List; class CFXJSE_ResolveProcessor; +class CFXJS_Engine; +class CXFA_List; class CFXJSE_Engine : public CJS_V8 { public: @@ -49,7 +50,7 @@ class CFXJSE_Engine : public CJS_V8 { const ByteStringView& szPropName, bool bQueryIn); - explicit CFXJSE_Engine(CXFA_Document* pDocument, v8::Isolate* pIsolate); + CFXJSE_Engine(CXFA_Document* pDocument, CFXJS_Engine* fxjs_engine); ~CFXJSE_Engine() override; void SetEventParam(CXFA_EventParam param) { m_eventParam = param; } |