summaryrefslogtreecommitdiff
path: root/fxjs/cfxjse_engine.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-21 22:02:20 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-21 22:02:20 +0000
commit307dfb406422f9589fcdb09039b4c31a9c5f6269 (patch)
tree7d176d1f37af77877cfb2714e5ea415f344ba9db /fxjs/cfxjse_engine.cpp
parent96d6f741b3c106ba0e48a05692910f64cf1e5e09 (diff)
downloadpdfium-307dfb406422f9589fcdb09039b4c31a9c5f6269.tar.xz
Cleanup CXFA_ScriptData
This CL cleans removes out params, makes methods const and moves the XFA_ScriptDataType into CXFA_ScriptData. Change-Id: I5a51a0eddc3608577a387472911000daa479af0f Reviewed-on: https://pdfium-review.googlesource.com/19090 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/cfxjse_engine.cpp')
-rw-r--r--fxjs/cfxjse_engine.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/fxjs/cfxjse_engine.cpp b/fxjs/cfxjse_engine.cpp
index e5d6c0a0fe..c2dba2f311 100644
--- a/fxjs/cfxjse_engine.cpp
+++ b/fxjs/cfxjse_engine.cpp
@@ -130,7 +130,7 @@ CFXJSE_Engine::CFXJSE_Engine(CXFA_Document* pDocument, v8::Isolate* pIsolate)
pDocument->GetRoot())),
m_pIsolate(pIsolate),
m_pJsClass(nullptr),
- m_eScriptType(XFA_ScriptDataType::Unknown),
+ m_eScriptType(CXFA_ScriptData::Type::Unknown),
m_pScriptNodeArray(nullptr),
m_ResolveProcessor(pdfium::MakeUnique<CFXJSE_ResolveProcessor>()),
m_pThisObject(nullptr),
@@ -150,14 +150,14 @@ CFXJSE_Engine::~CFXJSE_Engine() {
delete ToThisProxy(pair.second->GetGlobalObject().get(), nullptr);
}
-bool CFXJSE_Engine::RunScript(XFA_ScriptDataType eScriptType,
+bool CFXJSE_Engine::RunScript(CXFA_ScriptData::Type eScriptType,
const WideStringView& wsScript,
CFXJSE_Value* hRetValue,
CXFA_Object* pThisObject) {
ByteString btScript;
- AutoRestorer<XFA_ScriptDataType> typeRestorer(&m_eScriptType);
+ AutoRestorer<CXFA_ScriptData::Type> typeRestorer(&m_eScriptType);
m_eScriptType = eScriptType;
- if (eScriptType == XFA_ScriptDataType::Formcalc) {
+ if (eScriptType == CXFA_ScriptData::Type::Formcalc) {
if (!m_FM2JSContext) {
m_FM2JSContext = pdfium::MakeUnique<CFXJSE_FormCalcContext>(
m_pIsolate, m_JsContext.get(), m_pDocument.Get());
@@ -243,7 +243,7 @@ void CFXJSE_Engine::GlobalPropertyGetter(CFXJSE_Value* pObject,
CFXJSE_Engine* lpScriptContext = pDoc->GetScriptContext();
CXFA_Object* lpCurNode = lpScriptContext->GetVariablesThis(pOriginalObject);
WideString wsPropName = WideString::FromUTF8(szPropName);
- if (lpScriptContext->GetType() == XFA_ScriptDataType::Formcalc) {
+ if (lpScriptContext->GetType() == CXFA_ScriptData::Type::Formcalc) {
if (szPropName == kFormCalcRuntime) {
lpScriptContext->m_FM2JSContext->GlobalPropertyGetter(pValue);
return;
@@ -319,7 +319,7 @@ void CFXJSE_Engine::NormalPropertyGetter(CFXJSE_Value* pOriginalValue,
return;
if (pObject == lpScriptContext->GetThisObject() ||
- (lpScriptContext->GetType() == XFA_ScriptDataType::Javascript &&
+ (lpScriptContext->GetType() == CXFA_ScriptData::Type::Javascript &&
!lpScriptContext->IsStrictScopeInJavaScript())) {
dwFlag = XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings;
bRet = lpScriptContext->QueryNodeByFlag(ToNode(pObject),
@@ -454,7 +454,7 @@ bool CFXJSE_Engine::IsStrictScopeInJavaScript() {
return m_pDocument->HasFlag(XFA_DOCFLAG_StrictScoping);
}
-XFA_ScriptDataType CFXJSE_Engine::GetType() {
+CXFA_ScriptData::Type CFXJSE_Engine::GetType() {
return m_eScriptType;
}
@@ -574,7 +574,7 @@ int32_t CFXJSE_Engine::ResolveObjects(CXFA_Object* refObject,
if (wsExpression.IsEmpty())
return 0;
- if (m_eScriptType != XFA_ScriptDataType::Formcalc ||
+ if (m_eScriptType != CXFA_ScriptData::Type::Formcalc ||
(dwStyles & (XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings))) {
m_upObjectArray.clear();
}