Changeset 155108 in webkit


Ignore:
Timestamp:
Sep 5, 2013 2:51:25 AM (11 years ago)
Author:
Csaba Osztrogonác
Message:

Fix SynchronousLoaderClient class for !USE(CFNETWORK) platforms
https://bugs.webkit.org/show_bug.cgi?id=120532

Reviewed by Darin Adler.

  • CMakeLists.txt:
  • PlatformEfl.cmake:
  • PlatformGTK.cmake:
  • WebCore.vcxproj/WebCore.vcxproj:
  • WebCore.vcxproj/WebCore.vcxproj.filters:
  • platform/network/SynchronousLoaderClient.cpp:
  • platform/network/cf/SynchronousLoaderClientCFNet.cpp: Added.

(WebCore::SynchronousLoaderClient::didReceiveAuthenticationChallenge):
(WebCore::SynchronousLoaderClient::platformBadResponseError):

  • platform/network/soup/SynchronousLoaderClientSoup.cpp: Added.

(WebCore::SynchronousLoaderClient::didReceiveAuthenticationChallenge):
(WebCore::SynchronousLoaderClient::platformBadResponseError):

Location:
trunk/Source/WebCore
Files:
1 added
7 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r155077 r155108  
    20482048    platform/network/ResourceResponseBase.cpp
    20492049    platform/network/SocketStreamHandleBase.cpp
     2050    platform/network/SynchronousLoaderClient.cpp
    20502051
    20512052    platform/sql/SQLValue.cpp
  • trunk/Source/WebCore/ChangeLog

    r155107 r155108  
     12013-09-05  Csaba Osztrogonác  <ossy@webkit.org>
     2
     3        Fix SynchronousLoaderClient class for !USE(CFNETWORK) platforms
     4        https://bugs.webkit.org/show_bug.cgi?id=120532
     5
     6        Reviewed by Darin Adler.
     7
     8        * CMakeLists.txt:
     9        * PlatformEfl.cmake:
     10        * PlatformGTK.cmake:
     11        * WebCore.vcxproj/WebCore.vcxproj:
     12        * WebCore.vcxproj/WebCore.vcxproj.filters:
     13        * platform/network/SynchronousLoaderClient.cpp:
     14        * platform/network/cf/SynchronousLoaderClientCFNet.cpp: Added.
     15        (WebCore::SynchronousLoaderClient::didReceiveAuthenticationChallenge):
     16        (WebCore::SynchronousLoaderClient::platformBadResponseError):
     17        * platform/network/soup/SynchronousLoaderClientSoup.cpp: Added.
     18        (WebCore::SynchronousLoaderClient::didReceiveAuthenticationChallenge):
     19        (WebCore::SynchronousLoaderClient::platformBadResponseError):
     20
    1212013-09-05  Jinwoo Song  <jinwoo7.song@samsung.com>
    222
  • trunk/Source/WebCore/PlatformEfl.cmake

    r154908 r155108  
    162162    platform/network/soup/SocketStreamHandleSoup.cpp
    163163    platform/network/soup/SoupURIUtils.cpp
     164    platform/network/soup/SynchronousLoaderClientSoup.cpp
    164165
    165166    platform/posix/FileSystemPOSIX.cpp
  • trunk/Source/WebCore/PlatformGTK.cmake

    r154262 r155108  
    203203    platform/network/soup/SocketStreamHandleSoup.cpp
    204204    platform/network/soup/SoupURIUtils.cpp
     205    platform/network/soup/SynchronousLoaderClientSoup.cpp
    205206
    206207    platform/PlatformStrategies.cpp
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

    r155077 r155108  
    82438243    </ClCompile>
    82448244    <ClCompile Include="..\platform\network\cf\SocketStreamHandleCFNet.cpp">
     8245      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
     8246      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
     8247      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
     8248      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
     8249    </ClCompile>
     8250    <ClCompile Include="..\platform\network\cf\SynchronousLoaderClientCFNet.cpp">
    82458251      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
    82468252      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters

    r155084 r155108  
    19541954      <Filter>platform\network\cf</Filter>
    19551955    </ClCompile>
     1956    <ClCompile Include="..\platform\network\cf\SynchronousLoaderClientCFNet.cpp">
     1957      <Filter>platform\network\cf</Filter>
     1958    </ClCompile>
    19561959    <ClCompile Include="..\platform\network\win\DownloadBundleWin.cpp">
    19571960      <Filter>platform\network\win</Filter>
  • trunk/Source/WebCore/platform/network/SynchronousLoaderClient.cpp

    r149255 r155108  
    3030#include "ResourceHandle.h"
    3131#include "ResourceRequest.h"
    32 
    33 #if USE(CFNETWORK)
    34 #include <CFNetwork/CFURLConnectionPriv.h>
    35 #endif
    3632
    3733namespace WebCore {
     
    6763#endif
    6864
    69 #if USE(CFNETWORK)
    70 void SynchronousLoaderClient::didReceiveAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge& challenge)
    71 {
    72     // FIXME: The user should be asked for credentials, as in async case.
    73     CFURLConnectionUseCredential(handle->connection(), 0, challenge.cfURLAuthChallengeRef());
    74 }
    75 #endif
    76 
    7765void SynchronousLoaderClient::didReceiveResponse(ResourceHandle*, const ResourceResponse& response)
    7866{
     
    9886}
    9987
    100 #if USE(CFNETWORK)
    101 ResourceError SynchronousLoaderClient::platformBadResponseError()
    102 {
    103     RetainPtr<CFErrorRef> cfError = adoptCF(CFErrorCreate(kCFAllocatorDefault, kCFErrorDomainCFNetwork, kCFURLErrorBadServerResponse, 0));
    104     return cfError.get();
    10588}
    106 #endif
    107 
    108 }
  • trunk/Source/WebCore/platform/network/cf/SynchronousLoaderClientCFNet.cpp

    r155107 r155108  
    2727#include "SynchronousLoaderClient.h"
    2828
     29#if USE(CFNETWORK)
     30
    2931#include "AuthenticationChallenge.h"
    3032#include "ResourceHandle.h"
    31 #include "ResourceRequest.h"
    32 
    33 #if USE(CFNETWORK)
    3433#include <CFNetwork/CFURLConnectionPriv.h>
    35 #endif
    3634
    3735namespace WebCore {
    3836
    39 SynchronousLoaderClient::~SynchronousLoaderClient()
    40 {
    41 }
    42 
    43 void SynchronousLoaderClient::willSendRequest(ResourceHandle* handle, ResourceRequest& request, const ResourceResponse& /*redirectResponse*/)
    44 {
    45     // FIXME: This needs to be fixed to follow the redirect correctly even for cross-domain requests.
    46     if (protocolHostAndPortAreEqual(handle->firstRequest().url(), request.url()))
    47         return;
    48 
    49     ASSERT(m_error.isNull());
    50     m_error = platformBadResponseError();
    51     m_isDone = true;
    52     request = 0;
    53 }
    54 
    55 bool SynchronousLoaderClient::shouldUseCredentialStorage(ResourceHandle*)
    56 {
    57     // FIXME: We should ask FrameLoaderClient whether using credential storage is globally forbidden.
    58     return m_allowStoredCredentials;
    59 }
    60 
    61 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
    62 bool SynchronousLoaderClient::canAuthenticateAgainstProtectionSpace(ResourceHandle*, const ProtectionSpace&)
    63 {
    64     // FIXME: We should ask FrameLoaderClient. <http://webkit.org/b/65196>
    65     return true;
    66 }
    67 #endif
    68 
    69 #if USE(CFNETWORK)
    7037void SynchronousLoaderClient::didReceiveAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge& challenge)
    7138{
     
    7340    CFURLConnectionUseCredential(handle->connection(), 0, challenge.cfURLAuthChallengeRef());
    7441}
    75 #endif
    7642
    77 void SynchronousLoaderClient::didReceiveResponse(ResourceHandle*, const ResourceResponse& response)
    78 {
    79     m_response = response;
    80 }
    81 
    82 void SynchronousLoaderClient::didReceiveData(ResourceHandle*, const char* data, int length, int /*encodedDataLength*/)
    83 {
    84     m_data.append(data, length);
    85 }
    86 
    87 void SynchronousLoaderClient::didFinishLoading(ResourceHandle*, double)
    88 {
    89     m_isDone = true;
    90 }
    91 
    92 void SynchronousLoaderClient::didFail(ResourceHandle*, const ResourceError& error)
    93 {
    94     ASSERT(m_error.isNull());
    95 
    96     m_error = error;
    97     m_isDone = true;
    98 }
    99 
    100 #if USE(CFNETWORK)
    10143ResourceError SynchronousLoaderClient::platformBadResponseError()
    10244{
     
    10446    return cfError.get();
    10547}
    106 #endif
    10748
    108 }
     49} // namespace WebCore
     50
     51#endif // USE(CFNETWORK)
Note: See TracChangeset for help on using the changeset viewer.