| Index: Source/core/dom/StaticNodeList.cpp
|
| diff --git a/Source/core/dom/StaticNodeList.cpp b/Source/core/dom/StaticNodeList.cpp
|
| index d9bf28e1f5b79c2b34f86d8b8b2268616c95d605..ba3cfb3eb59ca0bb56a532997f9c2acc15a33b53 100644
|
| --- a/Source/core/dom/StaticNodeList.cpp
|
| +++ b/Source/core/dom/StaticNodeList.cpp
|
| @@ -33,6 +33,21 @@
|
|
|
| namespace WebCore {
|
|
|
| +PassRefPtr<StaticNodeList> StaticNodeList::adopt(Vector<RefPtr<Node> >& nodes)
|
| +{
|
| + RefPtr<StaticNodeList> nodeList = adoptRef(new StaticNodeList);
|
| + nodeList->m_nodes.swap(nodes);
|
| + if (nodeList->AllocationSize() > externalMemoryReportSizeLimit)
|
| + v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(nodeList->AllocationSize());
|
| + return nodeList.release();
|
| +}
|
| +
|
| +StaticNodeList::~StaticNodeList()
|
| +{
|
| + if (AllocationSize() > externalMemoryReportSizeLimit)
|
| + v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-AllocationSize());
|
| +}
|
| +
|
| unsigned StaticNodeList::length() const
|
| {
|
| return m_nodes.size();
|
|
|