[webkit-reviews] review requested: [Bug 17065] [GTK] Use a consistent coding style : [Attachment 18879] Updated again

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Feb 2 22:41:09 PST 2008


Christian Dywan <christian at imendio.com> has asked  for review:
Bug 17065: [GTK] Use a consistent coding style
http://bugs.webkit.org/show_bug.cgi?id=17065

Attachment 18879: Updated again
http://bugs.webkit.org/attachment.cgi?id=18879&action=edit

------- Additional Comments from Christian Dywan <christian at imendio.com>
> Is it conventional to use ->priv instead of
> WEBKIT_WEB_VIEW_GET_PRIVATE()/G_TYPE_INSTANCE_GET_PRIVATE() in GObject
> code? What are your reasons for accessing the struct directly?

Yes, it is conventional in 'modern' code (you can't change old gtk code for the
sake of ABI). The reason is simply efficiency: choose directly using pointers
versus retrieving data dynamically through type safety checks. We *know* what
that pointer is, we defined it. So type checks that tend to be slow are
superfluous.
Incidentally that's the reason for not using
"g_return_if_fail(FOO_IS_BAR(bar))" in static functions.

> So the question is whether core(webView) returning a corePage is sensible
> or bogus. I guess if other ports do it this way (I think they do) there may
> be sense in it, so it may be OK. Thoughts?

The core/ kit mapping is somewhat unusual 'magic'. In fact I would rather tend
to remove it for the slightest doubts, since there is *no* one-to-one mapping
in every case and keeping it only for part of the classes would be confusing.
*If* we use them we really need to do it throughout.
In case of doubt, the most import thing is to either use it or not. If nobody
speaks up about this, we really need to use it consistently instead of keeping
the current mixture even if there are doubts.


More information about the webkit-reviews mailing list