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

Unified Diff: xfa/fxfa/parser/xfa_script_imp.cpp

Issue 2056733003: Change CFXJSE_Context::GetGlobalObject to return (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@to_string_return
Patch Set: Created 4 years, 6 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 | « no previous file | xfa/fxjse/context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/xfa_script_imp.cpp
diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp
index 245ea8bca49c462d78960679f8ee5d961fb0f04b..fe8400515fce4787bc5e39c69d4167a566aa5eba 100644
--- a/xfa/fxfa/parser/xfa_script_imp.cpp
+++ b/xfa/fxfa/parser/xfa_script_imp.cpp
@@ -502,10 +502,7 @@ FX_BOOL CXFA_ScriptContext::QueryVariableValue(
FX_BOOL bRes = FALSE;
CFXJSE_Context* pVariableContext = static_cast<CFXJSE_Context*>(lpVariables);
- std::unique_ptr<CFXJSE_Value> pObject(
- new CFXJSE_Value(pVariableContext->GetRuntime()));
- pVariableContext->GetGlobalObject(pObject.get());
-
+ std::unique_ptr<CFXJSE_Value> pObject = pVariableContext->GetGlobalObject();
std::unique_ptr<CFXJSE_Value> hVariableValue(new CFXJSE_Value(m_pIsolate));
if (!bGetter) {
pObject->SetObjectOwnProperty(szPropName, pValue);
@@ -529,11 +526,8 @@ void CXFA_ScriptContext::ReleaseVariablesMap() {
CXFA_Object* pScriptNode;
CFXJSE_Context* pVariableContext = nullptr;
m_mapVariableToContext.GetNextAssoc(ps, pScriptNode, pVariableContext);
- std::unique_ptr<CFXJSE_Value> pObject(
- new CFXJSE_Value(pVariableContext->GetRuntime()));
- pVariableContext->GetGlobalObject(pObject.get());
- delete ToThisProxy(pObject.get(), nullptr);
+ delete ToThisProxy(pVariableContext->GetGlobalObject().get(), nullptr);
delete pVariableContext;
}
m_mapVariableToContext.RemoveAll();
@@ -545,14 +539,11 @@ void CXFA_ScriptContext::DefineJsClass() {
void CXFA_ScriptContext::RemoveBuiltInObjs(CFXJSE_Context* pContext) const {
static const CFX_ByteStringC OBJ_NAME[2] = {"Number", "Date"};
- std::unique_ptr<CFXJSE_Value> pObject(
- new CFXJSE_Value(pContext->GetRuntime()));
- pContext->GetGlobalObject(pObject.get());
-
+ std::unique_ptr<CFXJSE_Value> pObject = pContext->GetGlobalObject();
std::unique_ptr<CFXJSE_Value> hProp(new CFXJSE_Value(m_pIsolate));
for (int i = 0; i < 2; ++i) {
if (pObject->GetObjectProperty(OBJ_NAME[i], hProp.get()))
- pObject.get()->DeleteObjectProperty(OBJ_NAME[i]);
+ pObject->DeleteObjectProperty(OBJ_NAME[i]);
}
}
CFXJSE_Class* CXFA_ScriptContext::GetJseNormalClass() {
« no previous file with comments | « no previous file | xfa/fxjse/context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698