summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/xfa_expression.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-28 16:56:08 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-28 16:56:08 -0700
commita31098417852bdf13e693a6e0913e0706cf94098 (patch)
tree7539d764cfc859d8d88ab0162281f2184d1963b7 /xfa/fxfa/fm2js/xfa_expression.h
parent9a1b665f8a6762927b7fa4fb9c812f00e8d3135e (diff)
downloadpdfium-a31098417852bdf13e693a6e0913e0706cf94098.tar.xz
Convert CFX_PtrArray to typesafe CFX_ArrayTemplate, Part 6
Review-Url: https://codereview.chromium.org/1926303002
Diffstat (limited to 'xfa/fxfa/fm2js/xfa_expression.h')
-rw-r--r--xfa/fxfa/fm2js/xfa_expression.h36
1 files changed, 23 insertions, 13 deletions
diff --git a/xfa/fxfa/fm2js/xfa_expression.h b/xfa/fxfa/fm2js/xfa_expression.h
index 9bd0c9b89f..ff898a9c41 100644
--- a/xfa/fxfa/fm2js/xfa_expression.h
+++ b/xfa/fxfa/fm2js/xfa_expression.h
@@ -39,19 +39,22 @@ class CXFA_FMExpression {
class CXFA_FMFunctionDefinition : public CXFA_FMExpression {
public:
- CXFA_FMFunctionDefinition(uint32_t line,
- FX_BOOL isGlobal,
- const CFX_WideStringC& wsName,
- CFX_WideStringCArray* pArguments,
- CFX_PtrArray* pExpressions);
+ // Takes ownership of |pExpressions|.
+ CXFA_FMFunctionDefinition(
+ uint32_t line,
+ FX_BOOL isGlobal,
+ const CFX_WideStringC& wsName,
+ CFX_WideStringCArray* pArguments,
+ CFX_ArrayTemplate<CXFA_FMExpression*>* pExpressions);
~CXFA_FMFunctionDefinition() override;
+
void ToJavaScript(CFX_WideTextBuf& javascript) override;
void ToImpliedReturnJS(CFX_WideTextBuf&) override;
private:
CFX_WideStringC m_wsName;
CFX_WideStringCArray* m_pArguments;
- CFX_PtrArray* m_pExpressions;
+ CFX_ArrayTemplate<CXFA_FMExpression*>* m_pExpressions;
FX_BOOL m_isGlobal;
};
@@ -80,13 +83,17 @@ class CXFA_FMExpExpression : public CXFA_FMExpression {
class CXFA_FMBlockExpression : public CXFA_FMExpression {
public:
- CXFA_FMBlockExpression(uint32_t line, CFX_PtrArray* pExpressionList);
+ // Takes ownership of |pExpressionList|.
+ CXFA_FMBlockExpression(
+ uint32_t line,
+ CFX_ArrayTemplate<CXFA_FMExpression*>* pExpressionList);
~CXFA_FMBlockExpression() override;
+
void ToJavaScript(CFX_WideTextBuf& javascript) override;
void ToImpliedReturnJS(CFX_WideTextBuf&) override;
private:
- CFX_PtrArray* m_pExpressionList;
+ CFX_ArrayTemplate<CXFA_FMExpression*>* m_pExpressionList;
};
class CXFA_FMDoExpression : public CXFA_FMExpression {
@@ -174,17 +181,20 @@ class CXFA_FMForExpression : public CXFA_FMLoopExpression {
class CXFA_FMForeachExpression : public CXFA_FMLoopExpression {
public:
- CXFA_FMForeachExpression(uint32_t line,
- const CFX_WideStringC& wsIdentifier,
- CFX_PtrArray* pAccessors,
- CXFA_FMExpression* pList);
+ // Takes ownership of |pAccessors|.
+ CXFA_FMForeachExpression(
+ uint32_t line,
+ const CFX_WideStringC& wsIdentifier,
+ CFX_ArrayTemplate<CXFA_FMSimpleExpression*>* pAccessors,
+ CXFA_FMExpression* pList);
~CXFA_FMForeachExpression() override;
+
void ToJavaScript(CFX_WideTextBuf& javascript) override;
void ToImpliedReturnJS(CFX_WideTextBuf&) override;
private:
CFX_WideStringC m_wsIdentifier;
- CFX_PtrArray* m_pAccessors;
+ CFX_ArrayTemplate<CXFA_FMSimpleExpression*>* m_pAccessors;
std::unique_ptr<CXFA_FMExpression> m_pList;
};