diff options
-rw-r--r-- | fpdfsdk/fpdfxfa/cpdfxfa_context.cpp | 2 | ||||
-rw-r--r-- | fxjs/cfxjse_context.h | 5 | ||||
-rw-r--r-- | fxjs/cfxjse_engine.cpp | 8 | ||||
-rw-r--r-- | fxjs/cfxjse_engine.h | 5 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_document.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_document.h | 7 |
6 files changed, 17 insertions, 14 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp index 784344f1c6..9f07714d04 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp @@ -104,7 +104,7 @@ bool CPDFXFA_Context::LoadXFADoc() { return false; } m_pXFADoc->StopLoad(); - m_pXFADoc->GetXFADoc()->InitScriptContext(GetCJSRuntime()->GetIsolate()); + m_pXFADoc->GetXFADoc()->InitScriptContext(GetCJSRuntime()); if (m_pXFADoc->GetFormType() == FormType::kXFAFull) m_FormType = FormType::kXFAFull; 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; } diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp index 0675e35358..434d6cbfde 100644 --- a/xfa/fxfa/parser/cxfa_document.cpp +++ b/xfa/fxfa/parser/cxfa_document.cpp @@ -286,9 +286,9 @@ CXFA_LocaleMgr* CXFA_Document::GetLocalMgr() { return m_pLocalMgr.get(); } -CFXJSE_Engine* CXFA_Document::InitScriptContext(v8::Isolate* pIsolate) { +CFXJSE_Engine* CXFA_Document::InitScriptContext(CFXJS_Engine* fxjs_engine) { ASSERT(!m_pScriptContext); - m_pScriptContext = pdfium::MakeUnique<CFXJSE_Engine>(this, pIsolate); + m_pScriptContext = pdfium::MakeUnique<CFXJSE_Engine>(this, fxjs_engine); return m_pScriptContext.get(); } diff --git a/xfa/fxfa/parser/cxfa_document.h b/xfa/fxfa/parser/cxfa_document.h index bd576e68a5..f12148bee4 100644 --- a/xfa/fxfa/parser/cxfa_document.h +++ b/xfa/fxfa/parser/cxfa_document.h @@ -40,13 +40,14 @@ enum XFA_DocFlag { XFA_DOCFLAG_Scripting = 0x0008 }; -class CFX_XMLDoc; class CFXJSE_Engine; +class CFXJS_Engine; +class CFX_XMLDoc; class CScript_DataWindow; class CScript_EventPseudoModel; class CScript_HostPseudoModel; -class CScript_LogPseudoModel; class CScript_LayoutPseudoModel; +class CScript_LogPseudoModel; class CScript_SignaturePseudoModel; class CXFA_ContainerLayoutItem; class CXFA_DocumentParser; @@ -61,7 +62,7 @@ class CXFA_Document { explicit CXFA_Document(CXFA_DocumentParser* pParser); ~CXFA_Document(); - CFXJSE_Engine* InitScriptContext(v8::Isolate* pIsolate); + CFXJSE_Engine* InitScriptContext(CFXJS_Engine* fxjs_engine); CXFA_Node* GetRoot() const { return m_pRootNode; } |