From 6ffd840c1f4d7d74a6c4c07c5791c4f3db8d50b9 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 6 Jun 2018 20:51:04 +0000 Subject: Remove still more v8::Context slot usage. Removes CJS_Runtime::RuntimeFromIsolateCurrentContext() Change-Id: I51abcf32aaafac522e1595edf663507c26781357 Reviewed-on: https://pdfium-review.googlesource.com/34230 Commit-Queue: Tom Sepez Commit-Queue: dsinclair Reviewed-by: dsinclair --- fxjs/cjs_global.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'fxjs/cjs_global.cpp') diff --git a/fxjs/cjs_global.cpp b/fxjs/cjs_global.cpp index 5834ab9600..1e01f96aee 100644 --- a/fxjs/cjs_global.cpp +++ b/fxjs/cjs_global.cpp @@ -311,9 +311,9 @@ CJS_Return CJS_Global::setPersistent( } void CJS_Global::UpdateGlobalPersistentVariables() { - CJS_Runtime* pRuntime = - static_cast(CFXJS_Engine::EngineFromIsolateCurrentContext( - ToV8Object()->GetIsolate())); + CJS_Runtime* pRuntime = GetRuntime(); + if (!pRuntime) + return; for (int i = 0, sz = m_pGlobalData->GetSize(); i < sz; i++) { CJS_GlobalData_Element* pData = m_pGlobalData->GetAt(i); @@ -450,8 +450,9 @@ void CJS_Global::ObjectToArray(CJS_Runtime* pRuntime, void CJS_Global::PutObjectProperty(v8::Local pObj, CJS_KeyValue* pData) { - CJS_Runtime* pRuntime = - CJS_Runtime::RuntimeFromIsolateCurrentContext(ToV8Object()->GetIsolate()); + CJS_Runtime* pRuntime = GetRuntime(); + if (pRuntime) + return; for (int i = 0, sz = pData->objData.Count(); i < sz; i++) { CJS_KeyValue* pObjData = pData->objData.GetAt(i); -- cgit v1.2.3