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

Unified Diff: fpdfsdk/javascript/cjs_runtime.cpp

Issue 2241483004: Move some v8 objects from CJS back into FXJS (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rename to GetCurrentEngineFromIsolate() since engines not 1:1 with isolates Created 4 years, 4 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/javascript/cjs_runtime.h ('k') | fxjs/fxjs_v8.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/javascript/cjs_runtime.cpp
diff --git a/fpdfsdk/javascript/cjs_runtime.cpp b/fpdfsdk/javascript/cjs_runtime.cpp
index 7eaf1451ca71f9d4642b2a84d18e29cbdb906fde..36d888a2eab7e9275cf238c50f23d803055b5663 100644
--- a/fpdfsdk/javascript/cjs_runtime.cpp
+++ b/fpdfsdk/javascript/cjs_runtime.cpp
@@ -58,8 +58,7 @@ CJS_Runtime* CJS_Runtime::FromContext(const IJS_Context* cc) {
CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp)
: m_pApp(pApp),
m_pDocument(nullptr),
- m_bBlocking(FALSE),
- m_isolate(nullptr),
+ m_bBlocking(false),
m_isolateManaged(false) {
#ifndef PDF_ENABLE_XFA
IPDF_JSPLATFORM* pPlatform = m_pApp->GetFormFillInfo()->m_pJsPlatform;
@@ -96,7 +95,7 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp)
v8::HandleScope handle_scope(isolate);
if (CPDFXFA_App::GetInstance()->IsJavaScriptInitialized()) {
CJS_Context* pContext = (CJS_Context*)NewContext();
- FXJS_InitializeRuntime(GetIsolate(), this, &m_context, &m_StaticObjects);
+ FXJS_InitializeEngine(GetIsolate(), this, &m_context, &m_StaticObjects);
ReleaseContext(pContext);
return;
}
@@ -110,7 +109,7 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp)
#endif
CJS_Context* pContext = (CJS_Context*)NewContext();
- FXJS_InitializeRuntime(GetIsolate(), this, &m_context, &m_StaticObjects);
+ FXJS_InitializeEngine(GetIsolate(), this, &m_context, &m_StaticObjects);
ReleaseContext(pContext);
}
@@ -120,7 +119,7 @@ CJS_Runtime::~CJS_Runtime() {
m_ContextArray.clear();
m_ConstArrays.clear();
- FXJS_ReleaseRuntime(GetIsolate(), &m_context, &m_StaticObjects);
+ FXJS_ReleaseEngine(GetIsolate(), &m_context, &m_StaticObjects);
m_context.Reset();
if (m_isolateManaged)
m_isolate->Dispose();
@@ -284,7 +283,7 @@ FX_BOOL CJS_Runtime::GetValueByName(const CFX_ByteStringC& utf8Name,
// Do so now.
// TODO(tsepez): redesign PDF-side objects to not rely on v8::Context's
// embedder data slots, and/or to always use the right context.
- FXJS_SetRuntimeForV8Context(old_context, this);
+ FXJS_SetEngineForV8Context(old_context, this);
v8::Local<v8::Value> propvalue =
context->Global()->Get(v8::String::NewFromUtf8(
« no previous file with comments | « fpdfsdk/javascript/cjs_runtime.h ('k') | fxjs/fxjs_v8.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698