| Index: Source/core/dom/StaticNodeList.cpp
|
| diff --git a/Source/core/dom/StaticNodeList.cpp b/Source/core/dom/StaticNodeList.cpp
|
| index 10f4b281435a3e49384e2b664f5b2cf438cb5587..addd65dc52486dcb3329de80237d5fabab69bf07 100644
|
| --- a/Source/core/dom/StaticNodeList.cpp
|
| +++ b/Source/core/dom/StaticNodeList.cpp
|
| @@ -31,8 +31,23 @@
|
|
|
| #include "core/dom/Element.h"
|
|
|
| +#include <v8.h>
|
| +
|
| namespace WebCore {
|
|
|
| +PassRefPtr<StaticNodeList> StaticNodeList::adopt(Vector<RefPtr<Node> >& nodes)
|
| +{
|
| + RefPtr<StaticNodeList> nodeList = adoptRef(new StaticNodeList);
|
| + nodeList->m_nodes.swap(nodes);
|
| + v8::V8::AdjustAmountOfExternalAllocatedMemory(nodeList->m_nodes.capacity() * sizeof(RefPtr<Node>));
|
| + return nodeList.release();
|
| +}
|
| +
|
| +StaticNodeList::~StaticNodeList()
|
| +{
|
| + v8::V8::AdjustAmountOfExternalAllocatedMemory(-static_cast<int>(m_nodes.capacity() * sizeof(RefPtr<Node>)));
|
| +}
|
| +
|
| unsigned StaticNodeList::length() const
|
| {
|
| return m_nodes.size();
|
|
|