diff options
author | npm <npm@chromium.org> | 2016-11-28 12:31:13 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-28 12:31:13 -0800 |
commit | eb9625c04876c45862fb30e48a4fd6d5998db0e9 (patch) | |
tree | 67725226cdf317ff35213da6761dfc0455ec69fb /xfa/fxfa/fm2js/xfa_expression.h | |
parent | c92e26defaa636b0d2ec9b9de0f88c6153ad7ed3 (diff) | |
download | pdfium-eb9625c04876c45862fb30e48a4fd6d5998db0e9.tar.xz |
Use unique pointers in CXFA_FMParse
Replaced CXFA_FMParse's returns to be unique pointers to prevent leaks.
Review-Url: https://codereview.chromium.org/2530933002
Diffstat (limited to 'xfa/fxfa/fm2js/xfa_expression.h')
-rw-r--r-- | xfa/fxfa/fm2js/xfa_expression.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/xfa/fxfa/fm2js/xfa_expression.h b/xfa/fxfa/fm2js/xfa_expression.h index 236b51a6b0..f89a923565 100644 --- a/xfa/fxfa/fm2js/xfa_expression.h +++ b/xfa/fxfa/fm2js/xfa_expression.h @@ -46,7 +46,7 @@ class CXFA_FMFunctionDefinition : public CXFA_FMExpression { bool isGlobal, const CFX_WideStringC& wsName, std::unique_ptr<CFX_WideStringCArray> pArguments, - CFX_ArrayTemplate<CXFA_FMExpression*>* pExpressions); + std::vector<std::unique_ptr<CXFA_FMExpression>>&& pExpressions); ~CXFA_FMFunctionDefinition() override; void ToJavaScript(CFX_WideTextBuf& javascript) override; @@ -55,7 +55,7 @@ class CXFA_FMFunctionDefinition : public CXFA_FMExpression { private: CFX_WideStringC m_wsName; std::unique_ptr<CFX_WideStringCArray> m_pArguments; - CFX_ArrayTemplate<CXFA_FMExpression*>* m_pExpressions; + std::vector<std::unique_ptr<CXFA_FMExpression>> m_pExpressions; bool m_isGlobal; }; @@ -88,17 +88,16 @@ class CXFA_FMExpExpression : public CXFA_FMExpression { class CXFA_FMBlockExpression : public CXFA_FMExpression { public: - // Takes ownership of |pExpressionList|. CXFA_FMBlockExpression( uint32_t line, - CFX_ArrayTemplate<CXFA_FMExpression*>* pExpressionList); + std::vector<std::unique_ptr<CXFA_FMExpression>>&& pExpressionList); ~CXFA_FMBlockExpression() override; void ToJavaScript(CFX_WideTextBuf& javascript) override; void ToImpliedReturnJS(CFX_WideTextBuf&) override; private: - CFX_ArrayTemplate<CXFA_FMExpression*>* m_pExpressionList; + std::vector<std::unique_ptr<CXFA_FMExpression>> m_ExpressionList; }; class CXFA_FMDoExpression : public CXFA_FMExpression { |