Chromium Code Reviews| Index: Source/core/xml/XPathPath.cpp |
| diff --git a/Source/core/xml/XPathPath.cpp b/Source/core/xml/XPathPath.cpp |
| index 73b446f487c9cf6eeb563f33931259ef52d127d2..4e1c80515e8a1344783f5ed4bdce6eee0de3fdcd 100644 |
| --- a/Source/core/xml/XPathPath.cpp |
| +++ b/Source/core/xml/XPathPath.cpp |
| @@ -37,8 +37,12 @@ namespace WebCore { |
| namespace XPath { |
| Filter::Filter(Expression* expr, const Vector<Predicate*>& predicates) |
| - : m_expr(expr), m_predicates(predicates) |
| + : m_expr(adoptPtr(expr)) |
|
abarth-chromium
2013/10/11 20:28:05
Again, |expr| should have the type PassOwnPtr<Expr
|
| { |
| + m_predicates.reserveInitialCapacity(predicates.size()); |
| + for (size_t i = 0; i < predicates.size(); i++) |
| + m_predicates.append(adoptPtr(predicates[i])); |
|
abarth-chromium
2013/10/11 20:28:05
Calling adoptPtr manually here is wrong for the sa
|
| + |
| setIsContextNodeSensitive(m_expr->isContextNodeSensitive()); |
| setIsContextPositionSensitive(m_expr->isContextPositionSensitive()); |
| setIsContextSizeSensitive(m_expr->isContextSizeSensitive()); |
| @@ -46,8 +50,6 @@ Filter::Filter(Expression* expr, const Vector<Predicate*>& predicates) |
| Filter::~Filter() |
| { |
| - delete m_expr; |
| - deleteAllValues(m_predicates); |
| } |
| Value Filter::evaluate() const |