[webkit-dev] FYI: Console Message API tweaks.

Mike West mkwst at chromium.org
Tue Dec 11 10:51:34 PST 2012

Hello, lovely WebKit folks.

If you never generate console messages for developers (seriously?), you can
stop reading.

Two changes have landed in the last week or so that I'd like to make you
aware of:

1. Call stacks or url/line numbers will now be autogenerated in the common
case (http://trac.webkit.org/changeset/136657). You should be able to get
away with simply calling `document->addConsoleMessage([MessageSource],
[MessageLevel], [Message])` or `console->addMessage([MessageSource],
[MessageLevel], [Message])` most of the time: if the document is parsing,
you'll get a line number. If it's being called from JavaScript, you'll get
a call stack. It won't solve all of the contextual issues, so you still
_can_ pass in lines or call stacks (see ContentSecurityPolicy for examples
of that), but I hope you won't have to think about it as often.

2. The sharpest among you will have noticed that the MessageType parameter
was missing from those examples above. Assuming
http://trac.webkit.org/changeset/137318 sticks, you don't need it anymore.
I've updated all the existing call sites, and I'm hopeful that the various
ports can check their ChromeClient usage to drop the parameter as well.
Once I have confirmation that it won't break ports, I'll drop the parameter
completely from the external interface.

That's it! The calls are slightly simpler, and should be slightly more

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20121211/ffad1ad4/attachment.html>

More information about the webkit-dev mailing list