Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Unified Diff: Source/core/dom/StaticNodeList.cpp

Issue 280123002: Oilpan: move LiveNodeList collections to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have NodeRareData clear out NodeListsNodeData instead. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/StaticNodeList.h ('k') | Source/core/dom/TagCollection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/StaticNodeList.cpp
diff --git a/Source/core/dom/StaticNodeList.cpp b/Source/core/dom/StaticNodeList.cpp
index ba3cfb3eb59ca0bb56a532997f9c2acc15a33b53..4e71464fa378f4ae0747868f90e3e16420b5ef5b 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)
+ 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
« no previous file with comments | « Source/core/dom/StaticNodeList.h ('k') | Source/core/dom/TagCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698