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

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

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/XPathNSResolver.idl ('k') | Source/core/xml/XPathNodeSet.cpp » ('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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 16 matching lines...) Expand all
27 #define XPathNodeSet_h 27 #define XPathNodeSet_h
28 28
29 #include "core/dom/Node.h" 29 #include "core/dom/Node.h"
30 #include "wtf/Forward.h" 30 #include "wtf/Forward.h"
31 #include "wtf/Vector.h" 31 #include "wtf/Vector.h"
32 32
33 namespace blink { 33 namespace blink {
34 34
35 namespace XPath { 35 namespace XPath {
36 36
37 class NodeSet : public NoBaseWillBeGarbageCollected<NodeSet> { 37 // TODO(Oilpan): drop Finalized once Node is on the heap.
38 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(NodeSet); 38 class NodeSet final : public GarbageCollectedFinalized<NodeSet> {
39 public: 39 public:
40 static PassOwnPtrWillBeRawPtr<NodeSet> create() { return adoptPtrWillBeNoop( new NodeSet); } 40 static NodeSet* create() { return new NodeSet; }
41 static PassOwnPtrWillBeRawPtr<NodeSet> create(const NodeSet&); 41 static NodeSet* create(const NodeSet&);
42 DEFINE_INLINE_TRACE() { visitor->trace(m_nodes); } 42 DEFINE_INLINE_TRACE() { visitor->trace(m_nodes); }
43 43
44 size_t size() const { return m_nodes.size(); } 44 size_t size() const { return m_nodes.size(); }
45 bool isEmpty() const { return !m_nodes.size(); } 45 bool isEmpty() const { return !m_nodes.size(); }
46 Node* operator[](unsigned i) const { return m_nodes.at(i).get(); } 46 Node* operator[](unsigned i) const { return m_nodes.at(i).get(); }
47 void reserveCapacity(size_t newCapacity) { m_nodes.reserveCapacity(newCapaci ty); } 47 void reserveCapacity(size_t newCapacity) { m_nodes.reserveCapacity(newCapaci ty); }
48 void clear() { m_nodes.clear(); } 48 void clear() { m_nodes.clear(); }
49 void swap(NodeSet& other) { std::swap(m_isSorted, other.m_isSorted); std::sw ap(m_subtreesAreDisjoint, other.m_subtreesAreDisjoint); m_nodes.swap(other.m_nod es); } 49 void swap(NodeSet& other) { std::swap(m_isSorted, other.m_isSorted); std::sw ap(m_subtreesAreDisjoint, other.m_subtreesAreDisjoint); m_nodes.swap(other.m_nod es); }
50 50
51 // NodeSet itself does not verify that nodes in it are unique. 51 // NodeSet itself does not verify that nodes in it are unique.
(...skipping 26 matching lines...) Expand all
78 78
79 bool m_isSorted; 79 bool m_isSorted;
80 bool m_subtreesAreDisjoint; 80 bool m_subtreesAreDisjoint;
81 WillBeHeapVector<RefPtrWillBeMember<Node>> m_nodes; 81 WillBeHeapVector<RefPtrWillBeMember<Node>> m_nodes;
82 }; 82 };
83 83
84 } 84 }
85 85
86 } 86 }
87 #endif // XPathNodeSet_h 87 #endif // XPathNodeSet_h
OLDNEW
« no previous file with comments | « Source/core/xml/XPathNSResolver.idl ('k') | Source/core/xml/XPathNodeSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698