[Soup] Simplify the way that requests are started
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Oct 2012 23:12:33 +0000 (23:12 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Oct 2012 23:12:33 +0000 (23:12 +0000)
commit433465fdb51df38367fe78a5316ecc4eb8e396fa
tree7aabae528eb5a645ea41928743049627333e0f35
parent311ca3a227fb2ccc26743b152f52d970ce04aa61
[Soup] Simplify the way that requests are started
https://bugs.webkit.org/show_bug.cgi?id=98532

Reviewed by Gustavo Noronha Silva.

Simplify the creation of the libsoup request and message when kicking off
requests, by elminating a bit of duplicate code.

No new tests. This should not change any behavior.

* platform/network/ResourceHandle.h:
(ResourceHandle):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore):
(WebCore::ResourceHandleInternal::soupSession): Ensure the session
is initialized when passing it to the caller.
(WebCore::createSoupMessageForHandleAndRequest): Added this helper which
takes care of creating the SoupMessage for HTTP/HTTPS requests.
(WebCore::createSoupRequestAndMessageForHandle): Collapsed the HTTP and
non-HTTP request creation into this helper.
(WebCore::ResourceHandle::start): Call the new helper now and then sendPendingRequest.
(WebCore::ResourceHandle::sendPendingRequest): Instead of having special
helpers to create and send the request, duplicating the logic for sending it
across the file, add this method which can be used in both cases.
(WebCore::waitingToSendRequest): Reworked the hasBeenSent method to answer
the question of whether or not the request is ready to be sent, but is unsent.
(WebCore::ResourceHandle::platformSetDefersLoading): Use the new helper.
* platform/network/soup/ResourceRequest.h:
(ResourceRequest): Added a new method for getting the URL string for soup.
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::ResourceRequest::urlStringForSoup): Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130699 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/network/ResourceHandle.h
Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
Source/WebCore/platform/network/soup/ResourceRequest.h
Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp