Bug 74298 - Web Inspector: report per document JS event listener count
Summary: Web Inspector: report per document JS event listener count
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Yury Semikhatsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-12 08:36 PST by Yury Semikhatsky
Modified: 2011-12-27 09:49 PST (History)
11 users (show)

See Also:


Attachments
Patch (3.37 KB, patch)
2011-12-12 08:55 PST, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (11.43 KB, patch)
2011-12-27 07:00 PST, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (14.46 KB, patch)
2011-12-27 07:26 PST, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (14.46 KB, patch)
2011-12-27 07:28 PST, Yury Semikhatsky
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>