[webkit-dev] null clients of Page

Dean Jackson dino at apple.com
Mon Aug 16 21:43:43 PDT 2010

It was suggested I bring this to webkit-dev.

There was some recent work to move the many parameters passed to the Page constructor into a single PageClients structure. The current assumption is that if a feature is enabled (at runtime or compile time) then Page will always get a non-null client for that feature.

This allows the Page constructor to have something like this:

, m_deviceMotionController(RuntimeEnabledFeatures::deviceMotionEnabled() ? n
ew DeviceMotionController(pageClients.deviceMotionClient) : 0)

and DeviceMotionController's constructor has an ASSERT(m_client).

The problem is that not every Page needs every client. SVGImage, for example, creates a Page without all clients. Some platform ports branch around this code. The current solution is to create EmptyClient implementations.


Related discussion: https://lists.webkit.org/pipermail/webkit-dev/2010-July/013597.html

Wouldn't it be easier to allow null clients than to have these EmptyClient implementations? 


More information about the webkit-dev mailing list