Changeset 160961 in webkit


Ignore:
Timestamp:
Dec 21, 2013 12:51:07 AM (10 years ago)
Author:
Carlos Garcia Campos
Message:

[SOUP] ResourceHandleSoup should use async client callbacks when client uses async callbacks
https://bugs.webkit.org/show_bug.cgi?id=126006

Reviewed by Martin Robinson.

This fixes WebKit2 loader client unit tests when using the network
process.

  • platform/network/ResourceHandle.cpp:
  • platform/network/soup/ResourceHandleSoup.cpp:

(WebCore::doRedirect): Call willSendRequestAsync on the client
when usesAsyncCallbacks returns true.
(WebCore::nextMultipartResponsePartCallback): Call
didReceiveResponseAsync on the client when usesAsyncCallbacks
returns true.
(WebCore::sendRequestCallback): Ditto.
(WebCore::ResourceHandle::continueWillSendRequest): Empty
implementation for now because the default one asserts.
(WebCore::ResourceHandle::continueDidReceiveResponse): Ditto.
(WebCore::ResourceHandle::continueShouldUseCredentialStorage): Ditto.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r160959 r160961  
     12013-12-21  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [SOUP] ResourceHandleSoup should use async client callbacks when client uses async callbacks
     4        https://bugs.webkit.org/show_bug.cgi?id=126006
     5
     6        Reviewed by Martin Robinson.
     7
     8        This fixes WebKit2 loader client unit tests when using the network
     9        process.
     10
     11        * platform/network/ResourceHandle.cpp:
     12        * platform/network/soup/ResourceHandleSoup.cpp:
     13        (WebCore::doRedirect): Call willSendRequestAsync on the client
     14        when usesAsyncCallbacks returns true.
     15        (WebCore::nextMultipartResponsePartCallback): Call
     16        didReceiveResponseAsync on the client when usesAsyncCallbacks
     17        returns true.
     18        (WebCore::sendRequestCallback): Ditto.
     19        (WebCore::ResourceHandle::continueWillSendRequest): Empty
     20        implementation for now because the default one asserts.
     21        (WebCore::ResourceHandle::continueDidReceiveResponse): Ditto.
     22        (WebCore::ResourceHandle::continueShouldUseCredentialStorage): Ditto.
     23
    1242013-12-20  Anders Carlsson  <andersca@apple.com>
    225
  • trunk/Source/WebCore/platform/network/ResourceHandle.cpp

    r160467 r160961  
    148148}
    149149
    150 #if !PLATFORM(MAC) && !USE(CFNETWORK)
     150#if !PLATFORM(MAC) && !USE(CFNETWORK) && !USE(SOUP)
    151151// ResourceHandle never uses async client calls on these platforms yet.
    152152void ResourceHandle::continueWillSendRequest(const ResourceRequest&)
  • trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp

    r160757 r160961  
    512512    newRequest.removeCredentials();
    513513
    514     d->client()->willSendRequest(handle, newRequest, d->m_response);
     514    if (d->client()->usesAsyncCallbacks())
     515        d->client()->willSendRequestAsync(handle, newRequest, d->m_response);
     516    else
     517        d->client()->willSendRequest(handle, newRequest, d->m_response);
    515518    handle->sendPendingRequest();
    516519}
     
    650653    d->m_response.updateFromSoupMessageHeaders(soup_multipart_input_stream_get_headers(d->m_multipartInputStream.get()));
    651654
    652     handle->client()->didReceiveResponse(handle.get(), d->m_response);
     655    if (handle->client()->usesAsyncCallbacks())
     656        handle->client()->didReceiveResponseAsync(handle.get(), d->m_response);
     657    else
     658        handle->client()->didReceiveResponse(handle.get(), d->m_response);
    653659
    654660    if (handle->cancelledOrClientless()) {
     
    717723    }
    718724
    719     handle->client()->didReceiveResponse(handle.get(), d->m_response);
     725    if (d->client()->usesAsyncCallbacks())
     726        handle->client()->didReceiveResponseAsync(handle.get(), d->m_response);
     727    else
     728        handle->client()->didReceiveResponse(handle.get(), d->m_response);
    720729
    721730    if (handle->cancelledOrClientless()) {
     
    13711380}
    13721381
     1382void ResourceHandle::continueWillSendRequest(const ResourceRequest& request)
     1383{
     1384    ASSERT(client());
     1385    ASSERT(client()->usesAsyncCallbacks());
     1386    // FIXME: Implement this method if needed: https://bugs.webkit.org/show_bug.cgi?id=126114.
     1387}
     1388
     1389void ResourceHandle::continueDidReceiveResponse()
     1390{
     1391    ASSERT(client());
     1392    ASSERT(client()->usesAsyncCallbacks());
     1393    // FIXME: Implement this method if needed: https://bugs.webkit.org/show_bug.cgi?id=126114.
     1394}
     1395
     1396void ResourceHandle::continueShouldUseCredentialStorage(bool)
     1397{
     1398    ASSERT(client());
     1399    ASSERT(client()->usesAsyncCallbacks());
     1400    // FIXME: Implement this method if needed: https://bugs.webkit.org/show_bug.cgi?id=126114.
     1401}
     1402
    13731403static gboolean requestTimeoutCallback(gpointer data)
    13741404{
Note: See TracChangeset for help on using the changeset viewer.