Chromium Code Reviews| Index: Source/core/dom/StaticNodeList.cpp |
| diff --git a/Source/core/dom/StaticNodeList.cpp b/Source/core/dom/StaticNodeList.cpp |
| index ba3cfb3eb59ca0bb56a532997f9c2acc15a33b53..d5b01767deab4146bf13b30e499467c8dd487013 100644 |
| --- a/Source/core/dom/StaticNodeList.cpp |
| +++ b/Source/core/dom/StaticNodeList.cpp |
| @@ -33,10 +33,17 @@ |
| namespace WebCore { |
| -PassRefPtr<StaticNodeList> StaticNodeList::adopt(Vector<RefPtr<Node> >& nodes) |
| +PassRefPtrWillBeRawPtr<StaticNodeList> StaticNodeList::adopt(Vector<RefPtr<Node> >& nodes) |
| { |
| - RefPtr<StaticNodeList> nodeList = adoptRef(new StaticNodeList); |
| + RefPtrWillBeRawPtr<StaticNodeList> nodeList = adoptRefWillBeNoop(new StaticNodeList); |
| +#if ENABLE(OILPAN) |
| + // FIXME: Oilpan: switch to a WillBeHeapVector<RefPtrWillBeMember<>> argument. |
| + for (size_t i = 0; i < nodes.size(); i++) |
|
tkent
2014/05/19 07:23:40
nit: We prefer ++i.
|
| + nodeList->m_nodes.append(nodes[i]); |
| + nodes.clear(); |
| +#else |
| nodeList->m_nodes.swap(nodes); |
| +#endif |
| if (nodeList->AllocationSize() > externalMemoryReportSizeLimit) |
| v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(nodeList->AllocationSize()); |
| return nodeList.release(); |
| @@ -60,4 +67,10 @@ Node* StaticNodeList::item(unsigned index) const |
| return 0; |
| } |
| +void StaticNodeList::trace(Visitor* visitor) |
| +{ |
| + visitor->trace(m_nodes); |
| + NodeList::trace(visitor); |
| +} |
| + |
| } // namespace WebCore |