Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
static void contentSniffedCallback(SoupMessage* msg, const char* sniffedType, GHashTable *params, gpointer data)
{
    if (sniffedType) {
        const char* officialType = soup_message_headers_get_one(msg->response_headers, "Content-Type");

        if (!officialType || strcmp(officialType, sniffedType))
            soup_message_headers_set_content_type(msg->response_headers, sniffedType, params);
    }

    if (statusWillBeHandledBySoup(msg->status_code))
        return;

    RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(data);
    if (!handle)
        return;
    ResourceHandleInternal* d = handle->getInternal();
    if (d->m_cancelled)
        return;
    ResourceHandleClient* client = handle->client();
    if (!client)
        return;

    ASSERT(d->m_response.isNull());

    fillResponseFromMessage(msg, &d->m_response);
    client->didReceiveResponse(handle.get(), d->m_response);
}
// This callback will not be called if the content sniffer is disabled in startHTTPRequest.
This callback will not be called if the content sniffer is disabled in startHTTPRequest.
This callback will not be called if the content sniffer is disabled in startHTTPRequest .
static void contentSniffedCallback(SoupMessage* msg, const char* sniffedType, GHashTable *params, gpointer data)
{
    if (sniffedType) {
        const char* officialType = soup_message_headers_get_one(msg->response_headers, "Content-Type");
        if (!officialType || strcmp(officialType, sniffedType))
            soup_message_headers_set_content_type(msg->response_headers, sniffedType, params);
    }
    if (statusWillBeHandledBySoup(msg->status_code))
        return;
    RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(data);
    if (!handle)
        return;
    ResourceHandleInternal* d = handle->getInternal();
    if (d->m_cancelled)
        return;
    ResourceHandleClient* client = handle->client();
    if (!client)
        return;
    ASSERT(d->m_response.isNull());
    fillResponseFromMessage(msg, &d->m_response);
    client->didReceiveResponse(handle.get(), d->m_response);
}
static void contentSniffedCallback ( SoupMessage * msg , const char * sniffedType , GHashTable * params , gpointer data ) { if ( sniffedType ) { const char * officialType = soup_message_headers_get_one ( msg -> response_headers , " " ) ; if ( ! officialType || strcmp ( officialType , sniffedType ) ) soup_message_headers_set_content_type ( msg -> response_headers , sniffedType , params ) ; } if ( statusWillBeHandledBySoup ( msg -> status_code ) ) return ; RefPtr < ResourceHandle > handle = static_cast < ResourceHandle * > ( data ) ; if ( ! handle ) return ; ResourceHandleInternal * d = handle -> getInternal ( ) ; if ( d -> m_cancelled ) return ; ResourceHandleClient * client = handle -> client ( ) ; if ( ! client ) return ; ASSERT ( d -> m_response . isNull ( ) ) ; fillResponseFromMessage ( msg , & d -> m_response ) ; client -> didReceiveResponse ( handle . get ( ) , d -> m_response ) ; }
This callback will not be called if the content sniffer is disabled in startHTTPRequest.
This callback will not be called if the content sniffer is disabled in startHTTPRequest .