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

Unified Diff: Source/core/xml/XPathPath.cpp

Issue 26763004: Vector stores Expression object as OwnPtr instead of raw pointer in XPath. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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
« Source/core/xml/XPathExpressionNode.h ('K') | « Source/core/xml/XPathPath.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« Source/core/xml/XPathExpressionNode.h ('K') | « Source/core/xml/XPathPath.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698