<!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:
"Synchronous XMLHttpRequest should get access to AppCache
resources stored as flat files"
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 <commit-queue@webkit.org>
+
+ 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:
+
+ "Synchronous XMLHttpRequest should get access to AppCache
+ resources stored as flat files"
+ https://bugs.webkit.org/show_bug.cgi?id=143711
+ http://trac.webkit.org/changeset/183393
+
</ins><span class="cx"> 2015-04-27 Yoav Weiss <yoav@yoav.ws>
</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>-<html manifest="resources/simple-video-sync.manifest">
-<script>
-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("GET", "resources/fake-video.mp4", false);
- req.send();
- if (req.getResponseHeader("Content-Type") != "video/mp4")
- finishTest("FAILURE: Did not get correct content type from cached resource");
- if (req.responseText.trim() != "This is a fake video")
- finishTest("FAILURE: Did not get correct data from cached resource");
- finishTest("SUCCESS");
- } catch (e) {
- finishTest("FAILURE: Could not load video data from cache");
- }
-}
-
-applicationCache.addEventListener('cached', cached, false);
-applicationCache.addEventListener('noupdate', cached, false);
-
-</script>
-<div>This tests that the application cache works for video retrieved by sync XMLHttpRequest</div>
-
-<div id="result">FAILURE</div>
-</html>
</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 <commit-queue@webkit.org>
+
+ 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:
+
+ "Synchronous XMLHttpRequest should get access to AppCache
+ resources stored as flat files"
+ 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 <peavo@outlook.com>
</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& 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) && PLATFORM(WIN)
+ RetainPtr<CFURLRef> cfURL = adoptCF(CFURLCreateWithFileSystemPath(0, path.createCFString().get(), kCFURLWindowsPathStyle, false));
+ URL url(cfURL.get());
+#else
+ URL url;
+
+ url.setProtocol(ASCIILiteral("file"));
+ url.setPath(path);
+#endif
+ return url;
+}
+
</ins><span class="cx"> void HTMLMediaElement::loadResource(const URL& initialURL, ContentType& contentType, const String& 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->path());
</del><ins>+ url = createFileURLForApplicationCacheResource(resource->path());
</ins><span class="cx"> LOG(Media, "HTMLMediaElement::loadResource(%p) - will load from app cache -> %s", 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<SharedBuffer> data;
</del><ins>+ Vector<char> data;
</ins><span class="cx"> ResourceError error;
</span><span class="cx"> ResourceResponse response;
</span><span class="cx"> unsigned long identifier = std::numeric_limits<unsigned long>::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->data(), data->size());
</del><ins>+ const char* bytes = static_cast<const char*>(data.data());
+ int len = static_cast<int>(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& request, StoredCredentials storedCredentials, ClientCredentialPolicy clientCredentialPolicy, ResourceError& error, ResourceResponse& response, RefPtr<SharedBuffer>& data)
</del><ins>+unsigned long FrameLoader::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials storedCredentials, ClientCredentialPolicy clientCredentialPolicy, ResourceError& error, ResourceResponse& response, Vector<char>& data)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_frame.document());
</span><span class="cx"> String referrer = SecurityPolicy::generateReferrerHeader(m_frame.document()->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()->applicationCacheHost()->maybeLoadSynchronously(newRequest, error, response, data)) {
</span><del>- Vector<char> buffer;
- platformStrategies()->loaderStrategy()->loadResourceSynchronously(networkingContext(), identifier, newRequest, storedCredentials, clientCredentialPolicy, error, response, buffer);
- data = SharedBuffer::adoptVector(buffer);
</del><ins>+ platformStrategies()->loaderStrategy()->loadResourceSynchronously(networkingContext(), identifier, newRequest, storedCredentials, clientCredentialPolicy, error, response, data);
</ins><span class="cx"> documentLoader()->applicationCacheHost()->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->data() : nullptr, data ? data->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 "ResourceLoadNotifier.h"
</span><span class="cx"> #include "ResourceRequestBase.h"
</span><span class="cx"> #include "SecurityContext.h"
</span><del>-#include "SharedBuffer.h"
</del><span class="cx"> #include "Timer.h"
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/HashSet.h>
</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<Archive>);
</span><span class="cx"> #endif
</span><del>- unsigned long loadResourceSynchronously(const ResourceRequest&, StoredCredentials, ClientCredentialPolicy, ResourceError&, ResourceResponse&, RefPtr<SharedBuffer>& data);
</del><ins>+ unsigned long loadResourceSynchronously(const ResourceRequest&, StoredCredentials, ClientCredentialPolicy, ResourceError&, ResourceResponse&, Vector<char>& data);
</ins><span class="cx">
</span><span class="cx"> void changeLocation(SecurityOrigin*, const URL&, const String& 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 "ApplicationCacheResource.h"
</span><span class="cx"> #include "DocumentLoader.h"
</span><span class="cx"> #include "DOMApplicationCache.h"
</span><del>-#include "FileSystem.h"
</del><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "FrameLoader.h"
</span><span class="cx"> #include "FrameLoaderClient.h"
</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& path)
</del><ins>+bool ApplicationCacheHost::maybeLoadSynchronously(ResourceRequest& request, ResourceError& error, ResourceResponse& response, Vector<char>& 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) && PLATFORM(WIN)
- RetainPtr<CFURLRef> cfURL = adoptCF(CFURLCreateWithFileSystemPath(0, path.createCFString().get(), kCFURLWindowsPathStyle, false));
- URL url(cfURL.get());
-#else
- URL url;
-
- url.setProtocol(ASCIILiteral("file"));
- url.setPath(path);
-#endif
- return url;
-}
-
-bool ApplicationCacheHost::maybeLoadSynchronously(ResourceRequest& request, ResourceError& error, ResourceResponse& response, RefPtr<SharedBuffer>& 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->path().isEmpty())
- data = resource->data()->copy();
- else
- data = SharedBuffer::createWithContentsOfFile(resource->path());
- }
- if (!data)
- error = m_documentLoader.frameLoader()->client().cannotShowURLError(request);
- else
</del><span class="cx"> response = resource->response();
</span><ins>+ data.append(resource->data()->data(), resource->data()->size());
+ } else {
+ error = m_documentLoader.frameLoader()->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& request, ResourceError& error, ResourceResponse& response, RefPtr<SharedBuffer>& data)
</del><ins>+void ApplicationCacheHost::maybeLoadFallbackSynchronously(const ResourceRequest& request, ResourceError& error, ResourceResponse& response, Vector<char>& 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->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->data()->copy();
</del><ins>+ data.clear();
+ data.append(resource->data()->data(), resource->data()->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&);
</span><span class="cx"> ~ApplicationCacheHost();
</span><span class="cx">
</span><del>- static URL createFileURL(const String&);
-
</del><span class="cx"> void selectCacheWithoutManifest();
</span><span class="cx"> void selectCacheWithManifest(const URL& manifestURL);
</span><span class="cx">
</span><span class="lines">@@ -128,8 +125,8 @@
</span><span class="cx"> WEBCORE_EXPORT bool maybeLoadFallbackForResponse(ResourceLoader*, const ResourceResponse&);
</span><span class="cx"> WEBCORE_EXPORT bool maybeLoadFallbackForError(ResourceLoader*, const ResourceError&);
</span><span class="cx">
</span><del>- bool maybeLoadSynchronously(ResourceRequest&, ResourceError&, ResourceResponse&, RefPtr<SharedBuffer>&);
- void maybeLoadFallbackSynchronously(const ResourceRequest&, ResourceError&, ResourceResponse&, RefPtr<SharedBuffer>&);
</del><ins>+ bool maybeLoadSynchronously(ResourceRequest&, ResourceError&, ResourceResponse&, Vector<char>& data);
+ void maybeLoadFallbackSynchronously(const ResourceRequest&, ResourceError&, ResourceResponse&, Vector<char>& 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&, const ResourceError&);
</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<ApplicationCache> 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<SharedBuffer> data;
</del><ins>+ Vector<char> data;
</ins><span class="cx">
</span><span class="cx"> bool requestAllowed = globalCachedResourceLoader->frame() && globalCachedResourceLoader->document()->securityOrigin()->canRequest(url);
</span><span class="cx"> if (requestAllowed) {
</span><span class="cx"> globalCachedResourceLoader->frame()->loader().loadResourceSynchronously(url, AllowStoredCredentials, DoNotAskClientForCrossOriginCredentials, error, response, data);
</span><span class="cx"> if (error.isNull())
</span><span class="cx"> requestAllowed = globalCachedResourceLoader->document()->securityOrigin()->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->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->data() : nullptr, data ? data->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<SharedBuffer> data;
</del><ins>+ Vector<char> 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 <https://bugs.webkit.org/show_bug.cgi?id=21963>.
</span><span class="cx"> if (!shouldAllowExternalLoad(response.url()))
</span><span class="cx"> return &globalDescriptor;
</span><del>- Vector<char> buffer;
- if (data)
- buffer.append(data->data(), data->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>