[webkit-dev] Some thoughts about platform flags

Amanda Walker amanda at chromium.org
Wed Sep 24 12:14:58 PDT 2008


Hello all,
A conversation started on https://bugs.webkit.org/show_bug.cgi?id=20890 that
Alexey suggested moving to webkit-dev, so here we go :-).

One of the things we ran into when bringing up the Chromium application
architecture was that we needed to distinguish between "platform" and
"application features".  We took our cue from Apple's combination of using
PLATFORM(WIN) + PLATFORM(CG) for their windows port, and created
PLATFORM(SKIA) for the graphics library we're using, and have started using
PLATFORM(CHROMIUM) to denote "hosted in a rendering subprocess, not a
conventional view hierarchy" independently of the OS and graphics API.

So for example, we'd like to continue to use PLATFORM(CG) to denote "we're
using CoreGraphics", PLATFORM(MAC) to denote "we're building for Mac OS X",
but add build-time control over things (primarily in WebCore) that make
application assumptions like "crawl up the view hierarchy, test to see if
our grandparent view is a particular class, and send it a message".  We've
been intending to use PLATFORM(CHROMIUM) for a bunch of this, but since the
same issues are likely to come up for other ports (embedded ports, a
variation on an existing platform that wants to render directly to a bitmap
or texture, etc.), it would be great to get input from others, especially
people working on other platforms & ports.

We'll probably continue with our current approach for the moment, since it
does have precedent, but we won't be the last to run into this issue, so if
there's a better way, We'd love to start figuring out what it would be.


Amanda Walker <amanda at chromium.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.webkit.org/pipermail/webkit-dev/attachments/20080924/89c152a3/attachment.html 


More information about the webkit-dev mailing list