<!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>[150853] trunk</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/150853">150853</a></dd>
<dt>Author</dt> <dd>ap@apple.com</dd>
<dt>Date</dt> <dd>2013-05-28 16:26:48 -0700 (Tue, 28 May 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>        Freeze when loading a particular page on washingtonpost.com with NetworkProcess enabled
        https://bugs.webkit.org/show_bug.cgi?id=116887
        &lt;rdar://problem/12965959&gt;

        Reviewed by Darin Adler.

        * Shared/cf/ArgumentCodersCF.cpp:
        (CoreIPC::encode):
        (CoreIPC::decode):
        Fix for the bug: use good shared WebCore code to manipulate CFURLs. Also, added
        a FIXME about empty URLs.

        * Shared/API/c/cf/WKURLCF.cpp: (WKURLCreateWithCFURL): Fixed to not use
        CFURLGetString, as that could prevent loading certain resources, like ones with
        curly braces in resource specifiers. We want KURL normalization, not CFURL one.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcprojWebCorevcproj">trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj</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="#trunkSourceWebCoreplatformKURLcpp">trunk/Source/WebCore/platform/KURL.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformcfKURLCFNetcpp">trunk/Source/WebCore/platform/cf/KURLCFNet.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmacKURLMacmm">trunk/Source/WebCore/platform/mac/KURLMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfResourceErrorCFcpp">trunk/Source/WebCore/platform/network/cf/ResourceErrorCF.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedAPIccfWKURLCFcpp">trunk/Source/WebKit2/Shared/API/c/cf/WKURLCF.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedcfArgumentCodersCFcpp">trunk/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestsuricurlybracesescapingexpectedtxt">trunk/LayoutTests/http/tests/uri/curly-braces-escaping-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsuricurlybracesescapinghtml">trunk/LayoutTests/http/tests/uri/curly-braces-escaping.html</a></li>
<li><a href="#trunkLayoutTestshttptestsuriresourcesechouriphp">trunk/LayoutTests/http/tests/uri/resources/echo-uri.php</a></li>
<li><a href="#trunkSourceWebCoreplatformcfCFURLExtrascpp">trunk/Source/WebCore/platform/cf/CFURLExtras.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformcfCFURLExtrash">trunk/Source/WebCore/platform/cf/CFURLExtras.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (150852 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-05-28 23:26:47 UTC (rev 150852)
+++ trunk/LayoutTests/ChangeLog        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2013-05-28  Alexey Proskuryakov  &lt;ap@apple.com&gt;
+
+        Freeze when loading a particular page on washingtonpost.com with NetworkProcess enabled
+        https://bugs.webkit.org/show_bug.cgi?id=116887
+        &lt;rdar://problem/12965959&gt;
+
+        Reviewed by Darin Adler.
+
+        * http/tests/uri/curly-braces-escaping-expected.txt: Added.
+        * http/tests/uri/curly-braces-escaping.html: Added.
+        * http/tests/uri/resources/echo-uri.php: Added.
+
</ins><span class="cx"> 2013-05-28  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Windows] More attempts to make the bot green.
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsuricurlybracesescapingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/uri/curly-braces-escaping-expected.txt (0 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/uri/curly-braces-escaping-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/uri/curly-braces-escaping-expected.txt        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Test that curly braces are not escaped in request queries (bug 116887)
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS req.responseText is '/uri/resources/echo-uri.php?q={}'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/http/tests/uri/curly-braces-escaping-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestshttptestsuricurlybracesescapinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/uri/curly-braces-escaping.html (0 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/uri/curly-braces-escaping.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/uri/curly-braces-escaping.html        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;/js-test-resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test that curly braces are not escaped in request queries (bug 116887)&quot;);
+
+jsTestIsAsync = true;
+
+var req = new XMLHttpRequest;
+req.open(&quot;GET&quot;,  &quot;resources/echo-uri.php?q={}&quot;, true);
+req.onload = function() {
+    shouldBe(&quot;req.responseText&quot;, &quot;'/uri/resources/echo-uri.php?q={}'&quot;);
+    finishJSTest();
+}
+req.send();
+
+&lt;/script&gt;
+&lt;script src=&quot;/js-test-resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/http/tests/uri/curly-braces-escaping.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestshttptestsuriresourcesechouriphp"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/uri/resources/echo-uri.php (0 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/uri/resources/echo-uri.php                                (rev 0)
+++ trunk/LayoutTests/http/tests/uri/resources/echo-uri.php        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+&lt;?php
+    header(&quot;Content-Type: text/plain&quot;);
+    header(&quot;Expires: Thu, 01 Dec 2003 16:00:00 GMT\n&quot;);
+    header(&quot;Cache-Control: no-store, no-cache, must-revalidate\n&quot;);
+    header(&quot;Pragma: no-cache\n&quot;);
+    echo $_SERVER['REQUEST_URI'];
+?&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (150852 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-05-28 23:26:47 UTC (rev 150852)
+++ trunk/Source/WebCore/ChangeLog        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -1,3 +1,50 @@
</span><ins>+2013-05-28  Alexey Proskuryakov  &lt;ap@apple.com&gt;
+
+        Freeze when loading a particular page on washingtonpost.com with NetworkProcess enabled
+        https://bugs.webkit.org/show_bug.cgi?id=116887
+        &lt;rdar://problem/12965959&gt;
+
+        Reviewed by Darin Adler.
+
+        Test: http/tests/uri/curly-braces-escaping.html
+
+        The issue was that WebKit used an incorrect accessor to get a string out of CFURL,
+        unlike WebCore.
+
+        Centralized code for converting between CFURLs and strings in a place that WebKit
+        can use directly.
+
+        * WebCore.exp.in:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        Keeping things building.
+
+        * platform/KURL.cpp: (WebCore::KURL::copyToBuffer):
+        * platform/KURL.h:
+        Updated for a new typedef name. The code was using Vector&lt;char, 512&gt; and CharBuffer
+        inconsistently, and now URLs use URLCharBuffer.
+
+        * platform/cf/CFURLExtras.cpp: Added.
+        (WebCore::createCFURLFromBuffer):
+        (WebCore::getURLBytes):
+        * platform/cf/CFURLExtras.h: Added.
+        * platform/cf/KURLCFNet.cpp:
+        (WebCore::KURL::KURL):
+        (WebCore::KURL::createCFURL):
+        Extracted code for CFURL string manipulation that is not logcally part of KURL.
+
+        * platform/mac/KURLMac.mm:
+        (WebCore::KURL::KURL): Use the new getURLBytes function.
+        (WebCore::KURL::operator NSURL *): Added a comment.
+        (WebCore::KURL::createCFURL): Added a comment, and updated for new names and
+        signatures.
+
+        * platform/network/cf/ResourceErrorCF.cpp: (WebCore::ResourceError::platformLazyInit):
+        Added a FIXME. We are still using CFURLGetString here. The difficulty is getting
+        encodings right.
+
</ins><span class="cx"> 2013-05-28  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Create a html/forms subdirectory and move FileIconLoader there
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (150852 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2013-05-28 23:26:47 UTC (rev 150852)
+++ trunk/Source/WebCore/WebCore.exp.in        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -167,6 +167,8 @@
</span><span class="cx"> __ZN7WebCore11PageConsole24setShouldPrintExceptionsEb
</span><span class="cx"> __ZN7WebCore11SQLResultOkE
</span><span class="cx"> __ZN7WebCore11URLWithDataEP6NSDataP5NSURL
</span><ins>+__ZN7WebCore11getURLBytesEPK7__CFURLRN3WTF7CStringE
+__ZN7WebCore11getURLBytesEPK7__CFURLRN3WTF6VectorIcLm512ENS3_15CrashOnOverflowEEE
</ins><span class="cx"> __ZN7WebCore11iBeamCursorEv
</span><span class="cx"> __ZN7WebCore11memoryCacheEv
</span><span class="cx"> __ZN7WebCore11startOfLineERKNS_15VisiblePositionE
</span><span class="lines">@@ -717,6 +719,7 @@
</span><span class="cx"> __ZN7WebCore21URLByRemovingUserInfoEP5NSURL
</span><span class="cx"> __ZN7WebCore21UserContentURLPattern5parseERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore21WindowsLatin1EncodingEv
</span><ins>+__ZN7WebCore21createCFURLFromBufferEPKcmPK7__CFURL
</ins><span class="cx"> __ZN7WebCore21findEventWithKeyStateEPNS_5EventE
</span><span class="cx"> __ZN7WebCore21getCachedDOMStructureEPNS_17JSDOMGlobalObjectEPKN3JSC9ClassInfoE
</span><span class="cx"> __ZN7WebCore21isBackForwardLoadTypeENS_13FrameLoadTypeE
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcprojWebCorevcproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (150852 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj        2013-05-28 23:26:47 UTC (rev 150852)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -29722,6 +29722,14 @@
</span><span class="cx">                                 Name=&quot;cf&quot;
</span><span class="cx">                                 &gt;
</span><span class="cx">                                 &lt;File
</span><ins>+                                        RelativePath=&quot;..\platform\cf\CFURLExtras.cpp&quot;
+                                        &gt;
+                                &lt;/File&gt;
+                                &lt;File
+                                        RelativePath=&quot;..\platform\cf\CFURLExtras.h&quot;
+                                        &gt;
+                                &lt;/File&gt;
+                                &lt;File
</ins><span class="cx">                                         RelativePath=&quot;..\platform\cf\FileSystemCF.cpp&quot;
</span><span class="cx">                                         &gt;
</span><span class="cx">                                 &lt;/File&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (150852 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-05-28 23:26:47 UTC (rev 150852)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -4221,6 +4221,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\win\WheelEventWin.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\win\WidgetWin.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\win\WindowMessageBroadcaster.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\platform\cf\CFURLExtras.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\platform\cf\FileSystemCF.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\cf\KURLCFNet.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\cf\SharedBufferCF.cpp&quot; /&gt;
</span><span class="lines">@@ -11608,6 +11609,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\win\WindowMessageBroadcaster.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\win\WindowMessageListener.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\win\WindowsTouch.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\platform\cf\CFURLExtras.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\platform\cf\win\CertificateCFWin.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\BitmapImage.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\Color.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (150852 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2013-05-28 23:26:47 UTC (rev 150852)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -5178,6 +5178,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\Chrome.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;page&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\platform\cf\CFURLExtras.cpp&quot;&gt;
+      &lt;Filter&gt;platform\cf&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\platform\cf\SharedBufferCF.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\cf&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -12682,6 +12685,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\svg\SVGAnimatedTypeAnimator.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;rendering\svg&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\platform\cf\CFURLExtras.h&quot;&gt;
+      &lt;Filter&gt;platform\cf&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\platform\cf\win\CertificateCFWin.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\cf\win&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (150852 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-05-28 23:26:47 UTC (rev 150852)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -5419,6 +5419,8 @@
</span><span class="cx">                 E1A5F99B0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1A5F99A0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp */; };
</span><span class="cx">                 E1A643F20EC0972500779668 /* WorkerScriptController.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A643F10EC0972500779668 /* WorkerScriptController.h */; };
</span><span class="cx">                 E1A643FD0EC097A000779668 /* WorkerScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1A643FC0EC097A000779668 /* WorkerScriptController.cpp */; };
</span><ins>+                E1A8E56617552B2A007488E7 /* CFURLExtras.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1A8E56417552B2A007488E7 /* CFURLExtras.cpp */; };
+                E1A8E56717552B2A007488E7 /* CFURLExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A8E56517552B2A007488E7 /* CFURLExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 E1ACAF4C0E791AAF0087D12B /* DOMMessagePort.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1ACAF4A0E791AAF0087D12B /* DOMMessagePort.mm */; };
</span><span class="cx">                 E1ACAF4D0E791AAF0087D12B /* DOMMessagePort.h in Headers */ = {isa = PBXBuildFile; fileRef = E1ACAF4B0E791AAF0087D12B /* DOMMessagePort.h */; };
</span><span class="cx">                 E1AD12D61295D0BD00ACA989 /* JSProcessingInstructionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1AD12D51295D0BD00ACA989 /* JSProcessingInstructionCustom.cpp */; };
</span><span class="lines">@@ -12201,6 +12203,8 @@
</span><span class="cx">                 E1A5F99A0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMessageChannelCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1A643F10EC0972500779668 /* WorkerScriptController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerScriptController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1A643FC0EC097A000779668 /* WorkerScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerScriptController.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E1A8E56417552B2A007488E7 /* CFURLExtras.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CFURLExtras.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E1A8E56517552B2A007488E7 /* CFURLExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFURLExtras.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E1AB1EA814E9E27D00449E13 /* FileList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = FileList.idl; path = fileapi/FileList.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1AB1EAB14E9E2EF00449E13 /* DirectoryEntry.idl */ = {isa = PBXFileReference; lastKnownFileType = text; name = DirectoryEntry.idl; path = Modules/filesystem/DirectoryEntry.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1AB1EAC14E9E2F800449E13 /* DirectoryEntrySync.idl */ = {isa = PBXFileReference; lastKnownFileType = text; name = DirectoryEntrySync.idl; path = Modules/filesystem/DirectoryEntrySync.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13404,6 +13408,8 @@
</span><span class="cx">                 1AE42F670AA4B8CB00C8612D /* cf */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                E1A8E56417552B2A007488E7 /* CFURLExtras.cpp */,
+                                E1A8E56517552B2A007488E7 /* CFURLExtras.h */,
</ins><span class="cx">                                 5160306B0CC4362300C8AC25 /* FileSystemCF.cpp */,
</span><span class="cx">                                 1A98956A0AA78F80005EF5EF /* KURLCFNet.cpp */,
</span><span class="cx">                                 29A309AB1561C99B00BBD8E5 /* RunLoopCF.cpp */,
</span><span class="lines">@@ -20916,6 +20922,7 @@
</span><span class="cx">                                 0709FC4E1025DEE30059CDBA /* AccessibilitySlider.h in Headers */,
</span><span class="cx">                                 29D7BCFA1444AF7D0070619C /* AccessibilitySpinButton.h in Headers */,
</span><span class="cx">                                 AAC08CF315F941FD00F1E188 /* AccessibilitySVGRoot.h in Headers */,
</span><ins>+                                E1A8E56717552B2A007488E7 /* CFURLExtras.h in Headers */,
</ins><span class="cx">                                 29A8122B0FBB9C1D00510293 /* AccessibilityTable.h in Headers */,
</span><span class="cx">                                 29A812320FBB9C1D00510293 /* AccessibilityTableCell.h in Headers */,
</span><span class="cx">                                 29A812410FBB9C1D00510293 /* AccessibilityTableColumn.h in Headers */,
</span><span class="lines">@@ -26199,6 +26206,7 @@
</span><span class="cx">                                 1AF8E13312565A4400230FF7 /* ProxyServer.cpp in Sources */,
</span><span class="cx">                                 1AF8E1C3125673E000230FF7 /* ProxyServerCFNet.cpp in Sources */,
</span><span class="cx">                                 FF945ECB161F7F3600971BC8 /* PseudoElement.cpp in Sources */,
</span><ins>+                                E1A8E56617552B2A007488E7 /* CFURLExtras.cpp in Sources */,
</ins><span class="cx">                                 0081FEFF16B0A2B6008AAA7A /* PublicSuffixMac.mm in Sources */,
</span><span class="cx">                                 E4D687770ED7AE3D006EA978 /* PurgeableBufferMac.cpp in Sources */,
</span><span class="cx">                                 550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformKURLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/KURL.cpp (150852 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/KURL.cpp        2013-05-28 23:26:47 UTC (rev 150852)
+++ trunk/Source/WebCore/platform/KURL.cpp        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -1695,7 +1695,7 @@
</span><span class="cx">     return m_string[m_schemeEnd + 1] == '/';
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void KURL::copyToBuffer(CharBuffer&amp; buffer) const
</del><ins>+void KURL::copyToBuffer(Vector&lt;char, 512&gt;&amp; buffer) const
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: This throws away the high bytes of all the characters in the string!
</span><span class="cx">     // That's fine for a valid URL, which is all ASCII, but not for invalid URLs.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcfCFURLExtrascpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/cf/CFURLExtras.cpp (0 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cf/CFURLExtras.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/cf/CFURLExtras.cpp        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+/*
+ * 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 &quot;config.h&quot;
+#include &quot;CFURLExtras.h&quot;
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace WebCore {
+
+RetainPtr&lt;CFURLRef&gt; createCFURLFromBuffer(const char* data, size_t size, CFURLRef baseURL)
+{
+    // NOTE: We use UTF-8 here since this encoding is used when computing strings when returning URL components
+    // (e.g calls to NSURL -path). However, this function is not tolerant of illegal UTF-8 sequences, which
+    // could either be a malformed string or bytes in a different encoding, like Shift-JIS, so we fall back
+    // onto using ISO Latin-1 in those cases.
+    RetainPtr&lt;CFURLRef&gt; result = adoptCF(CFURLCreateAbsoluteURLWithBytes(0, reinterpret_cast&lt;const UInt8*&gt;(data), size, kCFStringEncodingUTF8, baseURL, true));
+    if (!result)
+        result = adoptCF(CFURLCreateAbsoluteURLWithBytes(0, reinterpret_cast&lt;const UInt8*&gt;(data), size, kCFStringEncodingISOLatin1, baseURL, true));
+    return result;
+}
+
+void getURLBytes(CFURLRef url, URLCharBuffer&amp; result)
+{
+    CFIndex bytesLength = CFURLGetBytes(url, 0, 0);
+    result.resize(bytesLength);
+    CFIndex finalLength = CFURLGetBytes(url, reinterpret_cast&lt;UInt8*&gt;(result.data()), bytesLength);
+    ASSERT_UNUSED(finalLength, finalLength == bytesLength);
+}
+
+void getURLBytes(CFURLRef url, CString&amp; result)
+{
+    CFIndex bytesLength = CFURLGetBytes(url, 0, 0);
+    char* bytes;
+    result = CString::newUninitialized(bytesLength, bytes);
+    CFIndex finalLength = CFURLGetBytes(url, reinterpret_cast&lt;UInt8*&gt;(bytes), bytesLength);
+    ASSERT_UNUSED(finalLength, finalLength == bytesLength);
+}
+
+}
</ins><span class="cx">Property changes on: trunk/Source/WebCore/platform/cf/CFURLExtras.cpp
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCoreplatformcfCFURLExtrash"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/cf/CFURLExtras.h (0 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cf/CFURLExtras.h                                (rev 0)
+++ trunk/Source/WebCore/platform/cf/CFURLExtras.h        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+/*
+ * 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.
+ */
+
+#ifndef CFURLExtras_h
+#define CFURLExtras_h
+
+#include &lt;wtf/Forward.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+namespace WebCore {
+
+typedef Vector&lt;char, 512&gt; URLCharBuffer;
+
+RetainPtr&lt;CFURLRef&gt; createCFURLFromBuffer(const char*, size_t, CFURLRef baseURL = 0);
+void getURLBytes(CFURLRef, URLCharBuffer&amp;);
+void getURLBytes(CFURLRef, CString&amp;);
+
+}
+
+#endif // CFURLExtras_h
</ins><span class="cx">Property changes on: trunk/Source/WebCore/platform/cf/CFURLExtras.h
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCoreplatformcfKURLCFNetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cf/KURLCFNet.cpp (150852 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cf/KURLCFNet.cpp        2013-05-28 23:26:47 UTC (rev 150852)
+++ trunk/Source/WebCore/platform/cf/KURLCFNet.cpp        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -26,17 +26,14 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;KURL.h&quot;
</span><span class="cx"> 
</span><del>-#include &lt;wtf/RetainPtr.h&gt;
</del><ins>+#include &quot;CFURLExtras.h&quot;
</ins><span class="cx"> #include &lt;CoreFoundation/CFURL.h&gt;
</span><ins>+#include &lt;wtf/text/CString.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace std;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-typedef Vector&lt;char, 512&gt; CharBuffer;
-
-RetainPtr&lt;CFURLRef&gt; createCFURLFromBuffer(const CharBuffer&amp;);
-
</del><span class="cx"> KURL::KURL(CFURLRef url)
</span><span class="cx"> {
</span><span class="cx">     if (!url) {
</span><span class="lines">@@ -44,33 +41,19 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    CFIndex bytesLength = CFURLGetBytes(url, 0, 0);
-    Vector&lt;char, 512&gt; buffer(bytesLength + 1);
-    char* bytes = &amp;buffer[0];
-    CFURLGetBytes(url, reinterpret_cast&lt;UInt8*&gt;(bytes), bytesLength);
-    bytes[bytesLength] = '\0';
-    parse(bytes);
</del><ins>+    // FIXME: Why is it OK to ignore base URL here?
+    CString urlBytes;
+    getURLBytes(url, urlBytes);
+    parse(urlBytes.data());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RetainPtr&lt;CFURLRef&gt; createCFURLFromBuffer(const CharBuffer&amp; buffer)
-{
-    // NOTE: We use UTF-8 here since this encoding is used when computing strings when returning URL components
-    // (e.g calls to NSURL -path). However, this function is not tolerant of illegal UTF-8 sequences, which
-    // could either be a malformed string or bytes in a different encoding, like Shift-JIS, so we fall back
-    // onto using ISO Latin-1 in those cases.
-    RetainPtr&lt;CFURLRef&gt; result = adoptCF(CFURLCreateAbsoluteURLWithBytes(0, reinterpret_cast&lt;const UInt8*&gt;(buffer.data()), buffer.size(), kCFStringEncodingUTF8, 0, true));
-    if (!result)
-        result = adoptCF(CFURLCreateAbsoluteURLWithBytes(0, reinterpret_cast&lt;const UInt8*&gt;(buffer.data()), buffer.size(), kCFStringEncodingISOLatin1, 0, true));
-    return result;
-}
-
</del><span class="cx"> #if !PLATFORM(MAC) &amp;&amp; !(PLATFORM(QT) &amp;&amp; USE(QTKIT))
</span><span class="cx"> RetainPtr&lt;CFURLRef&gt; KURL::createCFURL() const
</span><span class="cx"> {
</span><span class="cx">     // FIXME: What should this return for invalid URLs?
</span><span class="cx">     // Currently it throws away the high bytes of the characters in the string in that case,
</span><span class="cx">     // which is clearly wrong.
</span><del>-    CharBuffer buffer;
</del><ins>+    URLCharBuffer buffer;
</ins><span class="cx">     copyToBuffer(buffer);
</span><span class="cx">     return createCFURLFromBuffer(buffer);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacKURLMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/KURLMac.mm (150852 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/KURLMac.mm        2013-05-28 23:26:47 UTC (rev 150852)
+++ trunk/Source/WebCore/platform/mac/KURLMac.mm        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -26,16 +26,12 @@
</span><span class="cx"> #import &quot;config.h&quot;
</span><span class="cx"> #import &quot;KURL.h&quot;
</span><span class="cx"> 
</span><ins>+#import &quot;CFURLExtras.h&quot;
</ins><span class="cx"> #import &quot;FoundationExtras.h&quot;
</span><del>-#import &lt;CoreFoundation/CFURL.h&gt;
</del><ins>+#import &lt;wtf/text/CString.h&gt;
</ins><span class="cx"> 
</span><del>-using namespace WTF;
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-typedef Vector&lt;char, 512&gt; CharBuffer;
-extern RetainPtr&lt;CFURLRef&gt; createCFURLFromBuffer(const CharBuffer&amp; buffer);
-
</del><span class="cx"> KURL::KURL(NSURL *url)
</span><span class="cx"> {
</span><span class="cx">     if (!url) {
</span><span class="lines">@@ -43,34 +39,34 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    CFIndex bytesLength = CFURLGetBytes(reinterpret_cast&lt;CFURLRef&gt;(url), 0, 0);
-    Vector&lt;char, 512&gt; buffer(bytesLength + 1);
-    char* bytes = &amp;buffer[0];
-    CFURLGetBytes(reinterpret_cast&lt;CFURLRef&gt;(url), reinterpret_cast&lt;UInt8*&gt;(bytes), bytesLength);
-    bytes[bytesLength] = '\0';
-    parse(bytes);
</del><ins>+    // FIXME: Why is it OK to ignore base URL here?
+    CString urlBytes;
+    getURLBytes(reinterpret_cast&lt;CFURLRef&gt;(url), urlBytes);
+    parse(urlBytes.data());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> KURL::operator NSURL *() const
</span><span class="cx"> {
</span><ins>+    // Creating a toll-free bridged CFURL, because a real NSURL would not preserve the original string.
+    // We'll need fidelity when round-tripping via CFURLGetBytes().
</ins><span class="cx">     return HardAutorelease(createCFURL().leakRef());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// We use the toll-free bridge between NSURL and CFURL to
-// create a CFURLRef supporting both empty and null values.
</del><span class="cx"> RetainPtr&lt;CFURLRef&gt; KURL::createCFURL() const
</span><span class="cx"> {
</span><span class="cx">     if (isNull())
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     if (isEmpty()) {
</span><ins>+        // We use the toll-free bridge between NSURL and CFURL to
+        // create a CFURLRef supporting both empty and null values.
</ins><span class="cx">         RetainPtr&lt;NSURL&gt; emptyNSURL = adoptNS([[NSURL alloc] initWithString:@&quot;&quot;]);
</span><span class="cx">         return reinterpret_cast&lt;CFURLRef&gt;(emptyNSURL.get());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    CharBuffer buffer;
</del><ins>+    URLCharBuffer buffer;
</ins><span class="cx">     copyToBuffer(buffer);
</span><del>-    return createCFURLFromBuffer(buffer);
</del><ins>+    return createCFURLFromBuffer(buffer.data(), buffer.size());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfResourceErrorCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/ResourceErrorCF.cpp (150852 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/ResourceErrorCF.cpp        2013-05-28 23:26:47 UTC (rev 150852)
+++ trunk/Source/WebCore/platform/network/cf/ResourceErrorCF.cpp        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -107,6 +107,8 @@
</span><span class="cx">             if (failingURL) {
</span><span class="cx">                 RetainPtr&lt;CFURLRef&gt; absoluteURLRef = adoptCF(CFURLCopyAbsoluteURL(failingURL));
</span><span class="cx">                 if (absoluteURLRef.get()) {
</span><ins>+                    // FIXME: CFURLGetString returns a normalized URL which is different from what is actually used by CFNetwork.
+                    // We should use CFURLGetBytes instead.
</ins><span class="cx">                     failingURLString = CFURLGetString(absoluteURLRef.get());
</span><span class="cx">                     m_failingURL = String(failingURLString);
</span><span class="cx">                 }
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (150852 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2013-05-28 23:26:47 UTC (rev 150852)
+++ trunk/Source/WebKit2/ChangeLog        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2013-05-28  Alexey Proskuryakov  &lt;ap@apple.com&gt;
+
+        Freeze when loading a particular page on washingtonpost.com with NetworkProcess enabled
+        https://bugs.webkit.org/show_bug.cgi?id=116887
+        &lt;rdar://problem/12965959&gt;
+
+        Reviewed by Darin Adler.
+
+        * Shared/cf/ArgumentCodersCF.cpp:
+        (CoreIPC::encode):
+        (CoreIPC::decode):
+        Fix for the bug: use good shared WebCore code to manipulate CFURLs. Also, added
+        a FIXME about empty URLs.
+
+        * Shared/API/c/cf/WKURLCF.cpp: (WKURLCreateWithCFURL): Fixed to not use
+        CFURLGetString, as that could prevent loading certain resources, like ones with
+        curly braces in resource specifiers. We want KURL normalization, not CFURL one.
+
</ins><span class="cx"> 2013-05-28  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rendering suppression extension tokens shouldn't be 0, should handle overflow
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAPIccfWKURLCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/API/c/cf/WKURLCF.cpp (150852 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/API/c/cf/WKURLCF.cpp        2013-05-28 23:26:47 UTC (rev 150852)
+++ trunk/Source/WebKit2/Shared/API/c/cf/WKURLCF.cpp        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -27,9 +27,9 @@
</span><span class="cx"> #include &quot;WKURLCF.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WKAPICast.h&quot;
</span><ins>+#include &lt;WebCore/CFURLExtras.h&gt;
</ins><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><del>-#include &lt;wtf/RetainPtr.h&gt;
</del><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -41,8 +41,10 @@
</span><span class="cx">     if (!cfURL)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    String urlString(CFURLGetString(cfURL));
-    return toCopiedURLAPI(urlString);
</del><ins>+    CString urlBytes;
+    getURLBytes(cfURL, urlBytes);
+
+    return toCopiedURLAPI(urlBytes.data());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CFURLRef WKURLCopyCFURL(CFAllocatorRef allocatorRef, WKURLRef URLRef)
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedcfArgumentCodersCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp (150852 => 150853)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp        2013-05-28 23:26:47 UTC (rev 150852)
+++ trunk/Source/WebKit2/Shared/cf/ArgumentCodersCF.cpp        2013-05-28 23:26:48 UTC (rev 150853)
</span><span class="lines">@@ -29,12 +29,15 @@
</span><span class="cx"> #include &quot;ArgumentDecoder.h&quot;
</span><span class="cx"> #include &quot;ArgumentEncoder.h&quot;
</span><span class="cx"> #include &quot;DataReference.h&quot;
</span><ins>+#include &lt;WebCore/CFURLExtras.h&gt;
</ins><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> #import &lt;Foundation/Foundation.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+using namespace WebCore;
+
</ins><span class="cx"> namespace CoreIPC {
</span><span class="cx"> 
</span><span class="cx"> CFTypeRef tokenNullTypeRef()
</span><span class="lines">@@ -500,7 +503,10 @@
</span><span class="cx">     if (baseURL)
</span><span class="cx">         encode(encoder, baseURL);
</span><span class="cx"> 
</span><del>-    encode(encoder, CFURLGetString(url));
</del><ins>+    URLCharBuffer urlBytes;
+    getURLBytes(url, urlBytes);
+    CoreIPC::DataReference dataReference(reinterpret_cast&lt;const uint8_t*&gt;(urlBytes.data()), urlBytes.size());
+    encoder &lt;&lt; dataReference;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool decode(ArgumentDecoder&amp; decoder, RetainPtr&lt;CFURLRef&gt;&amp; result)
</span><span class="lines">@@ -514,26 +520,23 @@
</span><span class="cx">             return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RetainPtr&lt;CFStringRef&gt; string;
-    if (!decode(decoder, string))
</del><ins>+    CoreIPC::DataReference urlBytes;
+    if (!decoder.decode(urlBytes))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     // FIXME: Move this to ArgumentCodersCFMac.mm and change this file back to be C++
</span><span class="cx">     // instead of Objective-C++.
</span><del>-    if (!CFStringGetLength(string.get())) {
</del><ins>+    if (urlBytes.isEmpty()) {
</ins><span class="cx">         // CFURL can't hold an empty URL, unlike NSURL.
</span><ins>+        // FIXME: This discards base URL, which seems incorrect.
</ins><span class="cx">         result = reinterpret_cast&lt;CFURLRef&gt;([NSURL URLWithString:@&quot;&quot;]);
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><del>-                    
-    CFURLRef url = CFURLCreateWithString(0, string.get(), baseURL.get());
-    if (!url)
-        return false;
</del><span class="cx"> 
</span><del>-    result = adoptCF(url);
-    return true;
</del><ins>+    result = createCFURLFromBuffer(reinterpret_cast&lt;const char*&gt;(urlBytes.data()), urlBytes.size(), baseURL.get());
+    return result;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if USE(SECURITY_FRAMEWORK)
</span></span></pre>
</div>
</div>

</body>
</html>