<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[160338] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/160338">160338</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-09 15:45:03 -0800 (Mon, 09 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Refactor the CFURLConnectionClient to be the synchronous implementation of an abstract network delegate
https://bugs.webkit.org/show_bug.cgi?id=125379
Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-12-09
Reviewed by Alexey Proskuryakov.
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleInternal.h:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp: Added.
(WebCore::ResourceHandleCFURLConnectionDelegate::ResourceHandleCFURLConnectionDelegate):
(WebCore::ResourceHandleCFURLConnectionDelegate::~ResourceHandleCFURLConnectionDelegate):
(WebCore::ResourceHandleCFURLConnectionDelegate::willSendRequestCallback):
(WebCore::ResourceHandleCFURLConnectionDelegate::didReceiveResponseCallback):
(WebCore::ResourceHandleCFURLConnectionDelegate::didReceiveDataCallback):
(WebCore::ResourceHandleCFURLConnectionDelegate::didFinishLoadingCallback):
(WebCore::ResourceHandleCFURLConnectionDelegate::didFailCallback):
(WebCore::ResourceHandleCFURLConnectionDelegate::willCacheResponseCallback):
(WebCore::ResourceHandleCFURLConnectionDelegate::didReceiveChallengeCallback):
(WebCore::ResourceHandleCFURLConnectionDelegate::didSendBodyDataCallback):
(WebCore::ResourceHandleCFURLConnectionDelegate::shouldUseCredentialStorageCallback):
(WebCore::ResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpaceCallback):
(WebCore::ResourceHandleCFURLConnectionDelegate::didReceiveDataArrayCallback):
(WebCore::ResourceHandleCFURLConnectionDelegate::makeConnectionClient):
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.h: Added.
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Added.
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::SynchronousResourceHandleCFURLConnectionDelegate):
(WebCore::synthesizeRedirectResponseIfNecessary):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willSendRequest):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFail):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willCacheResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveChallenge):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didSendBodyData):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::shouldUseCredentialStorageCallback):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveDataArray):
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceHandleh">trunk/Source/WebCore/platform/network/ResourceHandle.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceHandleInternalh">trunk/Source/WebCore/platform/network/ResourceHandleInternal.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfResourceHandleCFNetcpp">trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformnetworkcfResourceHandleCFURLConnectionDelegatecpp">trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfResourceHandleCFURLConnectionDelegateh">trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegate.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfSynchronousResourceHandleCFURLConnectionDelegatecpp">trunk/Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfSynchronousResourceHandleCFURLConnectionDelegateh">trunk/Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160337 => 160338)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-09 23:44:19 UTC (rev 160337)
+++ trunk/Source/WebCore/ChangeLog        2013-12-09 23:45:03 UTC (rev 160338)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2013-12-09 Benjamin Poulain <bpoulain@apple.com>
+
+ Refactor the CFURLConnectionClient to be the synchronous implementation of an abstract network delegate
+ https://bugs.webkit.org/show_bug.cgi?id=125379
+
+ Reviewed by Alexey Proskuryakov.
+
+ * WebCore.vcxproj/WebCore.vcxproj:
+ * WebCore.vcxproj/WebCore.vcxproj.filters:
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/network/ResourceHandle.h:
+ * platform/network/ResourceHandleInternal.h:
+ * platform/network/cf/ResourceHandleCFNet.cpp:
+ (WebCore::ResourceHandle::createCFURLConnection):
+ * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp: Added.
+ (WebCore::ResourceHandleCFURLConnectionDelegate::ResourceHandleCFURLConnectionDelegate):
+ (WebCore::ResourceHandleCFURLConnectionDelegate::~ResourceHandleCFURLConnectionDelegate):
+ (WebCore::ResourceHandleCFURLConnectionDelegate::willSendRequestCallback):
+ (WebCore::ResourceHandleCFURLConnectionDelegate::didReceiveResponseCallback):
+ (WebCore::ResourceHandleCFURLConnectionDelegate::didReceiveDataCallback):
+ (WebCore::ResourceHandleCFURLConnectionDelegate::didFinishLoadingCallback):
+ (WebCore::ResourceHandleCFURLConnectionDelegate::didFailCallback):
+ (WebCore::ResourceHandleCFURLConnectionDelegate::willCacheResponseCallback):
+ (WebCore::ResourceHandleCFURLConnectionDelegate::didReceiveChallengeCallback):
+ (WebCore::ResourceHandleCFURLConnectionDelegate::didSendBodyDataCallback):
+ (WebCore::ResourceHandleCFURLConnectionDelegate::shouldUseCredentialStorageCallback):
+ (WebCore::ResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpaceCallback):
+ (WebCore::ResourceHandleCFURLConnectionDelegate::didReceiveDataArrayCallback):
+ (WebCore::ResourceHandleCFURLConnectionDelegate::makeConnectionClient):
+ * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h: Added.
+ * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Added.
+ (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::SynchronousResourceHandleCFURLConnectionDelegate):
+ (WebCore::synthesizeRedirectResponseIfNecessary):
+ (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willSendRequest):
+ (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
+ (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData):
+ (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading):
+ (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFail):
+ (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willCacheResponse):
+ (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveChallenge):
+ (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didSendBodyData):
+ (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::shouldUseCredentialStorageCallback):
+ (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
+ (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveDataArray):
+ * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h: Added.
+
</ins><span class="cx"> 2013-12-09 Ryosuke Niwa <rniwa@webkit.org>
</span><span class="cx">
</span><span class="cx"> REGRESSION(r136280): input[type=image] should assume coords of 0,0 when activated without physically clicking
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (160337 => 160338)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-12-09 23:44:19 UTC (rev 160337)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-12-09 23:45:03 UTC (rev 160338)
</span><span class="lines">@@ -8277,6 +8277,12 @@
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\platform\network\cf\ResourceHandleCFURLConnectionDelegate.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>
</ins><span class="cx"> <ClCompile Include="..\platform\network\cf\ResourceRequestCFNet.cpp">
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
</span><span class="lines">@@ -8301,6 +8307,12 @@
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\platform\network\cf\SynchronousResourceHandleCFURLConnectionDelegate.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>
</ins><span class="cx"> <ClCompile Include="..\platform\network\win\DownloadBundleWin.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\network\win\NetworkStateNotifierWin.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\network\curl\CookieJarCurl.cpp">
</span><span class="lines">@@ -19503,11 +19515,13 @@
</span><span class="cx"> <CustomBuildStep Include="..\platform\network\cf\FormDataStreamCFNet.h" />
</span><span class="cx"> <ClInclude Include="..\platform\network\cf\LoaderRunLoopCF.h" />
</span><span class="cx"> <CustomBuildStep Include="..\platform\network\cf\ResourceError.h" />
</span><ins>+ <CustomBuildStep Include="..\platform\network\cf\ResourceHandleCFURLConnectionDelegate.h" />
</ins><span class="cx"> <CustomBuildStep Include="..\platform\network\cf\ResourceRequest.h" />
</span><span class="cx"> <CustomBuildStep Include="..\platform\network\cf\ResourceRequestCFNet.h" />
</span><span class="cx"> <CustomBuildStep Include="..\platform\network\cf\ResourceResponse.h" />
</span><span class="cx"> <ClInclude Include="..\platform\network\cf\SocketStreamError.h" />
</span><span class="cx"> <ClInclude Include="..\platform\network\cf\SocketStreamHandle.h" />
</span><ins>+ <CustomBuildStep Include="..\platform\network\cf\SynchronousResourceHandleCFURLConnectionDelegate.h" />
</ins><span class="cx"> <CustomBuildStep Include="..\platform\network\curl\AuthenticationChallenge.h">
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (160337 => 160338)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2013-12-09 23:44:19 UTC (rev 160337)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2013-12-09 23:45:03 UTC (rev 160338)
</span><span class="lines">@@ -1881,6 +1881,9 @@
</span><span class="cx"> <ClCompile Include="..\platform\network\cf\ResourceHandleCFNet.cpp">
</span><span class="cx"> <Filter>platform\network\cf</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\platform\network\cf\ResourceHandleCFURLConnectionDelegate.cpp">
+ <Filter>platform\network\cf</Filter>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\platform\network\cf\ResourceRequestCFNet.cpp">
</span><span class="cx"> <Filter>platform\network\cf</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -1893,6 +1896,9 @@
</span><span class="cx"> <ClCompile Include="..\platform\network\cf\SynchronousLoaderClientCFNet.cpp">
</span><span class="cx"> <Filter>platform\network\cf</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\platform\network\cf\SynchronousResourceHandleCFURLConnectionDelegate.cpp">
+ <Filter>platform\network\cf</Filter>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\platform\network\win\DownloadBundleWin.cpp">
</span><span class="cx"> <Filter>platform\network\win</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -15092,6 +15098,9 @@
</span><span class="cx"> <CustomBuildStep Include="..\platform\network\cf\ResourceError.h">
</span><span class="cx"> <Filter>platform\network\cf</Filter>
</span><span class="cx"> </CustomBuildStep>
</span><ins>+ <CustomBuildStep Include="..\platform\network\cf\ResourceHandleCFURLConnectionDelegate.h">
+ <Filter>platform\network\cf</Filter>
+ </CustomBuildStep>
</ins><span class="cx"> <CustomBuildStep Include="..\platform\network\cf\ResourceRequest.h">
</span><span class="cx"> <Filter>platform\network\cf</Filter>
</span><span class="cx"> </CustomBuildStep>
</span><span class="lines">@@ -15101,6 +15110,9 @@
</span><span class="cx"> <CustomBuildStep Include="..\platform\network\cf\ResourceResponse.h">
</span><span class="cx"> <Filter>platform\network\cf</Filter>
</span><span class="cx"> </CustomBuildStep>
</span><ins>+ <CustomBuildStep Include="..\platform\network\cf\SynchronousResourceHandleCFURLConnectionDelegate.h">
+ <Filter>platform\network\cf</Filter>
+ </CustomBuildStep>
</ins><span class="cx"> <CustomBuildStep Include="..\platform\network\curl\AuthenticationChallenge.h">
</span><span class="cx"> <Filter>platform\network\curl</Filter>
</span><span class="cx"> </CustomBuildStep>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (160337 => 160338)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-09 23:44:19 UTC (rev 160337)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-09 23:45:03 UTC (rev 160338)
</span><span class="lines">@@ -914,6 +914,10 @@
</span><span class="cx">                 26C17A3F1491D2D400D12BA2 /* FileSystemIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26C17A3D1491D2D400D12BA2 /* FileSystemIOS.mm */; };
</span><span class="cx">                 26E98A10130A9FCA008EB7B2 /* TextCodecASCIIFastPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 26E98A0F130A9FCA008EB7B2 /* TextCodecASCIIFastPath.h */; };
</span><span class="cx">                 26F40D4A14904A6300CA67C4 /* EventLoopIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26F40D4914904A6300CA67C4 /* EventLoopIOS.mm */; };
</span><ins>+                26FAE4CC1852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26FAE4C81852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.cpp */; };
+                26FAE4CD1852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 26FAE4C91852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.h */; };
+                26FAE4CE1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26FAE4CA1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.cpp */; };
+                26FAE4CF1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 26FAE4CB1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.h */; };
</ins><span class="cx">                 2917B5611473496C0052C9D0 /* LayerFlushScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2917B55E1473496C0052C9D0 /* LayerFlushScheduler.cpp */; };
</span><span class="cx">                 2917B5621473496C0052C9D0 /* LayerFlushScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 2917B55F1473496C0052C9D0 /* LayerFlushScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2917B5631473496C0052C9D0 /* LayerFlushSchedulerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2917B5601473496C0052C9D0 /* LayerFlushSchedulerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -5269,6 +5273,7 @@
</span><span class="cx">                 C5278B0C17F212EA003A2998 /* PlatformPasteboardIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = C5278B0B17F212EA003A2998 /* PlatformPasteboardIOS.mm */; };
</span><span class="cx">                 C544274B11A57E7A0063A749 /* DOMStringList.h in Headers */ = {isa = PBXBuildFile; fileRef = C544274911A57E7A0063A749 /* DOMStringList.h */; };
</span><span class="cx">                 C55610F111A704EB00B82D27 /* DOMStringList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C55610F011A704EB00B82D27 /* DOMStringList.cpp */; };
</span><ins>+                C55C7BA11718AFBA001327E4 /* RenderThemeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = C55C7BA01718AFBA001327E4 /* RenderThemeIOS.mm */; };
</ins><span class="cx">                 C55E38BF10040D5D00A56BDB /* StorageNamespaceImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = C55E38BB10040D5D00A56BDB /* StorageNamespaceImpl.h */; };
</span><span class="cx">                 C55E38C010040D5D00A56BDB /* StorageNamespaceImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C55E38BC10040D5D00A56BDB /* StorageNamespaceImpl.cpp */; };
</span><span class="cx">                 C572EE1F1201C9BC007D8F82 /* JSIDBIndex.h in Headers */ = {isa = PBXBuildFile; fileRef = C572EE1D1201C9BC007D8F82 /* JSIDBIndex.h */; };
</span><span class="lines">@@ -5450,8 +5455,6 @@
</span><span class="cx">                 CE7B2DB51586ABAD0098B3FA /* TextAlternativeWithRange.h in Headers */ = {isa = PBXBuildFile; fileRef = CE7B2DB11586ABAD0098B3FA /* TextAlternativeWithRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CE7B2DB61586ABAD0098B3FA /* TextAlternativeWithRange.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE7B2DB21586ABAD0098B3FA /* TextAlternativeWithRange.mm */; };
</span><span class="cx">                 CE95208A1811B475007A5392 /* WebSafeIncrementalSweeperIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */; };
</span><del>-                FED13D520CEA949700D89466 /* RenderThemeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = FED13D500CEA949700D89466 /* RenderThemeIOS.h */; };
-                C55C7BA11718AFBA001327E4 /* RenderThemeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = C55C7BA01718AFBA001327E4 /* RenderThemeIOS.mm */; };
</del><span class="cx">                 CECADFC6153778FF00E37068 /* DictationAlternative.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CECADFC2153778FF00E37068 /* DictationAlternative.cpp */; };
</span><span class="cx">                 CECADFC7153778FF00E37068 /* DictationAlternative.h in Headers */ = {isa = PBXBuildFile; fileRef = CECADFC3153778FF00E37068 /* DictationAlternative.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CECADFC8153778FF00E37068 /* DictationCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CECADFC4153778FF00E37068 /* DictationCommand.cpp */; };
</span><span class="lines">@@ -6328,6 +6331,7 @@
</span><span class="cx">                 FEBC5F3116BD0CC300659BD3 /* DatabaseBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEBC5F2F16BD0CC300659BD3 /* DatabaseBase.cpp */; };
</span><span class="cx">                 FEBC5F3216BD0CC300659BD3 /* DatabaseBase.h in Headers */ = {isa = PBXBuildFile; fileRef = FEBC5F3016BD0CC300659BD3 /* DatabaseBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FED13D3A0CEA934600D89466 /* EditorIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D390CEA934600D89466 /* EditorIOS.mm */; };
</span><ins>+                FED13D520CEA949700D89466 /* RenderThemeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = FED13D500CEA949700D89466 /* RenderThemeIOS.h */; };
</ins><span class="cx">                 FED48390CED66C3255F72C59 /* MathMLSelectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F75A059AF170D8FAA5B8CABE /* MathMLSelectElement.cpp */; };
</span><span class="cx">                 FEDBFF16182B7A8D0017FA64 /* BreakpointID.h in Headers */ = {isa = PBXBuildFile; fileRef = FEDBFF14182B7A8D0017FA64 /* BreakpointID.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FEDEF84116797108000E444A /* DatabaseStrategy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDEF83F16797108000E444A /* DatabaseStrategy.cpp */; };
</span><span class="lines">@@ -7564,6 +7568,10 @@
</span><span class="cx">                 26C17A3D1491D2D400D12BA2 /* FileSystemIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = FileSystemIOS.mm; path = ios/FileSystemIOS.mm; sourceTree = "<group>"; };
</span><span class="cx">                 26E98A0F130A9FCA008EB7B2 /* TextCodecASCIIFastPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCodecASCIIFastPath.h; sourceTree = "<group>"; };
</span><span class="cx">                 26F40D4914904A6300CA67C4 /* EventLoopIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = EventLoopIOS.mm; path = ios/EventLoopIOS.mm; sourceTree = "<group>"; };
</span><ins>+                26FAE4C81852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceHandleCFURLConnectionDelegate.cpp; sourceTree = "<group>"; };
+                26FAE4C91852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceHandleCFURLConnectionDelegate.h; sourceTree = "<group>"; };
+                26FAE4CA1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SynchronousResourceHandleCFURLConnectionDelegate.cpp; sourceTree = "<group>"; };
+                26FAE4CB1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SynchronousResourceHandleCFURLConnectionDelegate.h; sourceTree = "<group>"; };
</ins><span class="cx">                 2917B55E1473496C0052C9D0 /* LayerFlushScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LayerFlushScheduler.cpp; path = ca/LayerFlushScheduler.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2917B55F1473496C0052C9D0 /* LayerFlushScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LayerFlushScheduler.h; path = ca/LayerFlushScheduler.h; sourceTree = "<group>"; };
</span><span class="cx">                 2917B5601473496C0052C9D0 /* LayerFlushSchedulerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LayerFlushSchedulerClient.h; path = ca/LayerFlushSchedulerClient.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -12350,6 +12358,7 @@
</span><span class="cx">                 C544274911A57E7A0063A749 /* DOMStringList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMStringList.h; sourceTree = "<group>"; };
</span><span class="cx">                 C544274A11A57E7A0063A749 /* DOMStringList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMStringList.idl; sourceTree = "<group>"; };
</span><span class="cx">                 C55610F011A704EB00B82D27 /* DOMStringList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMStringList.cpp; sourceTree = "<group>"; };
</span><ins>+                C55C7BA01718AFBA001327E4 /* RenderThemeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RenderThemeIOS.mm; sourceTree = "<group>"; };
</ins><span class="cx">                 C55E38BB10040D5D00A56BDB /* StorageNamespaceImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageNamespaceImpl.h; sourceTree = "<group>"; };
</span><span class="cx">                 C55E38BC10040D5D00A56BDB /* StorageNamespaceImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageNamespaceImpl.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 C572EE1D1201C9BC007D8F82 /* JSIDBIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBIndex.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -12584,8 +12593,6 @@
</span><span class="cx">                 CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AlternativeTextUIController.mm; path = mac/AlternativeTextUIController.mm; sourceTree = "<group>"; };
</span><span class="cx">                 CE7B2DB11586ABAD0098B3FA /* TextAlternativeWithRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextAlternativeWithRange.h; path = mac/TextAlternativeWithRange.h; sourceTree = "<group>"; };
</span><span class="cx">                 CE7B2DB21586ABAD0098B3FA /* TextAlternativeWithRange.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TextAlternativeWithRange.mm; path = mac/TextAlternativeWithRange.mm; sourceTree = "<group>"; };
</span><del>-                FED13D500CEA949700D89466 /* RenderThemeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderThemeIOS.h; sourceTree = "<group>"; };
-                C55C7BA01718AFBA001327E4 /* RenderThemeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RenderThemeIOS.mm; sourceTree = "<group>"; };
</del><span class="cx">                 CECADFC2153778FF00E37068 /* DictationAlternative.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DictationAlternative.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 CECADFC3153778FF00E37068 /* DictationAlternative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictationAlternative.h; sourceTree = "<group>"; };
</span><span class="cx">                 CECADFC4153778FF00E37068 /* DictationCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DictationCommand.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -13557,6 +13564,7 @@
</span><span class="cx">                 FEBC5F2F16BD0CC300659BD3 /* DatabaseBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseBase.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 FEBC5F3016BD0CC300659BD3 /* DatabaseBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseBase.h; sourceTree = "<group>"; };
</span><span class="cx">                 FED13D390CEA934600D89466 /* EditorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EditorIOS.mm; sourceTree = "<group>"; };
</span><ins>+                FED13D500CEA949700D89466 /* RenderThemeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderThemeIOS.h; sourceTree = "<group>"; };
</ins><span class="cx">                 FEDBFF14182B7A8D0017FA64 /* BreakpointID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BreakpointID.h; sourceTree = "<group>"; };
</span><span class="cx">                 FEDEF83F16797108000E444A /* DatabaseStrategy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseStrategy.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 FEDEF84016797108000E444A /* DatabaseStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseStrategy.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -19546,6 +19554,8 @@
</span><span class="cx">                                 7EE6845712D26E3800E79415 /* ResourceError.h */,
</span><span class="cx">                                 7EE6845812D26E3800E79415 /* ResourceErrorCF.cpp */,
</span><span class="cx">                                 7EE6845912D26E3800E79415 /* ResourceHandleCFNet.cpp */,
</span><ins>+                                26FAE4C81852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.cpp */,
+                                26FAE4C91852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.h */,
</ins><span class="cx">                                 7EE6845A12D26E3800E79415 /* ResourceRequest.h */,
</span><span class="cx">                                 7EE6845B12D26E3800E79415 /* ResourceRequestCFNet.cpp */,
</span><span class="cx">                                 7EE6845C12D26E3800E79415 /* ResourceRequestCFNet.h */,
</span><span class="lines">@@ -19555,6 +19565,8 @@
</span><span class="cx">                                 51ABAE1C103C1913008C5260 /* SocketStreamHandle.h */,
</span><span class="cx">                                 51ABAE1D103C1913008C5260 /* SocketStreamHandleCFNet.cpp */,
</span><span class="cx">                                 442ABCD517D9262F00D30715 /* SynchronousLoaderClientCFNet.cpp */,
</span><ins>+                                26FAE4CA1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.cpp */,
+                                26FAE4CB1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = cf;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="lines">@@ -24507,6 +24519,7 @@
</span><span class="cx">                                 7EE6846A12D26E3800E79415 /* ResourceError.h in Headers */,
</span><span class="cx">                                 934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */,
</span><span class="cx">                                 514C76790CE923A1007EF3CD /* ResourceHandle.h in Headers */,
</span><ins>+                                26FAE4CD1852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.h in Headers */,
</ins><span class="cx">                                 514C767A0CE923A1007EF3CD /* ResourceHandleClient.h in Headers */,
</span><span class="cx">                                 514C767B0CE923A1007EF3CD /* ResourceHandleInternal.h in Headers */,
</span><span class="cx">                                 51E4143416A6596300C633C7 /* ResourceHandleTypes.h in Headers */,
</span><span class="lines">@@ -25032,6 +25045,7 @@
</span><span class="cx">                                 B2227AF60D00BF220071B782 /* SVGZoomAndPan.h in Headers */,
</span><span class="cx">                                 B2E4EC980D00C22B00432643 /* SVGZoomEvent.h in Headers */,
</span><span class="cx">                                 E180811716FCF9CB00B80D07 /* SynchronousLoaderClient.h in Headers */,
</span><ins>+                                26FAE4CF1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.h in Headers */,
</ins><span class="cx">                                 5DA97ECD168E787B000E3676 /* SystemVersionMac.h in Headers */,
</span><span class="cx">                                 A8CFF0510A154F09000A4234 /* TableLayout.h in Headers */,
</span><span class="cx">                                 072AE1E5183C0741000A5988 /* PluginReplacement.h in Headers */,
</span><span class="lines">@@ -27751,6 +27765,7 @@
</span><span class="cx">                                 0705851217FA7107005F2BCB /* JSMediaStreamCapabilities.cpp in Sources */,
</span><span class="cx">                                 514C76780CE923A1007EF3CD /* ResourceHandle.cpp in Sources */,
</span><span class="cx">                                 7EE6846C12D26E3800E79415 /* ResourceHandleCFNet.cpp in Sources */,
</span><ins>+                                26FAE4CC1852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.cpp in Sources */,
</ins><span class="cx">                                 E1BA003116FB92AC00BA7A35 /* ResourceHandleClient.cpp in Sources */,
</span><span class="cx">                                 514C76510CE9234E007EF3CD /* ResourceHandleMac.mm in Sources */,
</span><span class="cx">                                 93E227E30AF589AD00D48324 /* ResourceLoader.cpp in Sources */,
</span><span class="lines">@@ -28000,6 +28015,7 @@
</span><span class="cx">                                 93B2D8180F9920EE006AE6B2 /* SuddenTermination.mm in Sources */,
</span><span class="cx">                                 087558C513B4A57D00F49307 /* SurrogatePairAwareTextIterator.cpp in Sources */,
</span><span class="cx">                                 62C1217C11AB9E77003C462C /* SuspendableTimer.cpp in Sources */,
</span><ins>+                                26FAE4CE1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.cpp in Sources */,
</ins><span class="cx">                                 B22279730D00BF220071B782 /* SVGAElement.cpp in Sources */,
</span><span class="cx">                                 24D912B013CA9A1F00D21915 /* SVGAltGlyphDefElement.cpp in Sources */,
</span><span class="cx">                                 65653F2D0D9727D200CA9723 /* SVGAltGlyphElement.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceHandleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceHandle.h (160337 => 160338)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceHandle.h        2013-12-09 23:44:19 UTC (rev 160337)
+++ trunk/Source/WebCore/platform/network/ResourceHandle.h        2013-12-09 23:45:03 UTC (rev 160338)
</span><span class="lines">@@ -72,7 +72,6 @@
</span><span class="cx"> typedef struct _CFURLConnection* CFURLConnectionRef;
</span><span class="cx"> typedef int CFHTTPCookieStorageAcceptPolicy;
</span><span class="cx"> typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
</span><del>-typedef struct CFURLConnectionClient_V6 CFURLConnectionClient_V6;
</del><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC) || USE(CFNETWORK)
</span><span class="lines">@@ -142,7 +141,6 @@
</span><span class="cx"> const ResourceRequest& currentRequest() const;
</span><span class="cx"> static void setHostAllowsAnyHTTPSCertificate(const String&);
</span><span class="cx"> static void setClientCertificate(const String& host, CFDataRef);
</span><del>- static CFURLConnectionClient_V6* connectionClientCallbacks();
</del><span class="cx">
</span><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="cx"> QuickLookHandle* quickLookHandle() { return m_quickLook.get(); }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceHandleInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceHandleInternal.h (160337 => 160338)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceHandleInternal.h        2013-12-09 23:44:19 UTC (rev 160337)
+++ trunk/Source/WebCore/platform/network/ResourceHandleInternal.h        2013-12-09 23:45:03 UTC (rev 160338)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include "Timer.h"
</span><span class="cx">
</span><span class="cx"> #if USE(CFNETWORK)
</span><ins>+#include "ResourceHandleCFURLConnectionDelegate.h"
</ins><span class="cx"> #include <CFNetwork/CFURLConnectionPriv.h>
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -146,6 +147,7 @@
</span><span class="cx"> #if USE(CFNETWORK)
</span><span class="cx"> RetainPtr<CFURLConnectionRef> m_connection;
</span><span class="cx"> ResourceRequest m_currentRequest;
</span><ins>+ RefPtr<ResourceHandleCFURLConnectionDelegate> m_connectionDelegate;
</ins><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(MAC) && !USE(CFNETWORK)
</span><span class="cx"> RetainPtr<NSURLConnection> m_connection;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfResourceHandleCFNetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp (160337 => 160338)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp        2013-12-09 23:44:19 UTC (rev 160337)
+++ trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp        2013-12-09 23:45:03 UTC (rev 160338)
</span><span class="lines">@@ -36,13 +36,13 @@
</span><span class="cx"> #include "FrameLoader.h"
</span><span class="cx"> #include "LoaderRunLoopCF.h"
</span><span class="cx"> #include "Logging.h"
</span><del>-#include "MIMETypeRegistry.h"
</del><span class="cx"> #include "NetworkingContext.h"
</span><span class="cx"> #include "ResourceError.h"
</span><span class="cx"> #include "ResourceHandleClient.h"
</span><span class="cx"> #include "ResourceResponse.h"
</span><span class="cx"> #include "SharedBuffer.h"
</span><span class="cx"> #include "SynchronousLoaderClient.h"
</span><ins>+#include "SynchronousResourceHandleCFURLConnectionDelegate.h"
</ins><span class="cx"> #include <CFNetwork/CFNetwork.h>
</span><span class="cx"> #include <sys/stat.h>
</span><span class="cx"> #include <sys/types.h>
</span><span class="lines">@@ -96,15 +96,6 @@
</span><span class="cx"> return certs;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if !PLATFORM(MAC)
-static void setDefaultMIMEType(CFURLResponseRef response)
-{
- static CFStringRef defaultMIMETypeString = defaultMIMEType().createCFString().leakRef();
-
- CFURLResponseSetMIMEType(response, defaultMIMETypeString);
-}
-#endif
-
</del><span class="cx"> static void applyBasicAuthorizationHeader(ResourceRequest& request, const Credential& credential)
</span><span class="cx"> {
</span><span class="cx"> String authenticationHeader = "Basic " + base64Encode(String(credential.user() + ":" + credential.password()).utf8());
</span><span class="lines">@@ -112,289 +103,6 @@
</span><span class="cx"> request.addHTTPHeaderField("Authorization", authenticationHeader);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static RetainPtr<CFURLResponseRef> synthesizeRedirectResponseIfNecessary(const ResourceRequest& currentRequest, CFURLRequestRef newRequest, CFURLResponseRef cfRedirectResponse)
-{
- if (cfRedirectResponse)
- return cfRedirectResponse;
-
- CFURLRef newURL = CFURLRequestGetURL(newRequest);
- RetainPtr<CFStringRef> newScheme = adoptCF(CFURLCopyScheme(newURL));
-
- // If the protocols of the new request and the current request match, this is not an HSTS redirect and we shouldn't synthesize a redirect response.
- if (currentRequest.url().protocol() == String(newScheme.get()))
- return 0;
-
- RetainPtr<CFURLRef> currentURL = currentRequest.url().createCFURL();
- RetainPtr<CFHTTPMessageRef> responseMessage = adoptCF(CFHTTPMessageCreateResponse(0, 302, 0, kCFHTTPVersion1_1));
- RetainPtr<CFURLRef> newAbsoluteURL = adoptCF(CFURLCopyAbsoluteURL(newURL));
- CFHTTPMessageSetHeaderFieldValue(responseMessage.get(), CFSTR("Location"), CFURLGetString(newAbsoluteURL.get()));
- CFHTTPMessageSetHeaderFieldValue(responseMessage.get(), CFSTR("Cache-Control"), CFSTR("no-store"));
-
- RetainPtr<CFURLResponseRef> newResponse = adoptCF(CFURLResponseCreateWithHTTPResponse(0, currentURL.get(), responseMessage.get(), kCFURLCacheStorageNotAllowed));
- return newResponse;
-}
-
-static CFURLRequestRef willSendRequest(CFURLConnectionRef conn, CFURLRequestRef cfRequest, CFURLResponseRef originalRedirectResponse, const void* clientInfo)
-{
-#if LOG_DISABLED
- UNUSED_PARAM(conn);
-#endif
- ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo));
- RetainPtr<CFURLResponseRef> redirectResponse = synthesizeRedirectResponseIfNecessary(handle->currentRequest(), cfRequest, originalRedirectResponse);
-
- if (!redirectResponse) {
- CFRetain(cfRequest);
- return cfRequest;
- }
-
- LOG(Network, "CFNet - willSendRequest(conn=%p, handle=%p) (%s)", conn, handle, handle->firstRequest().url().string().utf8().data());
-
- ResourceRequest request;
- if (redirectResponse) {
- CFHTTPMessageRef httpMessage = CFURLResponseGetHTTPResponse(redirectResponse.get());
- if (httpMessage && CFHTTPMessageGetResponseStatusCode(httpMessage) == 307) {
- RetainPtr<CFStringRef> lastHTTPMethod = handle->lastHTTPMethod().createCFString();
- RetainPtr<CFStringRef> newMethod = adoptCF(CFURLRequestCopyHTTPRequestMethod(cfRequest));
- if (CFStringCompareWithOptions(lastHTTPMethod.get(), newMethod.get(), CFRangeMake(0, CFStringGetLength(lastHTTPMethod.get())), kCFCompareCaseInsensitive)) {
- RetainPtr<CFMutableURLRequestRef> mutableRequest = adoptCF(CFURLRequestCreateMutableCopy(0, cfRequest));
- wkSetRequestStorageSession(handle->storageSession(), mutableRequest.get());
- CFURLRequestSetHTTPRequestMethod(mutableRequest.get(), lastHTTPMethod.get());
-
- FormData* body = handle->firstRequest().httpBody();
- if (!equalIgnoringCase(handle->firstRequest().httpMethod(), "GET") && body && !body->isEmpty())
- WebCore::setHTTPBody(mutableRequest.get(), body);
-
- String originalContentType = handle->firstRequest().httpContentType();
- if (!originalContentType.isEmpty())
- CFURLRequestSetHTTPHeaderFieldValue(mutableRequest.get(), CFSTR("Content-Type"), originalContentType.createCFString().get());
-
- request = mutableRequest.get();
- }
- }
- }
- if (request.isNull())
- request = cfRequest;
-
- // Should not set Referer after a redirect from a secure resource to non-secure one.
- if (!request.url().protocolIs("https") && protocolIs(request.httpReferrer(), "https") && handle->context()->shouldClearReferrerOnHTTPSToHTTPRedirect())
- request.clearHTTPReferrer();
-
- handle->willSendRequest(request, redirectResponse.get());
-
- if (request.isNull())
- return 0;
-
- cfRequest = request.cfURLRequest(UpdateHTTPBody);
-
- CFRetain(cfRequest);
- return cfRequest;
-}
-
-static void didReceiveResponse(CFURLConnectionRef conn, CFURLResponseRef cfResponse, const void* clientInfo)
-{
-#if LOG_DISABLED && !USE(QUICK_LOOK)
- UNUSED_PARAM(conn);
-#endif
- ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo));
-
- LOG(Network, "CFNet - didReceiveResponse(conn=%p, handle=%p) (%s)", conn, handle, handle->firstRequest().url().string().utf8().data());
-
- if (!handle->client())
- return;
-
-#if PLATFORM(MAC)
- // Avoid MIME type sniffing if the response comes back as 304 Not Modified.
- CFHTTPMessageRef msg = wkGetCFURLResponseHTTPResponse(cfResponse);
- int statusCode = msg ? CFHTTPMessageGetResponseStatusCode(msg) : 0;
-
- if (statusCode != 304)
- adjustMIMETypeIfNecessary(cfResponse);
-
-#if !PLATFORM(IOS)
- if (_CFURLRequestCopyProtocolPropertyForKey(handle->firstRequest().cfURLRequest(DoNotUpdateHTTPBody), CFSTR("ForceHTMLMIMEType")))
- wkSetCFURLResponseMIMEType(cfResponse, CFSTR("text/html"));
-#endif // !PLATFORM(IOS)
-#else
- if (!CFURLResponseGetMIMEType(cfResponse)) {
- // We should never be applying the default MIMEType if we told the networking layer to do content sniffing for handle.
- ASSERT(!handle->shouldContentSniff());
- setDefaultMIMEType(cfResponse);
- }
-#endif
-
-#if USE(QUICK_LOOK)
- handle->setQuickLookHandle(QuickLookHandle::create(handle, conn, cfResponse));
- if (handle->quickLookHandle())
- cfResponse = handle->quickLookHandle()->cfResponse();
-#endif
-
- handle->client()->didReceiveResponse(handle, cfResponse);
-}
-
-#if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
-static void didReceiveDataArray(CFURLConnectionRef conn, CFArrayRef dataArray, const void* clientInfo)
-{
-#if LOG_DISABLED
- UNUSED_PARAM(conn);
-#endif
- ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo));
- if (!handle->client())
- return;
-
- LOG(Network, "CFNet - didReceiveDataArray(conn=%p, handle=%p, arrayLength=%ld) (%s)", conn, handle, CFArrayGetCount(dataArray), handle->firstRequest().url().string().utf8().data());
-
-#if USE(QUICK_LOOK)
- if (handle->quickLookHandle() && handle->quickLookHandle()->didReceiveDataArray(dataArray))
- return;
-#endif
-
- handle->handleDataArray(dataArray);
-}
-#endif
-
-static void didReceiveData(CFURLConnectionRef conn, CFDataRef data, CFIndex originalLength, const void* clientInfo)
-{
- ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo));
-
-#if LOG_DISABLED
- UNUSED_PARAM(conn);
-#else
- CFIndex length = CFDataGetLength(data);
- LOG(Network, "CFNet - didReceiveData(conn=%p, handle=%p, bytes=%ld) (%s)", conn, handle, length, handle->firstRequest().url().string().utf8().data());
-#endif
-
-#if USE(QUICK_LOOK)
- if (handle->quickLookHandle() && handle->quickLookHandle()->didReceiveData(data))
- return;
-#endif
-
- if (ResourceHandleClient* client = handle->client())
- client->didReceiveBuffer(handle, SharedBuffer::wrapCFData(data), originalLength);
-}
-
-static void didSendBodyData(CFURLConnectionRef, CFIndex, CFIndex totalBytesWritten, CFIndex totalBytesExpectedToWrite, const void *clientInfo)
-{
- ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo));
- if (!handle || !handle->client())
- return;
- handle->client()->didSendData(handle, totalBytesWritten, totalBytesExpectedToWrite);
-}
-
-static Boolean shouldUseCredentialStorageCallback(CFURLConnectionRef conn, const void* clientInfo)
-{
-#if LOG_DISABLED
- UNUSED_PARAM(conn);
-#endif
- ResourceHandle* handle = const_cast<ResourceHandle*>(static_cast<const ResourceHandle*>(clientInfo));
-
- LOG(Network, "CFNet - shouldUseCredentialStorage(conn=%p, handle=%p) (%s)", conn, handle, handle->firstRequest().url().string().utf8().data());
-
- if (!handle)
- return false;
-
- return handle->shouldUseCredentialStorage();
-}
-
-static void didFinishLoading(CFURLConnectionRef conn, const void* clientInfo)
-{
-#if LOG_DISABLED
- UNUSED_PARAM(conn);
-#endif
- ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo));
-
- LOG(Network, "CFNet - didFinishLoading(conn=%p, handle=%p) (%s)", conn, handle, handle->firstRequest().url().string().utf8().data());
-
-#if USE(QUICK_LOOK)
- if (handle->quickLookHandle() && handle->quickLookHandle()->didFinishLoading())
- return;
-#endif
-
- if (handle->client())
- handle->client()->didFinishLoading(handle, 0);
-}
-
-static void didFail(CFURLConnectionRef conn, CFErrorRef error, const void* clientInfo)
-{
-#if LOG_DISABLED
- UNUSED_PARAM(conn);
-#endif
- ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo));
-
- LOG(Network, "CFNet - didFail(conn=%p, handle=%p, error = %p) (%s)", conn, handle, error, handle->firstRequest().url().string().utf8().data());
-
-#if USE(QUICK_LOOK)
- if (handle->quickLookHandle())
- handle->quickLookHandle()->didFail();
-#endif
-
- if (handle->client())
- handle->client()->didFail(handle, ResourceError(error));
-}
-
-static CFCachedURLResponseRef willCacheResponse(CFURLConnectionRef, CFCachedURLResponseRef cachedResponse, const void* clientInfo)
-{
- ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo));
-
-#if PLATFORM(WIN)
- // Workaround for <rdar://problem/6300990> Caching does not respect Vary HTTP header.
- // FIXME: WebCore cache has issues with Vary, too (bug 58797, bug 71509).
- CFURLResponseRef wrappedResponse = CFCachedURLResponseGetWrappedResponse(cachedResponse);
- if (CFHTTPMessageRef httpResponse = CFURLResponseGetHTTPResponse(wrappedResponse)) {
- ASSERT(CFHTTPMessageIsHeaderComplete(httpResponse));
- RetainPtr<CFStringRef> varyValue = adoptCF(CFHTTPMessageCopyHeaderFieldValue(httpResponse, CFSTR("Vary")));
- if (varyValue)
- return 0;
- }
-#endif // PLATFORM(WIN)
-
-#if PLATFORM(WIN)
- if (handle->client() && !handle->client()->shouldCacheResponse(handle, cachedResponse))
- return 0;
-#else
- CFCachedURLResponseRef newResponse = handle->client()->willCacheResponse(handle, cachedResponse);
- if (newResponse != cachedResponse)
- return newResponse;
-#endif
-
- CFRetain(cachedResponse);
-
- return cachedResponse;
-}
-
-static void didReceiveChallenge(CFURLConnectionRef conn, CFURLAuthChallengeRef challenge, const void* clientInfo)
-{
-#if LOG_DISABLED
- UNUSED_PARAM(conn);
-#endif
- ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo));
- ASSERT(handle);
- LOG(Network, "CFNet - didReceiveChallenge(conn=%p, handle=%p (%s)", conn, handle, handle->firstRequest().url().string().utf8().data());
-
- handle->didReceiveAuthenticationChallenge(AuthenticationChallenge(challenge, handle));
-}
-
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-static Boolean canRespondToProtectionSpace(CFURLConnectionRef conn, CFURLProtectionSpaceRef protectionSpace, const void* clientInfo)
-{
-#if LOG_DISABLED
- UNUSED_PARAM(conn);
-#endif
- ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo));
- ASSERT(handle);
-
- LOG(Network, "CFNet - canRespondToProtectionSpace(conn=%p, handle=%p (%s)", conn, handle, handle->firstRequest().url().string().utf8().data());
-
-#if PLATFORM(IOS)
- ProtectionSpace coreProtectionSpace = core(protectionSpace);
- if (coreProtectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeUnknown)
- return false;
- return handle->canAuthenticateAgainstProtectionSpace(coreProtectionSpace);
-#else
- return handle->canAuthenticateAgainstProtectionSpace(core(protectionSpace));
-#endif
-}
-#endif
-
</del><span class="cx"> ResourceHandleInternal::~ResourceHandleInternal()
</span><span class="cx"> {
</span><span class="cx"> if (m_connection) {
</span><span class="lines">@@ -477,9 +185,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- CFURLConnectionClient_V6 client = *ResourceHandle::connectionClientCallbacks();
- client.clientInfo = this;
-
</del><span class="cx"> CFMutableDictionaryRef streamProperties = CFDictionaryCreateMutable(0, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
</span><span class="cx"> if (!shouldUseCredentialStorage)
</span><span class="cx"> CFDictionarySetValue(streamProperties, CFSTR("_kCFURLConnectionSessionID"), CFSTR("WebKitPrivateSession"));
</span><span class="lines">@@ -502,6 +207,10 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> CFURLRequestSetShouldStartSynchronously(request.get(), 1);
</span><span class="cx"> #endif
</span><ins>+
+ d->m_connectionDelegate = adoptRef(new SynchronousResourceHandleCFURLConnectionDelegate(this));
+ CFURLConnectionClient_V6 client = d->m_connectionDelegate->makeConnectionClient();
+
</ins><span class="cx"> d->m_connection = adoptCF(CFURLConnectionCreateWithProperties(0, request.get(), reinterpret_cast<CFURLConnectionClient*>(&client), propertiesDictionary.get()));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -877,24 +586,4 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-#if USE(CFNETWORK)
-CFURLConnectionClient_V6* ResourceHandle::connectionClientCallbacks()
-{
- static CFURLConnectionClient_V6 client = { 6, 0, 0, 0, 0, WebCore::willSendRequest, didReceiveResponse, didReceiveData, 0, didFinishLoading, didFail, willCacheResponse, didReceiveChallenge, didSendBodyData, shouldUseCredentialStorageCallback, 0,
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
- canRespondToProtectionSpace,
-#else
- 0,
-#endif
- 0,
-#if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
- didReceiveDataArray
-#else
- 0
-#endif
- };
- return &client;
-}
-#endif // USE(QUICK_LOOK) && USE(CFNETWORK)
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfResourceHandleCFURLConnectionDelegatecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp (0 => 160338)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp        2013-12-09 23:45:03 UTC (rev 160338)
</span><span class="lines">@@ -0,0 +1,133 @@
</span><ins>+/*
+ * Copyright (C) 2004-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 COMPUTER, INC. ``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 COMPUTER, INC. OR
+ * 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 "ResourceHandleCFURLConnectionDelegate.h"
+
+#if USE(CFNETWORK)
+
+namespace WebCore {
+
+ResourceHandleCFURLConnectionDelegate::ResourceHandleCFURLConnectionDelegate(ResourceHandle* handle)
+ : m_handle(handle)
+{
+}
+
+ResourceHandleCFURLConnectionDelegate::~ResourceHandleCFURLConnectionDelegate()
+{
+}
+
+CFURLRequestRef ResourceHandleCFURLConnectionDelegate::willSendRequestCallback(CFURLConnectionRef, CFURLRequestRef cfRequest, CFURLResponseRef originalRedirectResponse, const void* clientInfo)
+{
+ return static_cast<ResourceHandleCFURLConnectionDelegate*>(const_cast<void*>(clientInfo))->willSendRequest(cfRequest, originalRedirectResponse);
+}
+
+void ResourceHandleCFURLConnectionDelegate::didReceiveResponseCallback(CFURLConnectionRef, CFURLResponseRef cfResponse, const void* clientInfo)
+{
+ static_cast<ResourceHandleCFURLConnectionDelegate*>(const_cast<void*>(clientInfo))->didReceiveResponse(cfResponse);
+}
+
+void ResourceHandleCFURLConnectionDelegate::didReceiveDataCallback(CFURLConnectionRef, CFDataRef data, CFIndex originalLength, const void* clientInfo)
+{
+ static_cast<ResourceHandleCFURLConnectionDelegate*>(const_cast<void*>(clientInfo))->didReceiveData(data, originalLength);
+}
+
+void ResourceHandleCFURLConnectionDelegate::didFinishLoadingCallback(CFURLConnectionRef, const void* clientInfo)
+{
+ static_cast<ResourceHandleCFURLConnectionDelegate*>(const_cast<void*>(clientInfo))->didFinishLoading();
+}
+
+void ResourceHandleCFURLConnectionDelegate::didFailCallback(CFURLConnectionRef, CFErrorRef error, const void* clientInfo)
+{
+ static_cast<ResourceHandleCFURLConnectionDelegate*>(const_cast<void*>(clientInfo))->didFail(error);
+}
+
+CFCachedURLResponseRef ResourceHandleCFURLConnectionDelegate::willCacheResponseCallback(CFURLConnectionRef, CFCachedURLResponseRef cachedResponse, const void* clientInfo)
+{
+ return static_cast<ResourceHandleCFURLConnectionDelegate*>(const_cast<void*>(clientInfo))->willCacheResponse(cachedResponse);
+}
+
+void ResourceHandleCFURLConnectionDelegate::didReceiveChallengeCallback(CFURLConnectionRef, CFURLAuthChallengeRef challenge, const void* clientInfo)
+{
+ static_cast<ResourceHandleCFURLConnectionDelegate*>(const_cast<void*>(clientInfo))->didReceiveChallenge(challenge);
+}
+
+void ResourceHandleCFURLConnectionDelegate::didSendBodyDataCallback(CFURLConnectionRef, CFIndex, CFIndex totalBytesWritten, CFIndex totalBytesExpectedToWrite, const void *clientInfo)
+{
+ static_cast<ResourceHandleCFURLConnectionDelegate*>(const_cast<void*>(clientInfo))->didSendBodyData(totalBytesWritten, totalBytesExpectedToWrite);
+}
+
+Boolean ResourceHandleCFURLConnectionDelegate::shouldUseCredentialStorageCallback(CFURLConnectionRef, const void* clientInfo)
+{
+ return static_cast<ResourceHandleCFURLConnectionDelegate*>(const_cast<void*>(clientInfo))->shouldUseCredentialStorage();
+
+}
+
+#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
+Boolean ResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpaceCallback(CFURLConnectionRef, CFURLProtectionSpaceRef protectionSpace, const void* clientInfo)
+{
+ return static_cast<ResourceHandleCFURLConnectionDelegate*>(const_cast<void*>(clientInfo))->canRespondToProtectionSpace(protectionSpace);
+}
+#endif // USE(PROTECTION_SPACE_AUTH_CALLBACK)
+
+#if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
+void ResourceHandleCFURLConnectionDelegate::didReceiveDataArrayCallback(CFURLConnectionRef, CFArrayRef dataArray, const void* clientInfo)
+{
+ static_cast<ResourceHandleCFURLConnectionDelegate*>(const_cast<void*>(clientInfo))->didReceiveDataArray(dataArray);
+}
+#endif // USE(NETWORK_CFDATA_ARRAY_CALLBACK)
+
+CFURLConnectionClient_V6 ResourceHandleCFURLConnectionDelegate::makeConnectionClient() const
+{
+ CFURLConnectionClient_V6 client = { 6, this, 0, 0, 0,
+ &ResourceHandleCFURLConnectionDelegate::willSendRequestCallback,
+ &ResourceHandleCFURLConnectionDelegate::didReceiveResponseCallback,
+ &ResourceHandleCFURLConnectionDelegate::didReceiveDataCallback,
+ 0,
+ &ResourceHandleCFURLConnectionDelegate::didFinishLoadingCallback,
+ &ResourceHandleCFURLConnectionDelegate::didFailCallback,
+ &ResourceHandleCFURLConnectionDelegate::willCacheResponseCallback,
+ &ResourceHandleCFURLConnectionDelegate::didReceiveChallengeCallback,
+ &ResourceHandleCFURLConnectionDelegate::didSendBodyDataCallback,
+ &ResourceHandleCFURLConnectionDelegate::shouldUseCredentialStorageCallback,
+ 0,
+#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
+ &ResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpaceCallback,
+#else
+ 0,
+#endif
+ 0,
+#if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
+ &ResourceHandleCFURLConnectionDelegate::didReceiveDataArrayCallback
+#else
+ 0
+#endif
+ };
+ return client;
+}
+
+} // namespace WebCore.
+
+#endif // USE(CFNETWORK)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfResourceHandleCFURLConnectionDelegateh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegate.h (0 => 160338)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegate.h         (rev 0)
+++ trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegate.h        2013-12-09 23:45:03 UTC (rev 160338)
</span><span class="lines">@@ -0,0 +1,86 @@
</span><ins>+/*
+ * Copyright (C) 2004-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 COMPUTER, INC. ``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 COMPUTER, INC. OR
+ * 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.
+ */
+
+#ifndef ResourceHandleCFURLConnectionDelegate_h
+#define ResourceHandleCFURLConnectionDelegate_h
+
+#if USE(CFNETWORK)
+
+#include <CFNetwork/CFURLConnectionPriv.h>
+#include <wtf/ThreadSafeRefCounted.h>
+
+namespace WebCore {
+
+class ResourceHandle;
+
+class ResourceHandleCFURLConnectionDelegate : public ThreadSafeRefCounted<ResourceHandleCFURLConnectionDelegate> {
+public:
+ ResourceHandleCFURLConnectionDelegate(ResourceHandle*);
+ virtual ~ResourceHandleCFURLConnectionDelegate();
+
+ CFURLConnectionClient_V6 makeConnectionClient() const;
+
+private:
+ static CFURLRequestRef willSendRequestCallback(CFURLConnectionRef, CFURLRequestRef, CFURLResponseRef, const void* clientInfo);
+ static void didReceiveResponseCallback(CFURLConnectionRef, CFURLResponseRef, const void* clientInfo);
+ static void didReceiveDataCallback(CFURLConnectionRef, CFDataRef, CFIndex originalLength, const void* clientInfo);
+ static void didFinishLoadingCallback(CFURLConnectionRef, const void* clientInfo);
+ static void didFailCallback(CFURLConnectionRef, CFErrorRef, const void* clientInfo);
+ static CFCachedURLResponseRef willCacheResponseCallback(CFURLConnectionRef, CFCachedURLResponseRef, const void* clientInfo);
+ static void didReceiveChallengeCallback(CFURLConnectionRef, CFURLAuthChallengeRef, const void* clientInfo);
+ static void didSendBodyDataCallback(CFURLConnectionRef, CFIndex, CFIndex totalBytesWritten, CFIndex totalBytesExpectedToWrite, const void *clientInfo);
+ static Boolean shouldUseCredentialStorageCallback(CFURLConnectionRef, const void* clientInfo);
+#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
+ static Boolean canRespondToProtectionSpaceCallback(CFURLConnectionRef, CFURLProtectionSpaceRef, const void* clientInfo);
+#endif // USE(PROTECTION_SPACE_AUTH_CALLBACK)
+#if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
+ static void didReceiveDataArrayCallback(CFURLConnectionRef, CFArrayRef, const void* clientInfo);
+#endif // USE(NETWORK_CFDATA_ARRAY_CALLBACK)
+
+ virtual CFURLRequestRef willSendRequest(CFURLRequestRef, CFURLResponseRef) = 0;
+ virtual void didReceiveResponse(CFURLResponseRef) = 0;
+ virtual void didReceiveData(CFDataRef, CFIndex originalLength) = 0;
+ virtual void didFinishLoading() = 0;
+ virtual void didFail(CFErrorRef) = 0;
+ virtual CFCachedURLResponseRef willCacheResponse(CFCachedURLResponseRef) = 0;
+ virtual void didReceiveChallenge(CFURLAuthChallengeRef) = 0;
+ virtual void didSendBodyData(CFIndex totalBytesWritten, CFIndex totalBytesExpectedToWrite) = 0;
+ virtual Boolean shouldUseCredentialStorage() = 0;
+#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
+ virtual Boolean canRespondToProtectionSpace(CFURLProtectionSpaceRef) = 0;
+#endif // USE(PROTECTION_SPACE_AUTH_CALLBACK)
+#if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
+ virtual void didReceiveDataArray(CFArrayRef dataArray) = 0;
+#endif // USE(NETWORK_CFDATA_ARRAY_CALLBACK)
+
+protected:
+ ResourceHandle* m_handle;
+};
+
+} // namespace WebCore.
+
+#endif // USE(CFNETWORK)
+
+#endif // ResourceHandleCFURLConnectionDelegate_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfSynchronousResourceHandleCFURLConnectionDelegatecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp (0 => 160338)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp        2013-12-09 23:45:03 UTC (rev 160338)
</span><span class="lines">@@ -0,0 +1,306 @@
</span><ins>+/*
+ * Copyright (C) 2004-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 COMPUTER, INC. ``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 COMPUTER, INC. OR
+ * 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 "SynchronousResourceHandleCFURLConnectionDelegate.h"
+
+#if USE(CFNETWORK)
+
+#include "AuthenticationCF.h"
+#include "AuthenticationChallenge.h"
+#include "FormDataStreamCFNet.h"
+#include "Logging.h"
+#include "NetworkingContext.h"
+#include "ResourceHandle.h"
+#include "ResourceHandleClient.h"
+#include "ResourceRequest.h"
+#include "ResourceResponse.h"
+#include "SharedBuffer.h"
+#include <wtf/RetainPtr.h>
+#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
+
+#if PLATFORM(MAC)
+#include "WebCoreSystemInterface.h"
+#include "WebCoreURLResponse.h"
+#endif // PLATFORM(MAC)
+
+#if PLATFORM(WIN)
+#include "MIMETypeRegistry.h"
+#include <WebKitSystemInterface/WebKitSystemInterface.h>
+#endif // PLATFORM(WIN)
+
+namespace WebCore {
+
+SynchronousResourceHandleCFURLConnectionDelegate::SynchronousResourceHandleCFURLConnectionDelegate(ResourceHandle* handle)
+ : ResourceHandleCFURLConnectionDelegate(handle)
+{
+}
+
+static RetainPtr<CFURLResponseRef> synthesizeRedirectResponseIfNecessary(const ResourceRequest& currentRequest, CFURLRequestRef newRequest, CFURLResponseRef cfRedirectResponse)
+{
+ if (cfRedirectResponse)
+ return cfRedirectResponse;
+
+ CFURLRef newURL = CFURLRequestGetURL(newRequest);
+ RetainPtr<CFStringRef> newScheme = adoptCF(CFURLCopyScheme(newURL));
+
+ // If the protocols of the new request and the current request match, this is not an HSTS redirect and we shouldn't synthesize a redirect response.
+ if (currentRequest.url().protocol() == String(newScheme.get()))
+ return 0;
+
+ RetainPtr<CFURLRef> currentURL = currentRequest.url().createCFURL();
+ RetainPtr<CFHTTPMessageRef> responseMessage = adoptCF(CFHTTPMessageCreateResponse(0, 302, 0, kCFHTTPVersion1_1));
+ RetainPtr<CFURLRef> newAbsoluteURL = adoptCF(CFURLCopyAbsoluteURL(newURL));
+ CFHTTPMessageSetHeaderFieldValue(responseMessage.get(), CFSTR("Location"), CFURLGetString(newAbsoluteURL.get()));
+ CFHTTPMessageSetHeaderFieldValue(responseMessage.get(), CFSTR("Cache-Control"), CFSTR("no-store"));
+
+ RetainPtr<CFURLResponseRef> newResponse = adoptCF(CFURLResponseCreateWithHTTPResponse(0, currentURL.get(), responseMessage.get(), kCFURLCacheStorageNotAllowed));
+ return newResponse;
+}
+
+CFURLRequestRef SynchronousResourceHandleCFURLConnectionDelegate::willSendRequest(CFURLRequestRef cfRequest, CFURLResponseRef originalRedirectResponse)
+{
+ RetainPtr<CFURLResponseRef> redirectResponse = synthesizeRedirectResponseIfNecessary(m_handle->currentRequest(), cfRequest, originalRedirectResponse);
+
+ if (!redirectResponse) {
+ CFRetain(cfRequest);
+ return cfRequest;
+ }
+
+ LOG(Network, "CFNet - SynchronousResourceHandleCFURLConnectionDelegate::willSendRequest(handle=%p) (%s)", m_handle, m_handle->firstRequest().url().string().utf8().data());
+
+ ResourceRequest request;
+ CFHTTPMessageRef httpMessage = CFURLResponseGetHTTPResponse(redirectResponse.get());
+ if (httpMessage && CFHTTPMessageGetResponseStatusCode(httpMessage) == 307) {
+ RetainPtr<CFStringRef> lastHTTPMethod = m_handle->lastHTTPMethod().createCFString();
+ RetainPtr<CFStringRef> newMethod = adoptCF(CFURLRequestCopyHTTPRequestMethod(cfRequest));
+ if (CFStringCompareWithOptions(lastHTTPMethod.get(), newMethod.get(), CFRangeMake(0, CFStringGetLength(lastHTTPMethod.get())), kCFCompareCaseInsensitive)) {
+ RetainPtr<CFMutableURLRequestRef> mutableRequest = adoptCF(CFURLRequestCreateMutableCopy(0, cfRequest));
+ wkSetRequestStorageSession(m_handle->storageSession(), mutableRequest.get());
+ CFURLRequestSetHTTPRequestMethod(mutableRequest.get(), lastHTTPMethod.get());
+
+ FormData* body = m_handle->firstRequest().httpBody();
+ if (!equalIgnoringCase(m_handle->firstRequest().httpMethod(), "GET") && body && !body->isEmpty())
+ WebCore::setHTTPBody(mutableRequest.get(), body);
+
+ String originalContentType = m_handle->firstRequest().httpContentType();
+ if (!originalContentType.isEmpty())
+ CFURLRequestSetHTTPHeaderFieldValue(mutableRequest.get(), CFSTR("Content-Type"), originalContentType.createCFString().get());
+
+ request = mutableRequest.get();
+ }
+ }
+ if (request.isNull())
+ request = cfRequest;
+
+ // Should not set Referer after a redirect from a secure resource to non-secure one.
+ if (!request.url().protocolIs("https") && protocolIs(request.httpReferrer(), "https") && m_handle->context()->shouldClearReferrerOnHTTPSToHTTPRedirect())
+ request.clearHTTPReferrer();
+
+ m_handle->willSendRequest(request, redirectResponse.get());
+
+ if (request.isNull())
+ return 0;
+
+ cfRequest = request.cfURLRequest(UpdateHTTPBody);
+
+ CFRetain(cfRequest);
+ return cfRequest;
+}
+
+#if !PLATFORM(MAC)
+static void setDefaultMIMEType(CFURLResponseRef response)
+{
+ static CFStringRef defaultMIMETypeString = defaultMIMEType().createCFString().leakRef();
+
+ CFURLResponseSetMIMEType(response, defaultMIMETypeString);
+}
+#endif // !PLATFORM(MAC)
+
+void SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse(CFURLResponseRef cfResponse)
+{
+ LOG(Network, "CFNet - SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse(handle=%p) (%s)", m_handle, m_handle->firstRequest().url().string().utf8().data());
+
+ if (!m_handle->client())
+ return;
+
+#if PLATFORM(MAC)
+ // Avoid MIME type sniffing if the response comes back as 304 Not Modified.
+ CFHTTPMessageRef msg = wkGetCFURLResponseHTTPResponse(cfResponse);
+ int statusCode = msg ? CFHTTPMessageGetResponseStatusCode(msg) : 0;
+
+ if (statusCode != 304)
+ adjustMIMETypeIfNecessary(cfResponse);
+
+#if !PLATFORM(IOS)
+ if (_CFURLRequestCopyProtocolPropertyForKey(m_handle->firstRequest().cfURLRequest(DoNotUpdateHTTPBody), CFSTR("ForceHTMLMIMEType")))
+ wkSetCFURLResponseMIMEType(cfResponse, CFSTR("text/html"));
+#endif // !PLATFORM(IOS)
+#else
+ if (!CFURLResponseGetMIMEType(cfResponse)) {
+ // We should never be applying the default MIMEType if we told the networking layer to do content sniffing for handle.
+ ASSERT(!m_handle->shouldContentSniff());
+ setDefaultMIMEType(cfResponse);
+ }
+#endif
+
+#if USE(QUICK_LOOK)
+ m_handle->setQuickLookHandle(QuickLookHandle::create(m_handle, this, cfResponse));
+ if (m_handle->quickLookHandle())
+ cfResponse = m_handle->quickLookHandle()->cfResponse();
+#endif
+
+ m_handle->client()->didReceiveResponse(m_handle, cfResponse);
+}
+
+void SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData(CFDataRef data, CFIndex originalLength)
+{
+ LOG(Network, "CFNet - SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData(handle=%p, bytes=%ld) (%s)", m_handle, CFDataGetLength(data), m_handle->firstRequest().url().string().utf8().data());
+
+#if USE(QUICK_LOOK)
+ if (m_handle->quickLookHandle() && m_handle->quickLookHandle()->didReceiveData(data))
+ return;
+#endif
+
+ if (ResourceHandleClient* client = m_handle->client())
+ client->didReceiveBuffer(m_handle, SharedBuffer::wrapCFData(data), originalLength);
+}
+
+void SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading()
+{
+ LOG(Network, "CFNet - SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading(handle=%p) (%s)", m_handle, m_handle->firstRequest().url().string().utf8().data());
+
+#if USE(QUICK_LOOK)
+ if (m_handle->quickLookHandle() && m_handle->quickLookHandle()->didFinishLoading())
+ return;
+#endif
+
+ if (ResourceHandleClient* client = m_handle->client())
+ client->didFinishLoading(m_handle, 0);
+}
+
+void SynchronousResourceHandleCFURLConnectionDelegate::didFail(CFErrorRef error)
+{
+ LOG(Network, "CFNet - SynchronousResourceHandleCFURLConnectionDelegate::didFail(handle=%p, error = %p) (%s)", m_handle, error, m_handle->firstRequest().url().string().utf8().data());
+
+#if USE(QUICK_LOOK)
+ if (QuickLookHandle* quickLookHandle = m_handle->quickLookHandle())
+ quickLookHandle->didFail();
+#endif
+
+ if (ResourceHandleClient* client = m_handle->client())
+ client->didFail(m_handle, ResourceError(error));
+}
+
+CFCachedURLResponseRef SynchronousResourceHandleCFURLConnectionDelegate::willCacheResponse(CFCachedURLResponseRef cachedResponse)
+{
+#if PLATFORM(WIN)
+ // Workaround for <rdar://problem/6300990> Caching does not respect Vary HTTP header.
+ // FIXME: WebCore cache has issues with Vary, too (bug 58797, bug 71509).
+ CFURLResponseRef wrappedResponse = CFCachedURLResponseGetWrappedResponse(cachedResponse);
+ if (CFHTTPMessageRef httpResponse = CFURLResponseGetHTTPResponse(wrappedResponse)) {
+ ASSERT(CFHTTPMessageIsHeaderComplete(httpResponse));
+ RetainPtr<CFStringRef> varyValue = adoptCF(CFHTTPMessageCopyHeaderFieldValue(httpResponse, CFSTR("Vary")));
+ if (varyValue)
+ return 0;
+ }
+#endif // PLATFORM(WIN)
+
+#if PLATFORM(WIN)
+ if (m_handle->client() && !m_handle->client()->shouldCacheResponse(m_handle, cachedResponse))
+ return 0;
+#else
+ CFCachedURLResponseRef newResponse = m_handle->client()->willCacheResponse(m_handle, cachedResponse);
+ if (newResponse != cachedResponse)
+ return newResponse;
+#endif
+
+ CFRetain(cachedResponse);
+ return cachedResponse;
+}
+
+void SynchronousResourceHandleCFURLConnectionDelegate::didReceiveChallenge(CFURLAuthChallengeRef challenge)
+{
+ LOG(Network, "CFNet - SynchronousResourceHandleCFURLConnectionDelegate::didReceiveChallenge(handle=%p (%s)", m_handle, m_handle->firstRequest().url().string().utf8().data());
+
+ m_handle->didReceiveAuthenticationChallenge(AuthenticationChallenge(challenge, m_handle));
+}
+
+void SynchronousResourceHandleCFURLConnectionDelegate::didSendBodyData(CFIndex totalBytesWritten, CFIndex totalBytesExpectedToWrite)
+{
+ if (!m_handle || !m_handle->client())
+ return;
+ m_handle->client()->didSendData(m_handle, totalBytesWritten, totalBytesExpectedToWrite);
+}
+
+Boolean SynchronousResourceHandleCFURLConnectionDelegate::shouldUseCredentialStorage()
+{
+ LOG(Network, "CFNet - SynchronousResourceHandleCFURLConnectionDelegate::shouldUseCredentialStorage(handle=%p) (%s)", m_handle, m_handle->firstRequest().url().string().utf8().data());
+
+ if (!m_handle)
+ return false;
+
+ return m_handle->shouldUseCredentialStorage();
+}
+
+#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
+Boolean SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace(CFURLProtectionSpaceRef protectionSpace)
+{
+ ASSERT(m_handle);
+
+ LOG(Network, "CFNet - SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace(handle=%p (%s)", m_handle, m_handle->firstRequest().url().string().utf8().data());
+
+#if PLATFORM(IOS)
+ ProtectionSpace coreProtectionSpace = core(protectionSpace);
+ if (coreProtectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeUnknown)
+ return false;
+ return m_handle->canAuthenticateAgainstProtectionSpace(coreProtectionSpace);
+#else
+ return m_handle->canAuthenticateAgainstProtectionSpace(core(protectionSpace));
+#endif
+}
+#endif // USE(PROTECTION_SPACE_AUTH_CALLBACK)
+
+#if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
+void SynchronousResourceHandleCFURLConnectionDelegate::didReceiveDataArray(CFArrayRef dataArray)
+{
+ if (!m_handle->client())
+ return;
+
+ LOG(Network, "CFNet - SynchronousResourceHandleCFURLConnectionDelegate::didReceiveDataArray(handle=%p, arrayLength=%ld) (%s)", m_handle, CFArrayGetCount(dataArray), m_handle->firstRequest().url().string().utf8().data());
+
+#if USE(QUICK_LOOK)
+ if (m_handle->quickLookHandle() && m_handle->quickLookHandle()->didReceiveDataArray(dataArray))
+ return;
+#endif
+
+ m_handle->handleDataArray(dataArray);
+}
+#endif // USE(NETWORK_CFDATA_ARRAY_CALLBACK)
+
+} // namespace WebCore.
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfSynchronousResourceHandleCFURLConnectionDelegateh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h (0 => 160338)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h         (rev 0)
+++ trunk/Source/WebCore/platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h        2013-12-09 23:45:03 UTC (rev 160338)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+/*
+ * Copyright (C) 2004-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 COMPUTER, INC. ``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 COMPUTER, INC. OR
+ * 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.
+ */
+
+#ifndef SynchronousResourceHandleCFURLConnectionDelegate_h
+#define SynchronousResourceHandleCFURLConnectionDelegate_h
+
+#if USE(CFNETWORK)
+
+#include "ResourceHandleCFURLConnectionDelegate.h"
+
+namespace WebCore {
+
+class SynchronousResourceHandleCFURLConnectionDelegate FINAL : public ResourceHandleCFURLConnectionDelegate {
+public:
+ SynchronousResourceHandleCFURLConnectionDelegate(ResourceHandle*);
+
+ virtual void didReceiveData(CFDataRef, CFIndex originalLength) OVERRIDE;
+ virtual void didFinishLoading() OVERRIDE;
+ virtual void didFail(CFErrorRef) OVERRIDE;
+#if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
+ virtual void didReceiveDataArray(CFArrayRef dataArray) OVERRIDE;
+#endif // USE(NETWORK_CFDATA_ARRAY_CALLBACK)
+
+private:
+ virtual CFURLRequestRef willSendRequest(CFURLRequestRef, CFURLResponseRef) OVERRIDE;
+ virtual void didReceiveResponse(CFURLResponseRef) OVERRIDE;
+ virtual CFCachedURLResponseRef willCacheResponse(CFCachedURLResponseRef) OVERRIDE;
+ virtual void didReceiveChallenge(CFURLAuthChallengeRef) OVERRIDE;
+ virtual void didSendBodyData(CFIndex totalBytesWritten, CFIndex totalBytesExpectedToWrite) OVERRIDE;
+ virtual Boolean shouldUseCredentialStorage() OVERRIDE;
+#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
+ virtual Boolean canRespondToProtectionSpace(CFURLProtectionSpaceRef) OVERRIDE;
+#endif // USE(PROTECTION_SPACE_AUTH_CALLBACK)
+};
+
+} // namespace WebCore.
+
+#endif // USE(CFNETWORK)
+
+#endif // ResourceHandleCFURLConnectionDelegate_h
</ins></span></pre>
</div>
</div>
</body>
</html>