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

Side by Side Diff: Source/core/xml/XPathNodeSet.cpp

Issue 1099613003: Oilpan: have xml/ objects on the heap by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: simplify XPathResult dtor Created 5 years, 8 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/XPathNodeSet.h ('k') | Source/core/xml/XPathParser.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) 2007 Alexey Proskuryakov <ap@webkit.org> 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 23 matching lines...) Expand all
34 namespace blink { 34 namespace blink {
35 namespace XPath { 35 namespace XPath {
36 36
37 // When a node set is large, sorting it by traversing the whole document is 37 // When a node set is large, sorting it by traversing the whole document is
38 // better (we can assume that we aren't dealing with documents that we cannot 38 // better (we can assume that we aren't dealing with documents that we cannot
39 // even traverse in reasonable time). 39 // even traverse in reasonable time).
40 const unsigned traversalSortCutoff = 10000; 40 const unsigned traversalSortCutoff = 10000;
41 41
42 typedef WillBeHeapVector<RawPtrWillBeMember<Node>> NodeSetVector; 42 typedef WillBeHeapVector<RawPtrWillBeMember<Node>> NodeSetVector;
43 43
44 PassOwnPtrWillBeRawPtr<NodeSet> NodeSet::create(const NodeSet& other) 44 NodeSet* NodeSet::create(const NodeSet& other)
45 { 45 {
46 OwnPtrWillBeRawPtr<NodeSet> nodeSet = NodeSet::create(); 46 NodeSet* nodeSet = NodeSet::create();
47 nodeSet->m_isSorted = other.m_isSorted; 47 nodeSet->m_isSorted = other.m_isSorted;
48 nodeSet->m_subtreesAreDisjoint = other.m_subtreesAreDisjoint; 48 nodeSet->m_subtreesAreDisjoint = other.m_subtreesAreDisjoint;
49 nodeSet->m_nodes.appendVector(other.m_nodes); 49 nodeSet->m_nodes.appendVector(other.m_nodes);
50 return nodeSet.release(); 50 return nodeSet;
51 } 51 }
52 52
53 static inline Node* parentWithDepth(unsigned depth, const NodeSetVector& parents ) 53 static inline Node* parentWithDepth(unsigned depth, const NodeSetVector& parents )
54 { 54 {
55 ASSERT(parents.size() >= depth + 1); 55 ASSERT(parents.size() >= depth + 1);
56 return parents[parents.size() - 1 - depth]; 56 return parents[parents.size() - 1 - depth];
57 } 57 }
58 58
59 static void sortBlock(unsigned from, unsigned to, WillBeHeapVector<NodeSetVector >& parentMatrix, bool mayContainAttributeNodes) 59 static void sortBlock(unsigned from, unsigned to, WillBeHeapVector<NodeSetVector >& parentMatrix, bool mayContainAttributeNodes)
60 { 60 {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 Node* NodeSet::anyNode() const 274 Node* NodeSet::anyNode() const
275 { 275 {
276 if (isEmpty()) 276 if (isEmpty())
277 return 0; 277 return 0;
278 278
279 return m_nodes.at(0).get(); 279 return m_nodes.at(0).get();
280 } 280 }
281 281
282 } 282 }
283 } 283 }
OLDNEW
« no previous file with comments | « Source/core/xml/XPathNodeSet.h ('k') | Source/core/xml/XPathParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698