Bug 74298

Summary: Web Inspector: report per document JS event listener count
Product: WebKit Reporter: Yury Semikhatsky <yurys>
Component: Web Inspector (Deprecated)Assignee: Yury Semikhatsky <yurys>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, rniwa, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch pfeldman: review+

Description Yury Semikhatsky 2011-12-12 08:36:58 PST
Memory agent should report per document JS event listener count.
Comment 1 Yury Semikhatsky 2011-12-12 08:55:06 PST
Created attachment 118802 [details]
Patch
Comment 2 Yury Semikhatsky 2011-12-12 08:58:19 PST
(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 3 Pavel Feldman 2011-12-12 10:39:53 PST
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;
Comment 4 Yury Semikhatsky 2011-12-27 07:00:47 PST
Created attachment 120586 [details]
Patch
Comment 5 Yury Semikhatsky 2011-12-27 07:01:12 PST
(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.
Comment 6 Yury Semikhatsky 2011-12-27 07:26:34 PST
Created attachment 120588 [details]
Patch
Comment 7 Yury Semikhatsky 2011-12-27 07:28:08 PST
Created attachment 120589 [details]
Patch
Comment 8 Yury Semikhatsky 2011-12-27 08:22:17 PST
Committed r103709: <http://trac.webkit.org/changeset/103709>