[Webkit-unassigned] [Bug 126006] [SOUP] ResourceHandleSoup should use async client callbacks when client uses async callbacks

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 20 01:36:41 PST 2013


https://bugs.webkit.org/show_bug.cgi?id=126006





--- Comment #6 from Carlos Garcia Campos <cgarcia at igalia.com>  2013-12-20 01:34:44 PST ---
(In reply to comment #3)
> (From update of attachment 219671 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=219671&action=review
> 
> > Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:518
> > -    d->client()->willSendRequest(handle, newRequest, d->m_response);
> > +    if (d->client()->usesAsyncCallbacks())
> > +        d->client()->willSendRequestAsync(handle, newRequest, d->m_response);
> > +    else
> > +        d->client()->willSendRequest(handle, newRequest, d->m_response);
> >      handle->sendPendingRequest();
> 
> I think I don't totally understand the purpose of the asynchronous versions of these methods. We send the request immediately (as does the CFNet ResourceHandle) instead of waiting until the asynchronous callback. Do you have any insight into why these asynchronous versions exist?

This is because in the network process, the ResourceHandleClient (implemented by NetworkResourceLoader) only uses the async versions of the callbacks (usesAsyncCallbacks returns true). So, if the client uses async callbacks, calling, for example, didReceiveResponse has no effect, because it's not handled, the version didReceiveResponseAsync is the one implemented in NetworkResourceLoader. I think mac uses a different thread to implement the network callback asynchronously, but our implementation has always been async using the main loop instead. I think the only continueFoo that we need to implement is continueWillSendRequest, because the request might have changed (note that willSendRequest, the one that allows the user to change the request happens in the web process so it still works), in the other cases we don't need them. Note that loader client pass now, and also most of the resource load client test as well.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list