Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Unified Diff: fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp

Issue 1652873003: Pdfium does not create isolate when it runs in chromium (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/fpdfview.cpp ('k') | fpdfsdk/src/javascript/JS_Runtime.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp
diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp
index 44e9c72ddc09ad501105b34f4026c7e87c6d3208..1006bf9c440d265a0a752a3ab5f5fb9ee6960a9b 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;
« no previous file with comments | « fpdfsdk/src/fpdfview.cpp ('k') | fpdfsdk/src/javascript/JS_Runtime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698