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

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

Issue 2809183003: [wrapper-tracing] Fix node list leak (Closed)
Patch Set: Addressed comments. 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 5ccb6e9f87ea69123904c4322d14666f57d006b1..1e7cc5ba8c615a9b5cf588cea47eb7a995960096 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* attr_name) {
@@ -51,6 +53,18 @@ DEFINE_TRACE(NodeListsNodeData) {
DEFINE_TRACE_WRAPPERS(NodeListsNodeData) {
visitor->TraceWrappersWithManualWriteBarrier(child_node_list_);
+ for (const auto list : atomic_name_caches_.Values()) {
+ if (IsHTMLCollectionType(list->GetType())) {
+ visitor->TraceWrappersWithManualWriteBarrier(
+ static_cast<const HTMLCollection*>(list.Get()));
+ } else {
+ visitor->TraceWrappersWithManualWriteBarrier(
+ static_cast<const LiveNodeList*>(list.Get()));
+ }
+ }
+ for (const auto list : tag_collection_cache_ns_.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