[webkit-dev] webkit core need to be cleanly separated from "ports", behind a vector table

Amanda Walker amanda at chromium.org
Wed Oct 15 10:21:52 PDT 2008

On Wed, Oct 15, 2008 at 12:04 PM, lkcl <lkcl at lkcl.net> wrote:
> what is there about, for example, the apache2 vector table system,
> where you fill in 28 or so functions in a vector table and hand it back
> to the apache runtime, that makes refactoring and redesign difficult?
> extensions to the table can be done by having a union of structs,
> with an int at the beginning of the table saying "i'm a version 1"
> or "i'm a version 2".
> then, if you have a "version 1"-using-port that connects to a "version 2"
> library, the extra functions that differ from version 1 and 2 will be NULL;
> the version 2 webkit library will go "oh, these are NULL, so we're not
> providing version 2 functionality".

You seem to be reinventing COM.

While there are certainly parts of WebCore and WebKit as a whole where
some well-chosen interfaces would indeed make it easier to develop and
maintain additional platforms and extensions (example: dave hyatt's
recent refactoring of ScrollView and friends), I'm not sure that a
large C-style vector of function pointers for all of WebKit is an
effective way to accomplish this.

> far from making it _more_ difficult to do a redesign, such techniques
> would make it _easier_ i believe.

Do you have a proof of concept?  Comparing approaches is always easier
with a concrete example than with abstract descriptions.

If nothing else, that would help validate your assertion that it would
be easy to implement this way :-).

Amanda Walker
amanda at chromium.org

More information about the webkit-dev mailing list