diff options
author | jinming_wang <jinming_wang@foxitsoftware.com> | 2016-02-04 09:41:56 +0800 |
---|---|---|
committer | jinming_wang <jinming_wang@foxitsoftware.com> | 2016-02-04 09:41:56 +0800 |
commit | 486615821300724aef55035f4f831f548fb9cab6 (patch) | |
tree | b5ccf7e0f7425a9039b6ea349a996396bad1cbf5 /fpdfsdk/src/fpdfxfa | |
parent | 99ddbfbcc3d0e8a52c8f8a4ec22462d9e00c1c6a (diff) | |
download | pdfium-486615821300724aef55035f4f831f548fb9cab6.tar.xz |
Pdfium does not create isolate when it runs in chromium
BUG=pdfium:373
R=jochen@chromium.org
Review URL: https://codereview.chromium.org/1652873003 .
Diffstat (limited to 'fpdfsdk/src/fpdfxfa')
-rw-r--r-- | fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp index 44e9c72ddc..1006bf9c44 100644 --- a/fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp +++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp @@ -31,7 +31,8 @@ CPDFXFA_App::CPDFXFA_App() m_pXFAApp(NULL), m_pFontMgr(NULL), m_hJSERuntime(NULL), - m_csAppType(JS_STR_VIEWERTYPE_STANDARD) { + m_csAppType(JS_STR_VIEWERTYPE_STANDARD), + m_bOwnedRuntime(false) { m_pEnvList.RemoveAll(); } @@ -43,7 +44,7 @@ CPDFXFA_App::~CPDFXFA_App() { m_pXFAApp = NULL; #ifdef PDF_ENABLE_XFA - FXJSE_Runtime_Release(m_hJSERuntime); + FXJSE_Runtime_Release(m_hJSERuntime, m_bOwnedRuntime); m_hJSERuntime = NULL; FXJSE_Finalize(); @@ -51,12 +52,13 @@ CPDFXFA_App::~CPDFXFA_App() { #endif } -FX_BOOL CPDFXFA_App::Initialize() { +FX_BOOL CPDFXFA_App::Initialize(FXJSE_HRUNTIME hRuntime) { #ifdef PDF_ENABLE_XFA BC_Library_Init(); FXJSE_Initialize(); - m_hJSERuntime = FXJSE_Runtime_Create(); + m_bOwnedRuntime = !hRuntime; + m_hJSERuntime = hRuntime ? hRuntime : FXJSE_Runtime_Create(); if (!m_hJSERuntime) return FALSE; |