[webkit-dev] Early deletion of DocumentLoader instances
darin at apple.com
Thu May 26 13:01:23 PDT 2011
On May 26, 2011, at 9:52 AM, Adam Barth wrote:
> The original reason why I was excited about changing to locating the DocumentLoader via the Document was to avoid confusing where the Frame now contains a different active DocumentLoader.
Sure, that will be great eventually; I think a document loader and the document it’s loading should be able to find each other without passing through the frame. When we make the change we just have to get the ownership and object lifetimes right and avoid the mistake of adding a pointer without suitable object lifetime tracking.
I think the issue with this patch is not that it was a step in the wrong direction exactly, but that the change wasn’t careful enough about object lifetime. Even if the document loader is at some point changed to have “document-lifetime” roughly speaking, I still don’t think adding a raw pointer to it in the document is likely to be right for teardown and other such edge cases.
More information about the webkit-dev