Chromium Code Reviews| Index: Source/core/dom/shadow/ContentDistribution.h |
| diff --git a/Source/core/dom/shadow/ContentDistribution.h b/Source/core/dom/shadow/ContentDistribution.h |
| index 65a221d9ea896ee0217f95d600dcfc3aaf334690..2d16ee2bc37c096713f894d4fd749a5f2fec92a7 100644 |
| --- a/Source/core/dom/shadow/ContentDistribution.h |
| +++ b/Source/core/dom/shadow/ContentDistribution.h |
| @@ -38,33 +38,36 @@ |
| namespace WebCore { |
| -class ContentDistribution { |
| +class ContentDistribution FINAL { |
| + DISALLOW_ALLOCATION(); |
| public: |
| ContentDistribution() { m_nodes.reserveInitialCapacity(32); } |
| - PassRefPtr<Node> first() const { return m_nodes.first(); } |
| - PassRefPtr<Node> last() const { return m_nodes.last(); } |
| - PassRefPtr<Node> at(size_t index) const { return m_nodes.at(index); } |
| + PassRefPtrWillBeRawPtr<Node> first() const { return m_nodes.first(); } |
| + PassRefPtrWillBeRawPtr<Node> last() const { return m_nodes.last(); } |
| + PassRefPtrWillBeRawPtr<Node> at(size_t index) const { return m_nodes.at(index); } |
| size_t size() const { return m_nodes.size(); } |
| bool isEmpty() const { return m_nodes.isEmpty(); } |
| - void append(PassRefPtr<Node>); |
| + void append(PassRefPtrWillBeRawPtr<Node>); |
| void clear() { m_nodes.clear(); m_indices.clear(); } |
| void shrinkToFit() { m_nodes.shrinkToFit(); } |
| - bool contains(const Node* node) const { return m_indices.contains(node); } |
| + bool contains(const Node* node) const { return m_indices.contains(const_cast<Node*>(node)); } |
| size_t find(const Node*) const; |
| Node* nextTo(const Node*) const; |
| Node* previousTo(const Node*) const; |
| void swap(ContentDistribution& other); |
| - const Vector<RefPtr<Node> >& nodes() const { return m_nodes; } |
| + const WillBeHeapVector<RefPtrWillBeMember<Node> >& nodes() const { return m_nodes; } |
| + |
| + void trace(Visitor*); |
| private: |
| - Vector<RefPtr<Node> > m_nodes; |
| - HashMap<const Node*, size_t> m_indices; |
| + WillBeHeapVector<RefPtrWillBeMember<Node> > m_nodes; |
| + WillBeHeapHashMap<RawPtrWillBeMember<Node>, size_t> m_indices; |
|
haraken
2014/05/12 13:38:35
Shall we keep const?
|
| }; |
| } |