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

Unified Diff: Source/core/xml/XPathFunctions.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: Change XPathGrammar.y also 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
Index: Source/core/xml/XPathFunctions.cpp
diff --git a/Source/core/xml/XPathFunctions.cpp b/Source/core/xml/XPathFunctions.cpp
index 55004df0f1226b59b432661ade9bf7c8f873eb5f..978d858b6bbf41f1887dd71a8adbb8536873e82b 100644
--- a/Source/core/xml/XPathFunctions.cpp
+++ b/Source/core/xml/XPathFunctions.cpp
@@ -290,7 +290,7 @@ inline bool Interval::contains(int value) const
return value >= m_min && value <= m_max;
}
-void Function::setArguments(const Vector<Expression*>& args)
+void Function::setArguments(Vector<OwnPtr<Expression> >& args)
{
ASSERT(!subExprCount());
@@ -298,9 +298,9 @@ void Function::setArguments(const Vector<Expression*>& args)
if (m_name != "lang" && !args.isEmpty())
setIsContextNodeSensitive(false);
- Vector<Expression*>::const_iterator end = args.end();
- for (Vector<Expression*>::const_iterator it = args.begin(); it != end; it++)
- addSubExpression(*it);
+ Vector<OwnPtr<Expression> >::iterator end = args.end();
+ for (Vector<OwnPtr<Expression> >::iterator it = args.begin(); it != end; it++)
+ addSubExpression(it->release());
}
Value FunLast::evaluate() const
@@ -712,7 +712,14 @@ static void createFunctionMap()
functionMap->set(functions[i].name, functions[i].function);
}
-Function* createFunction(const String& name, const Vector<Expression*>& args)
+
+Function* createFunction(const String& name)
+{
+ Vector<OwnPtr<Expression> > args;
+ return createFunction(name, args);
+}
+
+Function* createFunction(const String& name, Vector<OwnPtr<Expression> >& args)
{
if (!functionMap)
createFunctionMap();

Powered by Google App Engine
This is Rietveld 408576698