Chromium Code Reviews| Index: Source/core/dom/shadow/ContentDistribution.cpp |
| diff --git a/Source/core/dom/shadow/ContentDistribution.cpp b/Source/core/dom/shadow/ContentDistribution.cpp |
| index a53ff57b81b0ce149d5c118210d4e70968ef7032..d94020317ee62b52d4e2108fc63a6547eb9bbb30 100644 |
| --- a/Source/core/dom/shadow/ContentDistribution.cpp |
| +++ b/Source/core/dom/shadow/ContentDistribution.cpp |
| @@ -37,7 +37,7 @@ void ContentDistribution::swap(ContentDistribution& other) |
| m_indices.swap(other.m_indices); |
| } |
| -void ContentDistribution::append(PassRefPtr<Node> node) |
| +void ContentDistribution::append(PassRefPtrWillBeRawPtr<Node> node) |
| { |
| ASSERT(node); |
| ASSERT(!isActiveInsertionPoint(*node)); |
| @@ -48,7 +48,7 @@ void ContentDistribution::append(PassRefPtr<Node> node) |
| size_t ContentDistribution::find(const Node* node) const |
| { |
| - HashMap<const Node*, size_t>::const_iterator it = m_indices.find(node); |
| + WillBeHeapHashMap<RawPtrWillBeMember<Node>, size_t>::const_iterator it = m_indices.find(const_cast<Node*>(node)); |
|
haraken
2014/05/12 13:38:35
It would be great if we don't need const_cast.
|
| if (it == m_indices.end()) |
| return kNotFound; |
| @@ -57,7 +57,7 @@ size_t ContentDistribution::find(const Node* node) const |
| Node* ContentDistribution::nextTo(const Node* node) const |
| { |
| - size_t index = find(node); |
| + size_t index = find(const_cast<Node*>(node)); |
| if (index == kNotFound || index + 1 == size()) |
| return 0; |
| return at(index + 1).get(); |
| @@ -65,10 +65,16 @@ Node* ContentDistribution::nextTo(const Node* node) const |
| Node* ContentDistribution::previousTo(const Node* node) const |
| { |
| - size_t index = find(node); |
| + size_t index = find(const_cast<Node*>(node)); |
| if (index == kNotFound || !index) |
| return 0; |
| return at(index - 1).get(); |
| } |
| +void ContentDistribution::trace(Visitor* visitor) |
| +{ |
| + visitor->trace(m_nodes); |
| + visitor->trace(m_indices); |
| +} |
| + |
| } // namespace WebCore |