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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « Source/core/xml/XPathPath.h ('k') | Source/core/xml/XPathStep.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org> 2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org>
3 * Copyright (C) 2006, 2009 Apple Inc. 3 * Copyright (C) 2006, 2009 Apple Inc.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 18 matching lines...) Expand all
29 #include "core/xml/XPathPath.h" 29 #include "core/xml/XPathPath.h"
30 30
31 #include "core/dom/Document.h" 31 #include "core/dom/Document.h"
32 #include "core/xml/XPathPredicate.h" 32 #include "core/xml/XPathPredicate.h"
33 #include "core/xml/XPathStep.h" 33 #include "core/xml/XPathStep.h"
34 #include "core/xml/XPathValue.h" 34 #include "core/xml/XPathValue.h"
35 35
36 namespace WebCore { 36 namespace WebCore {
37 namespace XPath { 37 namespace XPath {
38 38
39 Filter::Filter(PassOwnPtr<Expression> expr, const Vector<Predicate*>& predicates ) 39 Filter::Filter(PassOwnPtr<Expression> expr, Vector<OwnPtr<Predicate> >& predicat es)
40 : m_expr(expr) 40 : m_expr(expr)
41 { 41 {
42 m_predicates.reserveInitialCapacity(predicates.size()); 42 m_predicates.swap(predicates);
43 for (size_t i = 0; i < predicates.size(); i++)
44 m_predicates.append(adoptPtr(predicates[i]));
45
46 setIsContextNodeSensitive(m_expr->isContextNodeSensitive()); 43 setIsContextNodeSensitive(m_expr->isContextNodeSensitive());
47 setIsContextPositionSensitive(m_expr->isContextPositionSensitive()); 44 setIsContextPositionSensitive(m_expr->isContextPositionSensitive());
48 setIsContextSizeSensitive(m_expr->isContextSizeSensitive()); 45 setIsContextSizeSensitive(m_expr->isContextSizeSensitive());
49 } 46 }
50 47
51 Filter::~Filter() 48 Filter::~Filter()
52 { 49 {
53 } 50 }
54 51
55 Value Filter::evaluate() const 52 Value Filter::evaluate() const
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 Value v = m_filter->evaluate(); 205 Value v = m_filter->evaluate();
209 206
210 NodeSet& nodes = v.modifiableNodeSet(); 207 NodeSet& nodes = v.modifiableNodeSet();
211 m_path->evaluate(nodes); 208 m_path->evaluate(nodes);
212 209
213 return v; 210 return v;
214 } 211 }
215 212
216 } 213 }
217 } 214 }
OLDNEW
« 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