summaryrefslogtreecommitdiff
path: root/fxjs/cfxjse_engine.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-31 17:44:51 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-31 17:44:51 +0000
commit53701cd5a8e71137a00e4a1d7803761317b7574b (patch)
treeffa93276b8bca7237c8827c1ac69b8dcf52fbf59 /fxjs/cfxjse_engine.cpp
parent53038b6390ffbbe5d4f6efd14bdde9a4f05a3f4e (diff)
downloadpdfium-53701cd5a8e71137a00e4a1d7803761317b7574b.tar.xz
Use more UnownedPtrs in CFXJSE_Engine.
Change-Id: If577500905f5bc5bb631718e9c87aa03ee6bee5a Reviewed-on: https://pdfium-review.googlesource.com/41571 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fxjs/cfxjse_engine.cpp')
-rw-r--r--fxjs/cfxjse_engine.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/fxjs/cfxjse_engine.cpp b/fxjs/cfxjse_engine.cpp
index 305e29a9cd..eb19573411 100644
--- a/fxjs/cfxjse_engine.cpp
+++ b/fxjs/cfxjse_engine.cpp
@@ -138,7 +138,7 @@ bool CFXJSE_Engine::RunScript(CXFA_Script::Type eScriptType,
} else {
btScript = FX_UTF8Encode(wsScript);
}
- AutoRestorer<CXFA_Object*> nodeRestorer(&m_pThisObject);
+ AutoRestorer<UnownedPtr<CXFA_Object>> nodeRestorer(&m_pThisObject);
m_pThisObject = pThisObject;
CFXJSE_Value* pValue = pThisObject ? GetJSValueFromMap(pThisObject) : nullptr;
@@ -510,7 +510,7 @@ bool CFXJSE_Engine::RunVariablesScript(CXFA_Node* pScriptNode) {
CXFA_Node* pThisObject = pParent->GetParent();
CFXJSE_Context* pVariablesContext =
CreateVariablesContext(pScriptNode, pThisObject);
- AutoRestorer<CXFA_Object*> nodeRestorer(&m_pThisObject);
+ AutoRestorer<UnownedPtr<CXFA_Object>> nodeRestorer(&m_pThisObject);
m_pThisObject = pThisObject;
return pVariablesContext->ExecuteScript(btScript.c_str(), hRetValue.get(),
nullptr);
@@ -563,10 +563,6 @@ void CFXJSE_Engine::RemoveBuiltInObjs(CFXJSE_Context* pContext) const {
}
}
-CFXJSE_Class* CFXJSE_Engine::GetJseNormalClass() {
- return m_pJsClass;
-}
-
bool CFXJSE_Engine::ResolveObjects(CXFA_Object* refObject,
const WideStringView& wsExpression,
XFA_RESOLVENODE_RS* resolveNodeRS,
@@ -753,7 +749,7 @@ CFXJSE_Value* CFXJSE_Engine::GetJSValueFromMap(CXFA_Object* pObject) {
return iter->second.get();
auto jsValue = pdfium::MakeUnique<CFXJSE_Value>(GetIsolate());
- jsValue->SetObject(pObject, m_pJsClass);
+ jsValue->SetObject(pObject, m_pJsClass.Get());
CFXJSE_Value* pValue = jsValue.get();
m_mapObjectToValue.insert(std::make_pair(pObject, std::move(jsValue)));