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

Unified Diff: fpdfsdk/src/javascript/JS_Runtime.cpp

Issue 1394053003: Merge to XFA: Wean CJS_Value off of v8::Isolate. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Fix compile Created 5 years, 2 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/javascript/JS_Runtime.h ('k') | fpdfsdk/src/javascript/JS_Value.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/JS_Runtime.cpp
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index f97b4549930835d61e49ad6694b345255d9a645b..e944b1c86d8bac024e546fc0579c0bd55da556be 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -32,10 +32,17 @@
/* ------------------------------ CJS_Runtime ------------------------------ */
v8::Global<v8::ObjectTemplate>& _getGlobalObjectTemplate(v8::Isolate* pIsolate);
+// static
IJS_Runtime* IJS_Runtime::Create(CPDFDoc_Environment* pEnv) {
return new CJS_Runtime(pEnv);
}
+// static
+CJS_Runtime* CJS_Runtime::FromContext(const IJS_Context* cc) {
+ const CJS_Context* pContext = static_cast<const CJS_Context*>(cc);
+ return pContext->GetJSRuntime();
+}
+
CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp)
: m_pApp(pApp),
m_pDocument(NULL),
@@ -137,8 +144,8 @@ void CJS_Runtime::DefineJSObjects() {
// ObjDefIDs 18 - 20 (these can't fail, return void).
CJS_PublicMethods::DefineJSObjects(GetIsolate());
- CJS_GlobalConsts::DefineJSObjects(GetIsolate());
- CJS_GlobalArrays::DefineJSObjects(GetIsolate());
+ CJS_GlobalConsts::DefineJSObjects(this);
+ CJS_GlobalArrays::DefineJSObjects(this);
// ObjDefIDs 21 - 22.
CJS_TimerObj::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_DYNAMIC);
« no previous file with comments | « fpdfsdk/src/javascript/JS_Runtime.h ('k') | fpdfsdk/src/javascript/JS_Value.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698