summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_script.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-05-31 11:34:04 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-31 11:34:04 -0700
commit86fad999ba59b1f8780582cc683b008880aab42e (patch)
treebc63f57e472a4aca6c2316eea4707d0aa415c122 /xfa/fxfa/parser/xfa_script.h
parent4dce6d4689d464c3a8825a5d6aa790adfc9228ee (diff)
downloadpdfium-86fad999ba59b1f8780582cc683b008880aab42e.tar.xz
Replace CFXJSE_Value create/destroy with new and delete.
In most cases, the destroy calls were removed and the object wrapped in a unique_ptr. Review-Url: https://codereview.chromium.org/2014323003
Diffstat (limited to 'xfa/fxfa/parser/xfa_script.h')
-rw-r--r--xfa/fxfa/parser/xfa_script.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/xfa/fxfa/parser/xfa_script.h b/xfa/fxfa/parser/xfa_script.h
index 42d3ddfa47..350588f8b5 100644
--- a/xfa/fxfa/parser/xfa_script.h
+++ b/xfa/fxfa/parser/xfa_script.h
@@ -8,6 +8,7 @@
#define XFA_FXFA_PARSER_XFA_SCRIPT_H_
#include "xfa/fxfa/include/fxfa.h"
+#include "xfa/fxjse/value.h"
#define XFA_RESOLVENODE_Children 0x0001
#define XFA_RESOLVENODE_Attributes 0x0004
@@ -41,7 +42,7 @@ class CXFA_ValueArray : public CFX_ArrayTemplate<CFXJSE_Value*> {
~CXFA_ValueArray() {
for (int32_t i = 0; i < GetSize(); i++) {
- FXJSE_Value_Release(GetAt(i));
+ delete GetAt(i);
}
}
@@ -65,10 +66,10 @@ struct XFA_RESOLVENODE_RS {
if (pScriptAttribute && pScriptAttribute->eValueType == XFA_SCRIPT_Object) {
v8::Isolate* pIsolate = valueArray.m_pIsolate;
for (int32_t i = 0; i < nodes.GetSize(); i++) {
- CFXJSE_Value* pValue = FXJSE_Value_Create(pIsolate);
+ std::unique_ptr<CFXJSE_Value> pValue(new CFXJSE_Value(pIsolate));
(nodes[i]->*(pScriptAttribute->lpfnCallback))(
- pValue, FALSE, (XFA_ATTRIBUTE)pScriptAttribute->eAttribute);
- valueArray.Add(pValue);
+ pValue.get(), FALSE, (XFA_ATTRIBUTE)pScriptAttribute->eAttribute);
+ valueArray.Add(pValue.release());
}
}
return valueArray.GetSize();