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

Unified Diff: xfa/src/fxjse/src/runtime.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 | « xfa/include/fxjse/fxjse.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fxjse/src/runtime.cpp
diff --git a/xfa/src/fxjse/src/runtime.cpp b/xfa/src/fxjse/src/runtime.cpp
index 5609c35b6364fe30a3001061c679f47aaecc2d83..72e221226d77cd6500717fdfc115555139bcd89f 100644
--- a/xfa/src/fxjse/src/runtime.cpp
+++ b/xfa/src/fxjse/src/runtime.cpp
@@ -58,12 +58,19 @@ FXJSE_HRUNTIME FXJSE_Runtime_Create() {
CFXJSE_RuntimeData::g_RuntimeList->AppendRuntime(pIsolate);
return reinterpret_cast<FXJSE_HRUNTIME>(pIsolate);
}
-void FXJSE_Runtime_Release(FXJSE_HRUNTIME hRuntime) {
+void FXJSE_Runtime_Release(FXJSE_HRUNTIME hRuntime, bool bOwnedRuntime) {
v8::Isolate* pIsolate = reinterpret_cast<v8::Isolate*>(hRuntime);
- if (pIsolate) {
+ if (!pIsolate)
+ return;
+ if (bOwnedRuntime) {
ASSERT(CFXJSE_RuntimeData::g_RuntimeList);
CFXJSE_RuntimeData::g_RuntimeList->RemoveRuntime(
pIsolate, FXJSE_Runtime_DisposeCallback);
+ } else {
+ if (FXJS_PerIsolateData* pData = FXJS_PerIsolateData::Get(pIsolate)) {
+ delete pData->m_pFXJSERuntimeData;
+ pData->m_pFXJSERuntimeData = nullptr;
+ }
}
}
CFXJSE_RuntimeData* CFXJSE_RuntimeData::Create(v8::Isolate* pIsolate) {
« no previous file with comments | « xfa/include/fxjse/fxjse.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698