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

Unified Diff: third_party/WebKit/Source/core/dom/Document.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 | « no previous file | third_party/WebKit/Source/core/dom/NodeListsNodeData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index b2f7a23828522989625d50c2b4ae00d31a76d10b..1d3d38d70650a9b06f4f215596ada050e4ccabe0 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -6626,21 +6626,13 @@ void Document::recordDeferredLoadReason(WouldLoadReason reason) {
}
DEFINE_TRACE_WRAPPERS(Document) {
+ // m_nodeLists are traced in their corresponding NodeListsNodeData, keeping
+ // them only alive for live nodes. Otherwise we would keep lists of dead
+ // nodes alive that have not yet been invalidated.
visitor->traceWrappers(m_importsController);
visitor->traceWrappers(m_implementation);
visitor->traceWrappers(m_styleSheetList);
visitor->traceWrappers(m_styleEngine);
- for (int i = 0; i < numNodeListInvalidationTypes; ++i) {
- for (auto list : m_nodeLists[i]) {
- if (isHTMLCollectionType(list->type())) {
- visitor->traceWrappersWithManualWriteBarrier(
- static_cast<const HTMLCollection*>(list.get()));
- } else {
- visitor->traceWrappersWithManualWriteBarrier(
- static_cast<const LiveNodeList*>(list.get()));
- }
- }
- }
// Cannot trace in Supplementable<Document> as it is part of platform/ and
// thus cannot refer to ScriptWrappableVisitor.
visitor->traceWrappers(
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/NodeListsNodeData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698