[webkit-dev] RFC: Creating header include policy for Gtk+

Holger Freyther zecke at selfish.org
Sun May 31 00:16:50 PDT 2009

Hey fellow reviewers,

I would like to establish a new policy for the Gtk+ port and use mail to get 
comments and agreement on it.

The problem:
Our header files (*.h) have a lot of include statements. This is a problem 
(specially without using precompiled headers, we don't on Gtk+) because we 
instruct the preprocessor to search for these header files and our compiler 
needs to parse through these. One specific problem we face in the Gtk+ side of 
things are innocently looking includes like cairo.h. cairo-ft.h, gtk/gtk.h. 
They will resolve to a load of other includes... In the case of gtk it is all 
glib headers, all glib-object headers (the two/three), each and every 
GtkWidget, or in the case of cairo-ft we get the whole set of freetype 
headers. This can easily increase the list of to be included files... by one 

The proposed solution and policy:
Ban cairo.h, gtk.h, gdk.h, glib.h, glib-object.h, soup.h from header files and 
replace the structures and inlined calls with forward declaration.

I have created a bug/patch[1] to look at the impact of this new policy and I 
probably still need to show that this approach is any faster.

kind regards

[1] https://bugs.webkit.org/show_bug.cgi?id=26103

More information about the webkit-dev mailing list