[Webkit-unassigned] [Bug 30324] Console shows no repeat count when repeatedly logging an Event

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 22 07:24:42 PDT 2009


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


Pavel Feldman <pfeldman at chromium.org> changed:

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




--- Comment #6 from Pavel Feldman <pfeldman at chromium.org>  2009-10-22 07:24:42 PDT ---
(From update of attachment 41544)
Thanks for doing this!

> +        messagesElement.removeChild(messagesElement.lastChild);
> +        messagesElement.appendChild(msg.toMessageElement());

Nit: There is no need to re-create a message, you could provide
updaeRepeatCount on ConsoleMessage that would either update the textContent of
the messageRepeatCountElement or would lazily create it. But this can be a part
of another bug really.

> +        // Increment the error or warning count
> +        switch (msg.level) {
> +        case WebInspector.ConsoleMessage.MessageLevel.Warning:
> +            WebInspector.warnings += msg.repeatDelta;
> +            break;
> +        case WebInspector.ConsoleMessage.MessageLevel.Error:
> +            WebInspector.errors += msg.repeatDelta;
> +            break;
> +        }
> +        
> +        // Add message to the resource panel
> +        if (msg.url in WebInspector.resourceURLMap) {
> +            msg.resource = WebInspector.resourceURLMap[msg.url];
> +            if (WebInspector.panels.resources)
> +                WebInspector.panels.resources.addMessageToResource(msg.resource, msg);
> +        }
> +    },
> +

This looks like a copy-paste from addMessage, I would try to avoid that. First
part with counters makes sense to me, second really does not. We know that
updateRepeatCounter is invoked on identical message, there is nowhere it could
get its url from. It is unlikely that the resource is added after the message
(if it is so - we are in trouble with non-repeating messages). So I suggest
removing the url-related part from here and extracting warning+errors updates
code into a private method. Otherwise r+.

Please make sure WebKitTools/Scripts/run-webkit-tests --debug
LayoutTests/inspector are passing!

-- 
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