Lack of PageClient causes a few woes all over the place. Esthetically speaking, passing of all the client objects to the PageClient is really awkward plus it makes memory managment very unintuitive (users create clients and pass them to the Page and Page steals them and takes over owenership). The attached patch introduces PageClient which acts as a manager/factory for other client objects, and also makes it a lot clearer that Page is owning them.
Created attachment 12625 [details] PageClient
You probably want to update change the copyright information to say 2007.
I don't think this patch is right. First, a Page does *not* own its clients. One WebKit design might delete the client when the page was done with it, but another might reuse a single client for all pages, while another still might have a client that needed to outlive its page. The whole notion of a Page owning a client contradicts the name "client." Second, a "client client" is an extra level of indirection which, to me, makes things more awkward, not less. In the current design, whoever constructs a Page needs to know how to construct the Page's clients. In the "client client" design, whoever constructed a Page would need to know to construct a mediating object that would know how to construct the Page's clients at some arbitrary future date.
Comment on attachment 12625 [details] PageClient I have the same basic thoughts about this as Geoff. I think the extra level of indirection just makes things more complicated.
First, current behavior of clients staying beyond the lifecycle of the Page is in no way affected by this patch. Second, the notion of having one codepath that knows how to construct clients is cleaner than having the same code spread in the master object that happens to be creating the Page. The patch was meant to cleanup the Page constructor which is only going to get worse and it does that. If you don't like it, that's fine I won't be pushing it, but at least lets reject it because we don't like it not because of non-existant problems.
This bug has been open for 6 years and is not going to be fixed. Let's just close it.