Chromium Code Reviews| Index: Source/core/dom/shadow/ElementShadow.cpp |
| diff --git a/Source/core/dom/shadow/ElementShadow.cpp b/Source/core/dom/shadow/ElementShadow.cpp |
| index cece712f403eb17c319f79ff2a15ae507020ccdb..ab56ed8898de93aee92423938f52ac2fe9d6e5d9 100644 |
| --- a/Source/core/dom/shadow/ElementShadow.cpp |
| +++ b/Source/core/dom/shadow/ElementShadow.cpp |
| @@ -38,7 +38,8 @@ |
| namespace WebCore { |
| -class DistributionPool { |
| +class DistributionPool FINAL { |
| + STACK_ALLOCATED(); |
| public: |
| explicit DistributionPool(const ContainerNode&); |
| void clear(); |
| @@ -48,8 +49,8 @@ public: |
| private: |
| void detachNonDistributedNodes(); |
| - Vector<Node*, 32> m_nodes; |
| - Vector<bool, 32> m_distributed; |
| + WillBeHeapVector<RawPtrWillBeMember<Node>, 32> m_nodes; |
| + WillBeHeapVector<bool, 32> m_distributed; |
|
haraken
2014/05/12 12:21:38
I'm not sure of this. Do we want to move vectors o
sof
2014/05/12 12:37:49
Yes, let's not do this.
|
| }; |
| inline DistributionPool::DistributionPool(const ContainerNode& parent) |
| @@ -239,14 +240,14 @@ bool ElementShadow::hasSameStyles(const ElementShadow* other) const |
| const InsertionPoint* ElementShadow::finalDestinationInsertionPointFor(const Node* key) const |
| { |
| ASSERT(key && !key->document().childNeedsDistributionRecalc()); |
| - NodeToDestinationInsertionPoints::const_iterator it = m_nodeToInsertionPoints.find(key); |
| + NodeToDestinationInsertionPoints::const_iterator it = m_nodeToInsertionPoints.find(const_cast<Node*>(key)); |
| return it == m_nodeToInsertionPoints.end() ? 0: it->value.last().get(); |
| } |
| const DestinationInsertionPoints* ElementShadow::destinationInsertionPointsFor(const Node* key) const |
| { |
| ASSERT(key && !key->document().childNeedsDistributionRecalc()); |
| - NodeToDestinationInsertionPoints::const_iterator it = m_nodeToInsertionPoints.find(key); |
| + NodeToDestinationInsertionPoints::const_iterator it = m_nodeToInsertionPoints.find(const_cast<Node*>(key)); |
| return it == m_nodeToInsertionPoints.end() ? 0: &it->value; |
| } |
| @@ -258,7 +259,7 @@ void ElementShadow::distribute() |
| for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) { |
| HTMLShadowElement* shadowInsertionPoint = 0; |
| - const Vector<RefPtr<InsertionPoint> >& insertionPoints = root->descendantInsertionPoints(); |
| + const WillBeHeapVector<RefPtrWillBeMember<InsertionPoint> >& insertionPoints = root->descendantInsertionPoints(); |
| for (size_t i = 0; i < insertionPoints.size(); ++i) { |
| InsertionPoint* point = insertionPoints[i].get(); |
| if (!point->isActive()) |
| @@ -295,7 +296,7 @@ void ElementShadow::distribute() |
| void ElementShadow::didDistributeNode(const Node* node, InsertionPoint* insertionPoint) |
| { |
| - NodeToDestinationInsertionPoints::AddResult result = m_nodeToInsertionPoints.add(node, DestinationInsertionPoints()); |
| + NodeToDestinationInsertionPoints::AddResult result = m_nodeToInsertionPoints.add(const_cast<Node*>(node), DestinationInsertionPoints()); |
| result.storedValue->value.append(insertionPoint); |
| } |
| @@ -355,6 +356,7 @@ void ElementShadow::clearDistribution() |
| void ElementShadow::trace(Visitor* visitor) |
| { |
| + visitor->trace(m_nodeToInsertionPoints); |
| // Shadow roots are linked with previous and next pointers which are traced. |
| // It is therefore enough to trace one of the shadow roots here and the |
| // rest will be traced from there. |