Fix SynchronousLoaderClient class for !USE(CFNETWORK) platforms
authorossy@webkit.org <ossy@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Sep 2013 09:51:25 +0000 (09:51 +0000)
committerossy@webkit.org <ossy@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Sep 2013 09:51:25 +0000 (09:51 +0000)
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: https://svn.webkit.org/repository/webkit/trunk@155108 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/PlatformEfl.cmake
Source/WebCore/PlatformGTK.cmake
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/platform/network/SynchronousLoaderClient.cpp
Source/WebCore/platform/network/cf/SynchronousLoaderClientCFNet.cpp [new file with mode: 0644]
Source/WebCore/platform/network/soup/SynchronousLoaderClientSoup.cpp [new file with mode: 0644]

index 1a37994..8e03936 100644 (file)
@@ -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
index f5f6401..16d3033 100644 (file)
@@ -1,3 +1,23 @@
+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
index 2180c72..2549c92 100644 (file)
@@ -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
index 2a0abd6..b163e38 100644 (file)
@@ -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
 
index 6680a21..0fe2b16 100644 (file)
       <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">
index 43421cb..6aaf55a 100644 (file)
     <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>
index 16431b0..3cf609d 100644 (file)
 #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
-
 }
diff --git a/Source/WebCore/platform/network/cf/SynchronousLoaderClientCFNet.cpp b/Source/WebCore/platform/network/cf/SynchronousLoaderClientCFNet.cpp
new file mode 100644 (file)
index 0000000..6575808
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * 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)
diff --git a/Source/WebCore/platform/network/soup/SynchronousLoaderClientSoup.cpp b/Source/WebCore/platform/network/soup/SynchronousLoaderClientSoup.cpp
new file mode 100644 (file)
index 0000000..64474ca
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * 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();
+}
+
+}