[webkit-dev] Some thoughts about platform flags

Amanda Walker amanda at chromium.org
Wed Sep 24 13:11:26 PDT 2008

On Wed, Sep 24, 2008 at 3:35 PM, Darin Adler <darin at apple.com> wrote:
> It's really hard to usefully discuss this in the abstract. Can we start with a particular example where PLATFORM(CHROMIUM) is being used, but where the code in question is really more of a "don't crawl a view hierarchy" change rather than a truly Chromium-specific change?

Hmm.  I'll try to find one, though right now I think Chromium is the
only port that also wants to define PLATFORM(MAC), so it could be
argued that they're all Chromium-specific :-).

The objection that came up in the bug, as I read it, was the idea that
we shouldn't be defining PLATFORM(MAC) at all, even though we do want
to use as much of the CoreGraphics and Cocoa code in WebCore as we
can, since "PLATFORM(MAC)" can be interpreted as "Apple's Mac port".
The example that's going to come up very soon, for example, is
ScrollView, where we will want to not define or call
ScrollView::getDocumentView() even though PLATFORM(MAC) is defined.
Our initial approach is to change the #if in ScrollView.h to add "&&
!PLATFORM(CHROMIUM)" (and then have a different ScrollView
implentation file), with other tests at call sites if needed (though
we're trying to avoid sprinkling around yet more platform #ifs)

Does that help describe the issue?


More information about the webkit-dev mailing list