Commit 202ca8e7 authored by ossy@webkit.org's avatar ossy@webkit.org

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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155108 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0305f656
......@@ -2047,6 +2047,7 @@ set(WebCore_SOURCES
platform/network/ResourceRequestBase.cpp
platform/network/ResourceResponseBase.cpp
platform/network/SocketStreamHandleBase.cpp
platform/network/SynchronousLoaderClient.cpp
platform/sql/SQLValue.cpp
platform/sql/SQLiteAuthorizer.cpp
......
2013-09-05 Csaba Osztrogonác <ossy@webkit.org>
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):
2013-09-05 Jinwoo Song <jinwoo7.song@samsung.com>
Fix unused parameter warning in WebKitAccessibleInterfaceText.cpp
......@@ -161,6 +161,7 @@ list(APPEND WebCore_SOURCES
platform/network/soup/ResourceResponseSoup.cpp
platform/network/soup/SocketStreamHandleSoup.cpp
platform/network/soup/SoupURIUtils.cpp
platform/network/soup/SynchronousLoaderClientSoup.cpp
platform/posix/FileSystemPOSIX.cpp
platform/posix/SharedBufferPOSIX.cpp
......
......@@ -202,6 +202,7 @@ list(APPEND WebCore_SOURCES
platform/network/soup/ResourceResponseSoup.cpp
platform/network/soup/SocketStreamHandleSoup.cpp
platform/network/soup/SoupURIUtils.cpp
platform/network/soup/SynchronousLoaderClientSoup.cpp
platform/PlatformStrategies.cpp
......
......@@ -8247,6 +8247,12 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\platform\network\cf\SynchronousLoaderClientCFNet.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\platform\network\win\DownloadBundleWin.cpp" />
<ClCompile Include="..\platform\network\win\NetworkStateNotifierWin.cpp" />
<ClCompile Include="..\platform\network\curl\CookieJarCurl.cpp">
......@@ -1953,6 +1953,9 @@
<ClCompile Include="..\platform\network\cf\SocketStreamHandleCFNet.cpp">
<Filter>platform\network\cf</Filter>
</ClCompile>
<ClCompile Include="..\platform\network\cf\SynchronousLoaderClientCFNet.cpp">
<Filter>platform\network\cf</Filter>
</ClCompile>
<ClCompile Include="..\platform\network\win\DownloadBundleWin.cpp">
<Filter>platform\network\win</Filter>
</ClCompile>
......
......@@ -30,10 +30,6 @@
#include "ResourceHandle.h"
#include "ResourceRequest.h"
#if USE(CFNETWORK)
#include <CFNetwork/CFURLConnectionPriv.h>
#endif
namespace WebCore {
SynchronousLoaderClient::~SynchronousLoaderClient()
......@@ -66,14 +62,6 @@ bool SynchronousLoaderClient::canAuthenticateAgainstProtectionSpace(ResourceHand
}
#endif
#if USE(CFNETWORK)
void SynchronousLoaderClient::didReceiveAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge& challenge)
{
// FIXME: The user should be asked for credentials, as in async case.
CFURLConnectionUseCredential(handle->connection(), 0, challenge.cfURLAuthChallengeRef());
}
#endif
void SynchronousLoaderClient::didReceiveResponse(ResourceHandle*, const ResourceResponse& response)
{
m_response = response;
......@@ -97,12 +85,4 @@ void SynchronousLoaderClient::didFail(ResourceHandle*, const ResourceError& erro
m_isDone = true;
}
#if USE(CFNETWORK)
ResourceError SynchronousLoaderClient::platformBadResponseError()
{
RetainPtr<CFErrorRef> cfError = adoptCF(CFErrorCreate(kCFAllocatorDefault, kCFErrorDomainCFNetwork, kCFURLErrorBadServerResponse, 0));
return cfError.get();
}
#endif
}
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "SynchronousLoaderClient.h"
#if USE(CFNETWORK)
#include "AuthenticationChallenge.h"
#include "ResourceHandle.h"
#include <CFNetwork/CFURLConnectionPriv.h>
namespace WebCore {
void SynchronousLoaderClient::didReceiveAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge& challenge)
{
// FIXME: The user should be asked for credentials, as in async case.
CFURLConnectionUseCredential(handle->connection(), 0, challenge.cfURLAuthChallengeRef());
}
ResourceError SynchronousLoaderClient::platformBadResponseError()
{
RetainPtr<CFErrorRef> cfError = adoptCF(CFErrorCreate(kCFAllocatorDefault, kCFErrorDomainCFNetwork, kCFURLErrorBadServerResponse, 0));
return cfError.get();
}
} // namespace WebCore
#endif // USE(CFNETWORK)
/*
* Copyright (C) 2013 University of Szeged. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "SynchronousLoaderClient.h"
#include "AuthenticationChallenge.h"
#include "NotImplemented.h"
#include "ResourceHandle.h"
namespace WebCore {
void SynchronousLoaderClient::didReceiveAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge& challenge)
{
notImplemented();
}
ResourceError SynchronousLoaderClient::platformBadResponseError()
{
notImplemented();
return ResourceError();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment