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

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

Issue 26709019: Vector stores Predicate 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
« no previous file with comments | « Source/core/xml/XPathPath.h ('k') | Source/core/xml/XPathStep.h » ('j') | 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 50ca71218057c831f950a2cfee1acbfe690bd522..dbc25506bc0f6d46d18711990aba56669a8ca06d 100644
--- a/Source/core/xml/XPathPath.cpp
+++ b/Source/core/xml/XPathPath.cpp
@@ -36,13 +36,10 @@
namespace WebCore {
namespace XPath {
-Filter::Filter(PassOwnPtr<Expression> expr, const Vector<Predicate*>& predicates)
+Filter::Filter(PassOwnPtr<Expression> expr, Vector<OwnPtr<Predicate> >& predicates)
: m_expr(expr)
{
- m_predicates.reserveInitialCapacity(predicates.size());
- for (size_t i = 0; i < predicates.size(); i++)
- m_predicates.append(adoptPtr(predicates[i]));
-
+ m_predicates.swap(predicates);
setIsContextNodeSensitive(m_expr->isContextNodeSensitive());
setIsContextPositionSensitive(m_expr->isContextPositionSensitive());
setIsContextSizeSensitive(m_expr->isContextSizeSensitive());
« no previous file with comments | « Source/core/xml/XPathPath.h ('k') | Source/core/xml/XPathStep.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698