diff options
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r-- | fpdfsdk/src/javascript/JS_Runtime.cpp | 6 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/global.cpp | 11 |
2 files changed, 6 insertions, 11 deletions
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp index f3d7cf3972..9450a6400a 100644 --- a/fpdfsdk/src/javascript/JS_Runtime.cpp +++ b/fpdfsdk/src/javascript/JS_Runtime.cpp @@ -114,8 +114,8 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp) : m_bRegistered(FALSE), m_pFieldEventPath(NULL) { - if (FPDFXFA_GetApp()->GetJSERuntime()) { - m_isolate = (v8::Isolate*)FPDFXFA_GetApp()->GetJSERuntime(); + if (CPDFXFA_App::GetInstance()->GetJSERuntime()) { + m_isolate = (v8::Isolate*)CPDFXFA_App::GetInstance()->GetJSERuntime(); } else { m_pArrayBufferAllocator.reset(new CJS_ArrayBufferAllocator()); v8::Isolate::CreateParams params; @@ -127,7 +127,7 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp) : v8::Isolate::Scope isolate_scope(isolate); v8::Locker locker(isolate); v8::HandleScope handle_scope(isolate); - if (FPDFXFA_GetApp()->InitRuntime(FALSE)) { + if (CPDFXFA_App::GetInstance()->InitRuntime(FALSE)) { CJS_Context * pContext = (CJS_Context*)NewContext(); JS_InitialRuntime(*this, this, pContext, m_context); ReleaseContext(pContext); diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp index daf5a85ffe..f139380b20 100644 --- a/fpdfsdk/src/javascript/global.cpp +++ b/fpdfsdk/src/javascript/global.cpp @@ -119,22 +119,17 @@ global_alternate::global_alternate(CJS_Object* pJSObject) global_alternate::~global_alternate(void) { ASSERT(m_pApp != NULL); - -// CommitGlobalPersisitentVariables(); DestroyGlobalPersisitentVariables(); - CJS_RuntimeFactory* pFactory = FPDFXFA_GetApp()->GetRuntimeFactory(); - ASSERT(pFactory); - + CJS_RuntimeFactory* pFactory = CPDFXFA_App::GetInstance()->GetRuntimeFactory(); pFactory->ReleaseGlobalData(); } - + void global_alternate::Initial(CPDFDoc_Environment* pApp) { m_pApp = pApp; - CJS_RuntimeFactory* pFactory = FPDFXFA_GetApp()->GetRuntimeFactory(); - ASSERT(pFactory); + CJS_RuntimeFactory* pFactory = CPDFXFA_App::GetInstance()->GetRuntimeFactory(); m_pGlobalData = pFactory->NewGlobalData(pApp); UpdateGlobalPersistentVariables(); } |