[webkit-dev] Clients and the Page constructor

Steve Block steveblock at google.com
Wed Jul 21 08:47:41 PDT 2010


Currently, nine clients are passed to the Page constructor and the
number is growing. Recently, clients have been added for Geolocation,
DeviceOrientation and BackForwardController. This approach doesn't
seem scalable.

Instead, I'd like to suggest that clients, at least those for optional
features, are not passed to the Page constructor. Instead, the client
should default to null and can be set with an explicit method call, eg
page->setFooClient(client) or
page->getFooController()->setClient(client). This is the approach that
was taken for SpeechInput in http://trac.webkit.org/changeset/63230.
If there are no objections, I'll send patches to make this change for
Geolocation and DeviceOrientation.

For reference, see the discussion in
https://bugs.webkit.org/show_bug.cgi?id=39589.

Thanks,
Steve


More information about the webkit-dev mailing list