Memory agent should report per document JS event listener count.
Created attachment 118802 [details] Patch
(In reply to comment #1) > Created an attachment (id=118802) [details] > Patch This patch will not report listeners set on document.body element since they are forwarded to corresponding DOMWindow object. We may show DOMWindow as a separate entity under Document(if it is still reacgable from the Document) in the memory report or even try to collect separate statistics on DOMWindows.
Comment on attachment 118802 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=118802&action=review > Source/WebCore/inspector/InspectorMemoryAgent.cpp:114 > + EventListenerIterator iterator(node); similarly to the nameToCount you could introduce eventTypeToCount here and use return by-type stats (as in InspectorDOMAgent:742) > Source/WebCore/inspector/InspectorMemoryAgent.cpp:117 > + result++; ++result;
Created attachment 120586 [details] Patch
(In reply to comment #3) > (From update of attachment 118802 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=118802&action=review > > > Source/WebCore/inspector/InspectorMemoryAgent.cpp:114 > > + EventListenerIterator iterator(node); > > similarly to the nameToCount you could introduce eventTypeToCount here and use return by-type stats (as in InspectorDOMAgent:742) Done. > > > Source/WebCore/inspector/InspectorMemoryAgent.cpp:117 > > + result++; > > ++result; Done.
Created attachment 120588 [details] Patch
Created attachment 120589 [details] Patch
Committed r103709: <http://trac.webkit.org/changeset/103709>
The test added by this patch is failing on all bots: http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=inspector%2Fdom-statistics.html&group=%40ToT%20-%20webkit.org