If the ResourceHandleClient does not support accepting data array, we call its didReceiveData() method in a loop. Instead of doing that we should coalesce all the elements in the array and call didReceiveData once.
Created attachment 99651 [details]
Comment on attachment 99651 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=99651&action=review
> + the data buffers into one anc all it with all the data at once.
> - // The call to didReceiveData below could cancel a load, which would result in the delegate
> - // (self) being released.
Perhaps this is worth replacing with a comment where there is a currently useless return statement saying that at that point self may have been deallocated.
> Instead of doing that we should coalesce all the elements
Why should we do that???
It seems that it would be more straightforward to remove connection:didReceiveDataArray:, and let CFNetwork do the same coalescing itself before calling connection:didReceiveData:.
I discussed this with Alexey offline and explained how we are modifying the else part of
<other clients that don't handle data arrays>
The patch made more sense to him now. He adds "The problem with not coalescing probably comes from TextResourceDecoder, which scans the source multiple times if it gets small chunks."
I'll check in the patch shortly. Thanks for the review, Dan!
Committed r90400: <http://trac.webkit.org/changeset/90400>