<!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>[183408] 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/183408">183408</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-04-27 12:36:25 -0700 (Mon, 27 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/183393">r183393</a>.
https://bugs.webkit.org/show_bug.cgi?id=144272

Caused memory corruption detected by GuardMalloc (Requested by
ap on #webkit).

Reverted changeset:

&quot;Synchronous XMLHttpRequest should get access to AppCache
resources stored as flat files&quot;
https://bugs.webkit.org/show_bug.cgi?id=143711
http://trac.webkit.org/changeset/183393</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="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentThreadableLoadercpp">trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoadercpp">trunk/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoaderh">trunk/Source/WebCore/loader/FrameLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloaderappcacheApplicationCacheHostcpp">trunk/Source/WebCore/loader/appcache/ApplicationCacheHost.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderappcacheApplicationCacheHosth">trunk/Source/WebCore/loader/appcache/ApplicationCacheHost.h</a></li>
<li><a href="#trunkSourceWebCorexmlXSLTProcessorLibxsltcpp">trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlparserXMLDocumentParserLibxml2cpp">trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestsappcacheresourcesfakevideomp4">trunk/LayoutTests/http/tests/appcache/resources/fake-video.mp4</a></li>
<li><a href="#trunkLayoutTestshttptestsappcacheresourcessimplevideosyncmanifest">trunk/LayoutTests/http/tests/appcache/resources/simple-video-sync.manifest</a></li>
<li><a href="#trunkLayoutTestshttptestsappcachesimplevideosyncexpectedtxt">trunk/LayoutTests/http/tests/appcache/simple-video-sync-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsappcachesimplevideosynchtml">trunk/LayoutTests/http/tests/appcache/simple-video-sync.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (183407 => 183408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-04-27 18:57:13 UTC (rev 183407)
+++ trunk/LayoutTests/ChangeLog        2015-04-27 19:36:25 UTC (rev 183408)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-04-27  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r183393.
+        https://bugs.webkit.org/show_bug.cgi?id=144272
+
+        Caused memory corruption detected by GuardMalloc (Requested by
+        ap on #webkit).
+
+        Reverted changeset:
+
+        &quot;Synchronous XMLHttpRequest should get access to AppCache
+        resources stored as flat files&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=143711
+        http://trac.webkit.org/changeset/183393
+
</ins><span class="cx"> 2015-04-27  Yoav Weiss  &lt;yoav@yoav.ws&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix viewport units in Media Queries
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsappcacheresourcesfakevideomp4"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/appcache/resources/fake-video.mp4 (183407 => 183408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/appcache/resources/fake-video.mp4        2015-04-27 18:57:13 UTC (rev 183407)
+++ trunk/LayoutTests/http/tests/appcache/resources/fake-video.mp4        2015-04-27 19:36:25 UTC (rev 183408)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-This is a fake video
</del></span></pre></div>
<a id="trunkLayoutTestshttptestsappcacheresourcessimplevideosyncmanifest"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/appcache/resources/simple-video-sync.manifest (183407 => 183408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/appcache/resources/simple-video-sync.manifest        2015-04-27 18:57:13 UTC (rev 183407)
+++ trunk/LayoutTests/http/tests/appcache/resources/simple-video-sync.manifest        2015-04-27 19:36:25 UTC (rev 183408)
</span><span class="lines">@@ -1,2 +0,0 @@
</span><del>-CACHE MANIFEST
-fake-video.mp4
</del></span></pre></div>
<a id="trunkLayoutTestshttptestsappcachesimplevideosyncexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/appcache/simple-video-sync-expected.txt (183407 => 183408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/appcache/simple-video-sync-expected.txt        2015-04-27 18:57:13 UTC (rev 183407)
+++ trunk/LayoutTests/http/tests/appcache/simple-video-sync-expected.txt        2015-04-27 19:36:25 UTC (rev 183408)
</span><span class="lines">@@ -1,2 +0,0 @@
</span><del>-This tests that the application cache works for video retrieved by sync XMLHttpRequest
-SUCCESS
</del></span></pre></div>
<a id="trunkLayoutTestshttptestsappcachesimplevideosynchtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/appcache/simple-video-sync.html (183407 => 183408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/appcache/simple-video-sync.html        2015-04-27 18:57:13 UTC (rev 183407)
+++ trunk/LayoutTests/http/tests/appcache/simple-video-sync.html        2015-04-27 19:36:25 UTC (rev 183408)
</span><span class="lines">@@ -1,36 +0,0 @@
</span><del>-&lt;html manifest=&quot;resources/simple-video-sync.manifest&quot;&gt;
-&lt;script&gt;
-if (window.testRunner) {
-    testRunner.dumpAsText()
-    testRunner.waitUntilDone();
-}
-
-function finishTest(message) {
-    document.getElementById('result').innerHTML = message;
-    testRunner.notifyDone();
-}
-
-function cached()
-{
-    try {
-        var req = new XMLHttpRequest();
-        req.open(&quot;GET&quot;, &quot;resources/fake-video.mp4&quot;, false);
-        req.send();
-        if (req.getResponseHeader(&quot;Content-Type&quot;) != &quot;video/mp4&quot;)
-            finishTest(&quot;FAILURE: Did not get correct content type from cached resource&quot;);
-        if (req.responseText.trim() != &quot;This is a fake video&quot;)
-            finishTest(&quot;FAILURE: Did not get correct data from cached resource&quot;);
-        finishTest(&quot;SUCCESS&quot;);
-    } catch (e) {
-        finishTest(&quot;FAILURE: Could not load video data from cache&quot;);
-    }
-}
-
-applicationCache.addEventListener('cached', cached, false);
-applicationCache.addEventListener('noupdate', cached, false);
-
-&lt;/script&gt;
-&lt;div&gt;This tests that the application cache works for video retrieved by sync XMLHttpRequest&lt;/div&gt;
-
-&lt;div id=&quot;result&quot;&gt;FAILURE&lt;/div&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (183407 => 183408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-27 18:57:13 UTC (rev 183407)
+++ trunk/Source/WebCore/ChangeLog        2015-04-27 19:36:25 UTC (rev 183408)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-04-27  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r183393.
+        https://bugs.webkit.org/show_bug.cgi?id=144272
+
+        Caused memory corruption detected by GuardMalloc (Requested by
+        ap on #webkit).
+
+        Reverted changeset:
+
+        &quot;Synchronous XMLHttpRequest should get access to AppCache
+        resources stored as flat files&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=143711
+        http://trac.webkit.org/changeset/183393
+
</ins><span class="cx"> 2015-04-27  Per Arne Vollan  &lt;peavo@outlook.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Curl] Favicons loaded from disc cache are ignored.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (183407 => 183408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2015-04-27 18:57:13 UTC (rev 183407)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2015-04-27 19:36:25 UTC (rev 183408)
</span><span class="lines">@@ -1063,6 +1063,25 @@
</span><span class="cx">     loadResource(mediaURL, contentType, keySystem);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static URL createFileURLForApplicationCacheResource(const String&amp; path)
+{
+    // URL should have a function to create a url from a path, but it does not. This function
+    // is not suitable because URL::setPath uses encodeWithURLEscapeSequences, which it notes
+    // does not correctly escape '#' and '?'. This function works for our purposes because
+    // app cache media files are always created with encodeForFileName(createCanonicalUUIDString()).
+
+#if USE(CF) &amp;&amp; PLATFORM(WIN)
+    RetainPtr&lt;CFURLRef&gt; cfURL = adoptCF(CFURLCreateWithFileSystemPath(0, path.createCFString().get(), kCFURLWindowsPathStyle, false));
+    URL url(cfURL.get());
+#else
+    URL url;
+
+    url.setProtocol(ASCIILiteral(&quot;file&quot;));
+    url.setPath(path);
+#endif
+    return url;
+}
+
</ins><span class="cx"> void HTMLMediaElement::loadResource(const URL&amp; initialURL, ContentType&amp; contentType, const String&amp; keySystem)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isSafeToLoadURL(initialURL, Complain));
</span><span class="lines">@@ -1127,7 +1146,7 @@
</span><span class="cx">     m_currentSrc = url;
</span><span class="cx"> 
</span><span class="cx">     if (resource) {
</span><del>-        url = ApplicationCacheHost::createFileURL(resource-&gt;path());
</del><ins>+        url = createFileURLForApplicationCacheResource(resource-&gt;path());
</ins><span class="cx">         LOG(Media, &quot;HTMLMediaElement::loadResource(%p) - will load from app cache -&gt; %s&quot;, this, urlForLoggingMedia(url).utf8().data());
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentThreadableLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp (183407 => 183408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp        2015-04-27 18:57:13 UTC (rev 183407)
+++ trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp        2015-04-27 19:36:25 UTC (rev 183408)
</span><span class="lines">@@ -375,7 +375,7 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     // FIXME: ThreadableLoaderOptions.sniffContent is not supported for synchronous requests.
</span><del>-    RefPtr&lt;SharedBuffer&gt; data;
</del><ins>+    Vector&lt;char&gt; data;
</ins><span class="cx">     ResourceError error;
</span><span class="cx">     ResourceResponse response;
</span><span class="cx">     unsigned long identifier = std::numeric_limits&lt;unsigned long&gt;::max();
</span><span class="lines">@@ -404,8 +404,10 @@
</span><span class="cx"> 
</span><span class="cx">     didReceiveResponse(identifier, response);
</span><span class="cx"> 
</span><del>-    if (data)
-        didReceiveData(identifier, data-&gt;data(), data-&gt;size());
</del><ins>+    const char* bytes = static_cast&lt;const char*&gt;(data.data());
+    int len = static_cast&lt;int&gt;(data.size());
+    didReceiveData(identifier, bytes, len);
+
</ins><span class="cx">     didFinishLoading(identifier, 0.0);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (183407 => 183408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.cpp        2015-04-27 18:57:13 UTC (rev 183407)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp        2015-04-27 19:36:25 UTC (rev 183408)
</span><span class="lines">@@ -2660,7 +2660,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned long FrameLoader::loadResourceSynchronously(const ResourceRequest&amp; request, StoredCredentials storedCredentials, ClientCredentialPolicy clientCredentialPolicy, ResourceError&amp; error, ResourceResponse&amp; response, RefPtr&lt;SharedBuffer&gt;&amp; data)
</del><ins>+unsigned long FrameLoader::loadResourceSynchronously(const ResourceRequest&amp; request, StoredCredentials storedCredentials, ClientCredentialPolicy clientCredentialPolicy, ResourceError&amp; error, ResourceResponse&amp; response, Vector&lt;char&gt;&amp; data)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_frame.document());
</span><span class="cx">     String referrer = SecurityPolicy::generateReferrerHeader(m_frame.document()-&gt;referrerPolicy(), request.url(), outgoingReferrer());
</span><span class="lines">@@ -2682,15 +2682,13 @@
</span><span class="cx"> 
</span><span class="cx">     if (error.isNull()) {
</span><span class="cx">         ASSERT(!newRequest.isNull());
</span><del>-
</del><ins>+        
</ins><span class="cx">         if (!documentLoader()-&gt;applicationCacheHost()-&gt;maybeLoadSynchronously(newRequest, error, response, data)) {
</span><del>-            Vector&lt;char&gt; buffer;
-            platformStrategies()-&gt;loaderStrategy()-&gt;loadResourceSynchronously(networkingContext(), identifier, newRequest, storedCredentials, clientCredentialPolicy, error, response, buffer);
-            data = SharedBuffer::adoptVector(buffer);
</del><ins>+            platformStrategies()-&gt;loaderStrategy()-&gt;loadResourceSynchronously(networkingContext(), identifier, newRequest, storedCredentials, clientCredentialPolicy, error, response, data);
</ins><span class="cx">             documentLoader()-&gt;applicationCacheHost()-&gt;maybeLoadFallbackSynchronously(newRequest, error, response, data);
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    notifier().sendRemainingDelegateMessages(m_documentLoader.get(), identifier, request, response, data ? data-&gt;data() : nullptr, data ? data-&gt;size() : 0, -1, error);
</del><ins>+    notifier().sendRemainingDelegateMessages(m_documentLoader.get(), identifier, request, response, data.data(), data.size(), -1, error);
</ins><span class="cx">     return identifier;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.h (183407 => 183408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.h        2015-04-27 18:57:13 UTC (rev 183407)
+++ trunk/Source/WebCore/loader/FrameLoader.h        2015-04-27 19:36:25 UTC (rev 183408)
</span><span class="lines">@@ -43,7 +43,6 @@
</span><span class="cx"> #include &quot;ResourceLoadNotifier.h&quot;
</span><span class="cx"> #include &quot;ResourceRequestBase.h&quot;
</span><span class="cx"> #include &quot;SecurityContext.h&quot;
</span><del>-#include &quot;SharedBuffer.h&quot;
</del><span class="cx"> #include &quot;Timer.h&quot;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="lines">@@ -117,7 +116,7 @@
</span><span class="cx"> #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
</span><span class="cx">     WEBCORE_EXPORT void loadArchive(PassRefPtr&lt;Archive&gt;);
</span><span class="cx"> #endif
</span><del>-    unsigned long loadResourceSynchronously(const ResourceRequest&amp;, StoredCredentials, ClientCredentialPolicy, ResourceError&amp;, ResourceResponse&amp;, RefPtr&lt;SharedBuffer&gt;&amp; data);
</del><ins>+    unsigned long loadResourceSynchronously(const ResourceRequest&amp;, StoredCredentials, ClientCredentialPolicy, ResourceError&amp;, ResourceResponse&amp;, Vector&lt;char&gt;&amp; data);
</ins><span class="cx"> 
</span><span class="cx">     void changeLocation(SecurityOrigin*, const URL&amp;, const String&amp; referrer, LockHistory = LockHistory::Yes,
</span><span class="cx">         LockBackForwardList = LockBackForwardList::Yes, bool refresh = false, AllowNavigationToInvalidURL = AllowNavigationToInvalidURL::Yes);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderappcacheApplicationCacheHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/appcache/ApplicationCacheHost.cpp (183407 => 183408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/appcache/ApplicationCacheHost.cpp        2015-04-27 18:57:13 UTC (rev 183407)
+++ trunk/Source/WebCore/loader/appcache/ApplicationCacheHost.cpp        2015-04-27 19:36:25 UTC (rev 183408)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #include &quot;ApplicationCacheResource.h&quot;
</span><span class="cx"> #include &quot;DocumentLoader.h&quot;
</span><span class="cx"> #include &quot;DOMApplicationCache.h&quot;
</span><del>-#include &quot;FileSystem.h&quot;
</del><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;FrameLoader.h&quot;
</span><span class="cx"> #include &quot;FrameLoaderClient.h&quot;
</span><span class="lines">@@ -169,10 +168,10 @@
</span><span class="cx">     ApplicationCacheResource* resource;
</span><span class="cx">     if (!shouldLoadResourceFromApplicationCache(request, resource))
</span><span class="cx">         return false;
</span><del>-
</del><ins>+    
</ins><span class="cx">     m_documentLoader.m_pendingSubstituteResources.set(loader, resource);
</span><span class="cx">     m_documentLoader.deliverSubstituteResourcesAfterDelay();
</span><del>-
</del><ins>+        
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -203,48 +202,22 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-URL ApplicationCacheHost::createFileURL(const String&amp; path)
</del><ins>+bool ApplicationCacheHost::maybeLoadSynchronously(ResourceRequest&amp; request, ResourceError&amp; error, ResourceResponse&amp; response, Vector&lt;char&gt;&amp; data)
</ins><span class="cx"> {
</span><del>-    // FIXME: Can we just use fileURLWithFileSystemPath instead?
-
-    // fileURLWithFileSystemPath function is not suitable because URL::setPath uses encodeWithURLEscapeSequences, which it notes
-    // does not correctly escape '#' and '?'. This function works for our purposes because
-    // app cache media files are always created with encodeForFileName(createCanonicalUUIDString()).
-
-#if USE(CF) &amp;&amp; PLATFORM(WIN)
-    RetainPtr&lt;CFURLRef&gt; cfURL = adoptCF(CFURLCreateWithFileSystemPath(0, path.createCFString().get(), kCFURLWindowsPathStyle, false));
-    URL url(cfURL.get());
-#else
-    URL url;
-
-    url.setProtocol(ASCIILiteral(&quot;file&quot;));
-    url.setPath(path);
-#endif
-    return url;
-}
-
-bool ApplicationCacheHost::maybeLoadSynchronously(ResourceRequest&amp; request, ResourceError&amp; error, ResourceResponse&amp; response, RefPtr&lt;SharedBuffer&gt;&amp; data)
-{
</del><span class="cx">     ApplicationCacheResource* resource;
</span><span class="cx">     if (shouldLoadResourceFromApplicationCache(request, resource)) {
</span><span class="cx">         if (resource) {
</span><del>-            // FIXME: Clients proably do not need a copy of the SharedBuffer.
-            // Remove the call to copy() once we ensure SharedBuffer will not be modified.
-            if (resource-&gt;path().isEmpty())
-                data = resource-&gt;data()-&gt;copy();
-            else
-                data = SharedBuffer::createWithContentsOfFile(resource-&gt;path());
-        }
-        if (!data)
-            error = m_documentLoader.frameLoader()-&gt;client().cannotShowURLError(request);
-        else
</del><span class="cx">             response = resource-&gt;response();
</span><ins>+            data.append(resource-&gt;data()-&gt;data(), resource-&gt;data()-&gt;size());
+        } else {
+            error = m_documentLoader.frameLoader()-&gt;client().cannotShowURLError(request);
+        }
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ApplicationCacheHost::maybeLoadFallbackSynchronously(const ResourceRequest&amp; request, ResourceError&amp; error, ResourceResponse&amp; response, RefPtr&lt;SharedBuffer&gt;&amp; data)
</del><ins>+void ApplicationCacheHost::maybeLoadFallbackSynchronously(const ResourceRequest&amp; request, ResourceError&amp; error, ResourceResponse&amp; response, Vector&lt;char&gt;&amp; data)
</ins><span class="cx"> {
</span><span class="cx">     // If normal loading results in a redirect to a resource with another origin (indicative of a captive portal), or a 4xx or 5xx status code or equivalent,
</span><span class="cx">     // or if there were network errors (but not if the user canceled the download), then instead get, from the cache, the resource of the fallback entry
</span><span class="lines">@@ -255,9 +228,8 @@
</span><span class="cx">         ApplicationCacheResource* resource;
</span><span class="cx">         if (getApplicationCacheFallbackResource(request, resource)) {
</span><span class="cx">             response = resource-&gt;response();
</span><del>-            // FIXME: Clients proably do not need a copy of the SharedBuffer.
-            // Remove the call to copy() once we ensure SharedBuffer will not be modified.
-            data = resource-&gt;data()-&gt;copy();
</del><ins>+            data.clear();
+            data.append(resource-&gt;data()-&gt;data(), resource-&gt;data()-&gt;size());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderappcacheApplicationCacheHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/appcache/ApplicationCacheHost.h (183407 => 183408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/appcache/ApplicationCacheHost.h        2015-04-27 18:57:13 UTC (rev 183407)
+++ trunk/Source/WebCore/loader/appcache/ApplicationCacheHost.h        2015-04-27 19:36:25 UTC (rev 183408)
</span><span class="lines">@@ -41,11 +41,10 @@
</span><span class="cx">     class DOMApplicationCache;
</span><span class="cx">     class DocumentLoader;
</span><span class="cx">     class Frame;
</span><del>-    class ResourceError;
</del><span class="cx">     class ResourceLoader;
</span><ins>+    class ResourceError;
</ins><span class="cx">     class ResourceRequest;
</span><span class="cx">     class ResourceResponse;
</span><del>-    class SharedBuffer;
</del><span class="cx">     class SubstituteData;
</span><span class="cx">     class ApplicationCache;
</span><span class="cx">     class ApplicationCacheGroup;
</span><span class="lines">@@ -111,8 +110,6 @@
</span><span class="cx">         explicit ApplicationCacheHost(DocumentLoader&amp;);
</span><span class="cx">         ~ApplicationCacheHost();
</span><span class="cx"> 
</span><del>-        static URL createFileURL(const String&amp;);
-
</del><span class="cx">         void selectCacheWithoutManifest();
</span><span class="cx">         void selectCacheWithManifest(const URL&amp; manifestURL);
</span><span class="cx"> 
</span><span class="lines">@@ -128,8 +125,8 @@
</span><span class="cx">         WEBCORE_EXPORT bool maybeLoadFallbackForResponse(ResourceLoader*, const ResourceResponse&amp;);
</span><span class="cx">         WEBCORE_EXPORT bool maybeLoadFallbackForError(ResourceLoader*, const ResourceError&amp;);
</span><span class="cx"> 
</span><del>-        bool maybeLoadSynchronously(ResourceRequest&amp;, ResourceError&amp;, ResourceResponse&amp;, RefPtr&lt;SharedBuffer&gt;&amp;);
-        void maybeLoadFallbackSynchronously(const ResourceRequest&amp;, ResourceError&amp;, ResourceResponse&amp;, RefPtr&lt;SharedBuffer&gt;&amp;);
</del><ins>+        bool maybeLoadSynchronously(ResourceRequest&amp;, ResourceError&amp;, ResourceResponse&amp;, Vector&lt;char&gt;&amp; data);
+        void maybeLoadFallbackSynchronously(const ResourceRequest&amp;, ResourceError&amp;, ResourceResponse&amp;, Vector&lt;char&gt;&amp; data);
</ins><span class="cx"> 
</span><span class="cx">         bool canCacheInPageCache();
</span><span class="cx"> 
</span><span class="lines">@@ -180,6 +177,7 @@
</span><span class="cx">         ApplicationCache* mainResourceApplicationCache() const { return m_mainResourceApplicationCache.get(); }
</span><span class="cx">         bool maybeLoadFallbackForMainError(const ResourceRequest&amp;, const ResourceError&amp;);
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx">         // The application cache that the document loader is associated with (if any).
</span><span class="cx">         RefPtr&lt;ApplicationCache&gt; m_applicationCache;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXSLTProcessorLibxsltcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp (183407 => 183408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp        2015-04-27 18:57:13 UTC (rev 183407)
+++ trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp        2015-04-27 19:36:25 UTC (rev 183408)
</span><span class="lines">@@ -124,19 +124,18 @@
</span><span class="cx">         ResourceError error;
</span><span class="cx">         ResourceResponse response;
</span><span class="cx"> 
</span><del>-        RefPtr&lt;SharedBuffer&gt; data;
</del><ins>+        Vector&lt;char&gt; data;
</ins><span class="cx"> 
</span><span class="cx">         bool requestAllowed = globalCachedResourceLoader-&gt;frame() &amp;&amp; globalCachedResourceLoader-&gt;document()-&gt;securityOrigin()-&gt;canRequest(url);
</span><span class="cx">         if (requestAllowed) {
</span><span class="cx">             globalCachedResourceLoader-&gt;frame()-&gt;loader().loadResourceSynchronously(url, AllowStoredCredentials, DoNotAskClientForCrossOriginCredentials, error, response, data);
</span><span class="cx">             if (error.isNull())
</span><span class="cx">                 requestAllowed = globalCachedResourceLoader-&gt;document()-&gt;securityOrigin()-&gt;canRequest(response.url());
</span><del>-            else if (data)
-                data = nullptr;
</del><ins>+            else
+                data.clear();
</ins><span class="cx">         }
</span><span class="cx">         if (!requestAllowed) {
</span><del>-            if (data)
-                data = nullptr;
</del><ins>+            data.clear();
</ins><span class="cx">             globalCachedResourceLoader-&gt;printAccessDeniedMessage(url);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -149,7 +148,7 @@
</span><span class="cx"> 
</span><span class="cx">         // We don't specify an encoding here. Neither Gecko nor WinIE respects
</span><span class="cx">         // the encoding specified in the HTTP headers.
</span><del>-        xmlDocPtr doc = xmlReadMemory(data ? data-&gt;data() : nullptr, data ? data-&gt;size() : 0, (const char*)uri, 0, options);
</del><ins>+        xmlDocPtr doc = xmlReadMemory(data.data(), data.size(), (const char*)uri, 0, options);
</ins><span class="cx"> 
</span><span class="cx">         xmlSetStructuredErrorFunc(0, 0);
</span><span class="cx">         xmlSetGenericErrorFunc(0, 0);
</span></span></pre></div>
<a id="trunkSourceWebCorexmlparserXMLDocumentParserLibxml2cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp (183407 => 183408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp        2015-04-27 18:57:13 UTC (rev 183407)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp        2015-04-27 19:36:25 UTC (rev 183408)
</span><span class="lines">@@ -454,7 +454,7 @@
</span><span class="cx"> 
</span><span class="cx">     ResourceError error;
</span><span class="cx">     ResourceResponse response;
</span><del>-    RefPtr&lt;SharedBuffer&gt; data;
</del><ins>+    Vector&lt;char&gt; data;
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     {
</span><span class="lines">@@ -470,10 +470,8 @@
</span><span class="cx">     // See &lt;https://bugs.webkit.org/show_bug.cgi?id=21963&gt;.
</span><span class="cx">     if (!shouldAllowExternalLoad(response.url()))
</span><span class="cx">         return &amp;globalDescriptor;
</span><del>-    Vector&lt;char&gt; buffer;
-    if (data)
-        buffer.append(data-&gt;data(), data-&gt;size());
-    return new OffsetBuffer(WTF::move(buffer));
</del><ins>+
+    return new OffsetBuffer(WTF::move(data));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static int readFunc(void* context, char* buffer, int len)
</span></span></pre>
</div>
</div>

</body>
</html>