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

Unified Diff: third_party/WebKit/Source/core/dom/NodeListsNodeData.cpp

Issue 2810253003: [wrapper-tracing] Fix node list leak (Closed)
Patch Set: Created 3 years, 8 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 | « third_party/WebKit/Source/core/dom/NodeListsNodeData.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/NodeListsNodeData.cpp
diff --git a/third_party/WebKit/Source/core/dom/NodeListsNodeData.cpp b/third_party/WebKit/Source/core/dom/NodeListsNodeData.cpp
index 44b990ed159b10058f37c65c2e180572cd6d7c76..582eba6812270f939d22c4c1c1a104cad87e6906 100644
--- a/third_party/WebKit/Source/core/dom/NodeListsNodeData.cpp
+++ b/third_party/WebKit/Source/core/dom/NodeListsNodeData.cpp
@@ -30,6 +30,8 @@
#include "core/dom/NodeListsNodeData.h"
+#include "core/dom/LiveNodeList.h"
+
namespace blink {
void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName) {
@@ -51,6 +53,18 @@ DEFINE_TRACE(NodeListsNodeData) {
DEFINE_TRACE_WRAPPERS(NodeListsNodeData) {
visitor->traceWrappersWithManualWriteBarrier(m_childNodeList);
+ for (const auto list : m_atomicNameCaches.values()) {
+ if (isHTMLCollectionType(list->type())) {
+ visitor->traceWrappersWithManualWriteBarrier(
+ static_cast<const HTMLCollection*>(list.get()));
+ } else {
+ visitor->traceWrappersWithManualWriteBarrier(
+ static_cast<const LiveNodeList*>(list.get()));
+ }
+ }
+ for (const auto list : m_tagCollectionCacheNS.values()) {
+ visitor->traceWrappersWithManualWriteBarrier(list.get());
+ }
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/NodeListsNodeData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698