From e9f7db9dbb2c5b9d1953c6643e1c38f82130f98b Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 5 Jun 2018 18:24:12 +0000 Subject: [xfa] Make the event context available when calling back in XFA When calling into the XFA JS engine with a request for a non-XFA JS call which accesses the EventContext we would get a crash in XFA as we never set the context. This CL changes the XFA code to accept the CJS_Runtime instead of the CFXJS_Engine and then calls NewEventContext before executing JS scripts. This will correctly setup the event context as needed for any JS callbacks. Bug: pdfium:1003 Change-Id: Icf202252b2e6e56afdf0d1766a32a893935a2fd3 Reviewed-on: https://pdfium-review.googlesource.com/33930 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_document.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_document.cpp') diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp index 5c4b55776a..a24bf2014f 100644 --- a/xfa/fxfa/parser/cxfa_document.cpp +++ b/xfa/fxfa/parser/cxfa_document.cpp @@ -1435,9 +1435,9 @@ CXFA_LocaleMgr* CXFA_Document::GetLocalMgr() { return m_pLocalMgr.get(); } -CFXJSE_Engine* CXFA_Document::InitScriptContext(CFXJS_Engine* fxjs_engine) { +CFXJSE_Engine* CXFA_Document::InitScriptContext(CJS_Runtime* fxjs_runtime) { ASSERT(!m_pScriptContext); - m_pScriptContext = pdfium::MakeUnique(this, fxjs_engine); + m_pScriptContext = pdfium::MakeUnique(this, fxjs_runtime); return m_pScriptContext.get(); } -- cgit v1.2.3