Changeset 230635 in webkit


Ignore:
Timestamp:
Apr 13, 2018 9:48:56 AM (6 years ago)
Author:
dbates@webkit.org
Message:

Inline NetworkLoad::sharedWillSendRedirectedRequest() into NetworkLoad::willPerformHTTPRedirection()
https://bugs.webkit.org/show_bug.cgi?id=184593

Reviewed by Alex Christensen.

Following the removal of the pre-Network Session code in r227364, NetworkLoad::sharedWillSendRedirectedRequest()
is only referenced from NetworkLoad::willPerformHTTPRedirection(). We should inline its
implementation into the NetworkLoad::willPerformHTTPRedirection(), remove a function call,
and the cognitive load to follow such a function call when reading the code.

No functionality changed. So, no new tests.

  • NetworkProcess/NetworkLoad.cpp:

(WebKit::NetworkLoad::willPerformHTTPRedirection): Moved the implementation of NetworkLoad::sharedWillSendRedirectedRequest()
into this function.
(WebKit::NetworkLoad::sharedWillSendRedirectedRequest): Deleted. Moved its implementation
into NetworkLoad::willPerformHTTPRedirection().

  • NetworkProcess/NetworkLoad.h:
Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r230633 r230635  
     12018-04-13  Daniel Bates  <dabates@apple.com>
     2
     3        Inline NetworkLoad::sharedDidReceiveResponse() into NetworkLoad::notifyDidReceiveResponse()
     4        https://bugs.webkit.org/show_bug.cgi?id=184592
     5
     6        Reviewed by Alex Christensen.
     7
     8        Following the removal of the pre-Network Session code in r227364, NetworkLoad::sharedDidReceiveResponse()
     9        is only referenced from NetworkLoad::notifyDidReceiveResponse(). We should inline its
     10        implementation into the NetworkLoad::notifyDidReceiveResponse(), remove a function
     11        call, and the cognitive load to follow such a function call when reading the code.
     12
     13        No functionality changed. So, no new tests.
     14
     15        * NetworkProcess/NetworkLoad.cpp:
     16        (WebKit::NetworkLoad::notifyDidReceiveResponse): Moved the implementation of NetworkLoad::sharedDidReceiveResponse()
     17        into this function.
     18        (WebKit::NetworkLoad::sharedDidReceiveResponse): Deleted. Moved its implementation into
     19        NetworkLoad::notifyDidReceiveResponse().
     20        * NetworkProcess/NetworkLoad.h:
     21
    1222018-04-13  Brent Fulgham  <bfulgham@apple.com>
    223
  • trunk/Source/WebKit/NetworkProcess/NetworkLoad.cpp

    r228231 r230635  
    192192}
    193193
    194 NetworkLoadClient::ShouldContinueDidReceiveResponse NetworkLoad::sharedDidReceiveResponse(ResourceResponse&& response)
    195 {
    196     response.setSource(ResourceResponse::Source::Network);
    197     if (m_parameters.needsCertificateInfo)
    198         response.includeCertificateInfo();
    199 
    200     return m_client.get().didReceiveResponse(WTFMove(response));
    201 }
    202 
    203194void NetworkLoad::sharedWillSendRedirectedRequest(ResourceRequest&& request, ResourceResponse&& redirectResponse)
    204195{
     
    344335#endif
    345336
    346     if (sharedDidReceiveResponse(WTFMove(response)) == NetworkLoadClient::ShouldContinueDidReceiveResponse::No) {
     337    response.setSource(ResourceResponse::Source::Network);
     338    if (m_parameters.needsCertificateInfo)
     339        response.includeCertificateInfo();
     340
     341    if (m_client.get().didReceiveResponse(WTFMove(response)) == NetworkLoadClient::ShouldContinueDidReceiveResponse::No) {
    347342        m_responseCompletionHandler = WTFMove(completionHandler);
    348343        return;
  • trunk/Source/WebKit/NetworkProcess/NetworkLoad.h

    r227682 r230635  
    8080    void initialize(NetworkSession&);
    8181
    82     NetworkLoadClient::ShouldContinueDidReceiveResponse sharedDidReceiveResponse(WebCore::ResourceResponse&&);
    8382    void sharedWillSendRedirectedRequest(WebCore::ResourceRequest&&, WebCore::ResourceResponse&&);
    8483
Note: See TracChangeset for help on using the changeset viewer.