diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-10-08 12:24:19 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-10-08 12:24:19 -0700 |
commit | 67fd5df1a378195ae3fb40c862a4e6e58731020a (patch) | |
tree | 498a4803209d78747f97ed514c45981df47de3e5 /fpdfsdk/src/javascript/JS_Runtime.cpp | |
parent | 6d5649b46c73bde7de2488b5631ecbf0d4a3bb05 (diff) | |
download | pdfium-67fd5df1a378195ae3fb40c862a4e6e58731020a.tar.xz |
Merge to XFA: Wean CJS_Value off of v8::Isolate.
(cherry picked from commit 287b63d9ab410783d71cf37291f09fd57d3059b4)
Original Review URL: https://codereview.chromium.org/1394103002 .
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1394053003 .
Diffstat (limited to 'fpdfsdk/src/javascript/JS_Runtime.cpp')
-rw-r--r-- | fpdfsdk/src/javascript/JS_Runtime.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp index a449a142ac..d01c1fae7d 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), @@ -139,8 +146,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); |