| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "core/dom/shadow/InsertionPoint.h" | 29 #include "core/dom/shadow/InsertionPoint.h" |
| 30 | 30 |
| 31 namespace blink { | 31 namespace blink { |
| 32 | 32 |
| 33 void DistributedNodes::swap(DistributedNodes& other) | 33 void DistributedNodes::swap(DistributedNodes& other) |
| 34 { | 34 { |
| 35 m_nodes.swap(other.m_nodes); | 35 m_nodes.swap(other.m_nodes); |
| 36 m_indices.swap(other.m_indices); | 36 m_indices.swap(other.m_indices); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void DistributedNodes::append(PassRefPtrWillBeRawPtr<Node> node) | 39 void DistributedNodes::append(RawPtr<Node> node) |
| 40 { | 40 { |
| 41 ASSERT(node); | 41 ASSERT(node); |
| 42 ASSERT(!node->isSlotOrActiveInsertionPoint()); | 42 ASSERT(!node->isSlotOrActiveInsertionPoint()); |
| 43 size_t size = m_nodes.size(); | 43 size_t size = m_nodes.size(); |
| 44 m_indices.set(node.get(), size); | 44 m_indices.set(node.get(), size); |
| 45 m_nodes.append(node); | 45 m_nodes.append(node); |
| 46 } | 46 } |
| 47 | 47 |
| 48 size_t DistributedNodes::find(const Node* node) const | 48 size_t DistributedNodes::find(const Node* node) const |
| 49 { | 49 { |
| 50 WillBeHeapHashMap<RawPtrWillBeMember<const Node>, size_t>::const_iterator it
= m_indices.find(node); | 50 HeapHashMap<Member<const Node>, size_t>::const_iterator it = m_indices.find(
node); |
| 51 if (it == m_indices.end()) | 51 if (it == m_indices.end()) |
| 52 return kNotFound; | 52 return kNotFound; |
| 53 | 53 |
| 54 return it.get()->value; | 54 return it.get()->value; |
| 55 } | 55 } |
| 56 | 56 |
| 57 Node* DistributedNodes::nextTo(const Node* node) const | 57 Node* DistributedNodes::nextTo(const Node* node) const |
| 58 { | 58 { |
| 59 size_t index = find(node); | 59 size_t index = find(node); |
| 60 if (index == kNotFound || index + 1 == size()) | 60 if (index == kNotFound || index + 1 == size()) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 72 | 72 |
| 73 DEFINE_TRACE(DistributedNodes) | 73 DEFINE_TRACE(DistributedNodes) |
| 74 { | 74 { |
| 75 #if ENABLE(OILPAN) | 75 #if ENABLE(OILPAN) |
| 76 visitor->trace(m_nodes); | 76 visitor->trace(m_nodes); |
| 77 visitor->trace(m_indices); | 77 visitor->trace(m_indices); |
| 78 #endif | 78 #endif |
| 79 } | 79 } |
| 80 | 80 |
| 81 } // namespace blink | 81 } // namespace blink |
| OLD | NEW |