[Webkit-unassigned] [Bug 30995] TimelineAgent should not add events to the timeline if there are no event listeners.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Nov 1 11:02:03 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=30995


Timothy Hatcher <timothy at hatcher.name> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #42278|review?                     |review-
               Flag|                            |




--- Comment #2 from Timothy Hatcher <timothy at hatcher.name>  2009-11-01 11:02:02 PDT ---
(From update of attachment 42278)
> +// static

We normally don't add comments like this.


> +inline InspectorTimelineAgent* InspectorTimelineAgent::retrieveIfEventHasListeners(InspectorTimelineAgent* timelineAgent,
> +    const AtomicString& eventType, Node* node, const Vector< RefPtr< ContainerNode > >& ancestors)

Will this be used by other callers later? If not it might be best just to put
this in Node.cpp so there are less headers included by
InspectorTimelineAgent.h.
I can see a variation of this being used by XHRs (we don't want to show
readystate or load records if there are no listeners.)


> +    for (size_t i = ancestors.size(); i; --i) {
> +        ContainerNode* ancestor = ancestors[i - 1].get();
> +        if (ancestor->hasEventListeners(eventType))
> +            return timelineAgent;
> +    }

This is better written as:

    for (ssize_t i = (ancestors.size() - 1); i >= 0; --i) {
        ContainerNode* ancestor = ancestors[i].get();
        if (ancestor->hasEventListeners(eventType))
            return timelineAgent;
    }

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list