<!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>[182449] 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/182449">182449</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-04-06 23:22:59 -0700 (Mon, 06 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Bing video search result pages are not PageCacheable
https://bugs.webkit.org/show_bug.cgi?id=143463
&lt;rdar://problem/20440916&gt;

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Bing video search result pages are not PageCacheable (tested on iOS).
It both:
- is bad for power usage as it causes a reload when clicking one of the
  results then navigating back in history.
- degrades user experience because the results page uses infinite
  scrolling and the scroll position is not properly restored when
  navigating back, not to mention the user has to wait for the reload
  to complete.

The issue was that the bing search page was doing a ping load when
clicking on one of the search results. The ping load was done by
create an image and its 'src' attribute to the ping URL. This load
usually did not have time to complete when navigating away so we would
cancel it and the main document would end up with an error that would
prevent the page from entering the page cache. We already have code
making sure load cancellations do not prevent page caching as long as
the loads are for XHR or images. However, the latter check was broken
in the case where the ResourceRequest's cachePartition was non-empty.
This is because the check was using the MemoryCache::ResourceForUrl()
API which rarely does what we want because it will request a dummy
ResourceRequest (without cachePartition) and then call
MemoryCache::resourceForRequest(). This patch updates the check
to use resourceForRequest() directly as we have the ResourceRequest
at this point.

This patch also gets rid of the  MemoryCache::ResourceForUrl() API as
it rarely does what we want and it is bug prone. It was only used in
2 places, one of them causing this bug and the other in Internals.

Tests: http/tests/navigation/page-cache-pending-image-load-cache-partition.html
       http/tests/navigation/page-cache-pending-image-load.html

* loader/DocumentLoader.cpp:
(WebCore::areAllLoadersPageCacheAcceptable):
Use MemoryCache::resourceForRequest() instead of resourceForUrl() as
we have the ResourceRequest and calling resourceForUrl() would loose
the cachePartition.

* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::resourceForURL): Deleted.
Drop this API as it is bug prone and rarely does what we want.

* testing/Internals.cpp:
(WebCore::Internals::isLoadingFromMemoryCache):
Update call to create a dummy ResourceRequest and call
resourceForRequest() instead of resourceForUrl(), as this API no
longer exists. The new code also set the cachePartition on the
dummy request so that this function actually behaves as expected
if the cachePartition in the memory cache is non-empty.

Source/WebKit/mac:

Fix the iOS / WK1 build by using MemoryCache::resourceForRequest()
instead of resourceForUrl().

* Misc/WebCache.mm:
(+[WebCache imageForURL:]):

LayoutTests:

Add layout tests to confirm that a pending image load does not prevent
a page from entering the page cache. There are 2 tests, once that cover
the case where the request's cachePartion is empty (passing without the
fix), and another where the request's cachePartition is non-empty
(which only passes with the fix).

* http/tests/navigation/page-cache-pending-image-load-cache-partition-expected.txt: Added.
* http/tests/navigation/page-cache-pending-image-load-cache-partition.html: Added.
* http/tests/navigation/page-cache-pending-image-load-expected.txt: Added.
* http/tests/navigation/page-cache-pending-image-load.html: Added.</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="#trunkSourceWebCoreloaderDocumentLoadercpp">trunk/Source/WebCore/loader/DocumentLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheMemoryCachecpp">trunk/Source/WebCore/loader/cache/MemoryCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheMemoryCacheh">trunk/Source/WebCore/loader/cache/MemoryCache.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebCachemm">trunk/Source/WebKit/mac/Misc/WebCache.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestsnavigationpagecachependingimageloadcachepartitionexpectedtxt">trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load-cache-partition-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsnavigationpagecachependingimageloadcachepartitionhtml">trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load-cache-partition.html</a></li>
<li><a href="#trunkLayoutTestshttptestsnavigationpagecachependingimageloadexpectedtxt">trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsnavigationpagecachependingimageloadhtml">trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (182448 => 182449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-04-07 00:29:39 UTC (rev 182448)
+++ trunk/LayoutTests/ChangeLog        2015-04-07 06:22:59 UTC (rev 182449)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2015-04-06  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Bing video search result pages are not PageCacheable
+        https://bugs.webkit.org/show_bug.cgi?id=143463
+        &lt;rdar://problem/20440916&gt;
+
+        Reviewed by Alexey Proskuryakov.
+
+        Add layout tests to confirm that a pending image load does not prevent
+        a page from entering the page cache. There are 2 tests, once that cover
+        the case where the request's cachePartion is empty (passing without the
+        fix), and another where the request's cachePartition is non-empty
+        (which only passes with the fix).
+
+        * http/tests/navigation/page-cache-pending-image-load-cache-partition-expected.txt: Added.
+        * http/tests/navigation/page-cache-pending-image-load-cache-partition.html: Added.
+        * http/tests/navigation/page-cache-pending-image-load-expected.txt: Added.
+        * http/tests/navigation/page-cache-pending-image-load.html: Added.
+
</ins><span class="cx"> 2015-04-06  Andy Estes  &lt;aestes@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         http/tests/contentfiltering/block-after-redirect.html fails on Windows
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsnavigationpagecachependingimageloadcachepartitionexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load-cache-partition-expected.txt (0 => 182449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load-cache-partition-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load-cache-partition-expected.txt        2015-04-07 06:22:59 UTC (rev 182449)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Tests that a page with a loading image goes into the page cache (with non-empty cache partition).
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+pageshow - not from cache
+pagehide - entering cache
+pageshow - from cache
+PASS Page did enter and was restored from the page cache
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsnavigationpagecachependingimageloadcachepartitionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load-cache-partition.html (0 => 182449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load-cache-partition.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load-cache-partition.html        2015-04-07 06:22:59 UTC (rev 182449)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;/resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description('Tests that a page with a loading image goes into the page cache (with non-empty cache partition).');
+window.jsTestIsAsync = true;
+internals.settings.setStorageBlockingPolicy('BlockThirdParty');
+
+if (window.testRunner)
+    testRunner.overridePreference(&quot;WebKitUsesPageCachePreferenceKey&quot;, 1);
+
+window.addEventListener(&quot;pageshow&quot;, function(event) {
+    debug(&quot;pageshow - &quot; + (event.persisted ? &quot;&quot; : &quot;not &quot;) + &quot;from cache&quot;);
+
+    if (event.persisted) {
+        testPassed(&quot;Page did enter and was restored from the page cache&quot;);
+        setTimeout(function() {
+            finishJSTest();
+        }, 0);
+    }
+}, false);
+
+window.addEventListener(&quot;pagehide&quot;, function(event) {
+    debug(&quot;pagehide - &quot; + (event.persisted ? &quot;&quot; : &quot;not &quot;) + &quot;entering cache&quot;);
+    if (!event.persisted) {
+        testFailed(&quot;Page did not enter the page cache.&quot;);
+        finishJSTest();
+    }
+}, false);
+
+window.addEventListener('load', function() {
+    setTimeout(function() {
+        // Slow loading image.
+        var slowImage = new Image();
+        slowImage.src = &quot;/history/resources/slow-image.php&quot;;
+        document.body.appendChild(slowImage);
+    }, 0);
+
+    // This needs to happen in a setTimeout because a navigation inside the onload handler would
+    // not create a history entry.
+    setTimeout(function() {
+      // Force a back navigation back to this page.
+      window.location.href = &quot;resources/page-cache-helper.html&quot;;
+    }, 0);
+}, false);
+
+&lt;/script&gt;
+&lt;script src=&quot;/resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsnavigationpagecachependingimageloadexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load-expected.txt (0 => 182449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load-expected.txt        2015-04-07 06:22:59 UTC (rev 182449)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Tests that a page with a loading image goes into the page cache.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+pageshow - not from cache
+pagehide - entering cache
+pageshow - from cache
+PASS Page did enter and was restored from the page cache
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsnavigationpagecachependingimageloadhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load.html (0 => 182449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/page-cache-pending-image-load.html        2015-04-07 06:22:59 UTC (rev 182449)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;/resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description('Tests that a page with a loading image goes into the page cache.');
+window.jsTestIsAsync = true;
+
+if (window.testRunner)
+    testRunner.overridePreference(&quot;WebKitUsesPageCachePreferenceKey&quot;, 1);
+
+window.addEventListener(&quot;pageshow&quot;, function(event) {
+    debug(&quot;pageshow - &quot; + (event.persisted ? &quot;&quot; : &quot;not &quot;) + &quot;from cache&quot;);
+
+    if (event.persisted) {
+        testPassed(&quot;Page did enter and was restored from the page cache&quot;);
+        setTimeout(function() {
+            finishJSTest();
+        }, 0);
+    }
+}, false);
+
+window.addEventListener(&quot;pagehide&quot;, function(event) {
+    debug(&quot;pagehide - &quot; + (event.persisted ? &quot;&quot; : &quot;not &quot;) + &quot;entering cache&quot;);
+    if (!event.persisted) {
+        testFailed(&quot;Page did not enter the page cache.&quot;);
+        finishJSTest();
+    }
+}, false);
+
+window.addEventListener('load', function() {
+    setTimeout(function() {
+        // Slow loading image.
+        var slowImage = new Image();
+        slowImage.src = &quot;/history/resources/slow-image.php&quot;;
+        document.body.appendChild(slowImage);
+    }, 0);
+
+    // This needs to happen in a setTimeout because a navigation inside the onload handler would
+    // not create a history entry.
+    setTimeout(function() {
+      // Force a back navigation back to this page.
+      window.location.href = &quot;resources/page-cache-helper.html&quot;;
+    }, 0);
+}, false);
+
+&lt;/script&gt;
+&lt;script src=&quot;/resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (182448 => 182449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-07 00:29:39 UTC (rev 182448)
+++ trunk/Source/WebCore/ChangeLog        2015-04-07 06:22:59 UTC (rev 182449)
</span><span class="lines">@@ -1,3 +1,62 @@
</span><ins>+2015-04-06  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Bing video search result pages are not PageCacheable
+        https://bugs.webkit.org/show_bug.cgi?id=143463
+        &lt;rdar://problem/20440916&gt;
+
+        Reviewed by Alexey Proskuryakov.
+
+        Bing video search result pages are not PageCacheable (tested on iOS).
+        It both:
+        - is bad for power usage as it causes a reload when clicking one of the
+          results then navigating back in history.
+        - degrades user experience because the results page uses infinite
+          scrolling and the scroll position is not properly restored when
+          navigating back, not to mention the user has to wait for the reload
+          to complete.
+
+        The issue was that the bing search page was doing a ping load when
+        clicking on one of the search results. The ping load was done by
+        create an image and its 'src' attribute to the ping URL. This load
+        usually did not have time to complete when navigating away so we would
+        cancel it and the main document would end up with an error that would
+        prevent the page from entering the page cache. We already have code
+        making sure load cancellations do not prevent page caching as long as
+        the loads are for XHR or images. However, the latter check was broken
+        in the case where the ResourceRequest's cachePartition was non-empty.
+        This is because the check was using the MemoryCache::ResourceForUrl()
+        API which rarely does what we want because it will request a dummy
+        ResourceRequest (without cachePartition) and then call
+        MemoryCache::resourceForRequest(). This patch updates the check
+        to use resourceForRequest() directly as we have the ResourceRequest
+        at this point.
+
+        This patch also gets rid of the  MemoryCache::ResourceForUrl() API as
+        it rarely does what we want and it is bug prone. It was only used in
+        2 places, one of them causing this bug and the other in Internals.
+
+        Tests: http/tests/navigation/page-cache-pending-image-load-cache-partition.html
+               http/tests/navigation/page-cache-pending-image-load.html
+
+        * loader/DocumentLoader.cpp:
+        (WebCore::areAllLoadersPageCacheAcceptable):
+        Use MemoryCache::resourceForRequest() instead of resourceForUrl() as
+        we have the ResourceRequest and calling resourceForUrl() would loose
+        the cachePartition.
+
+        * loader/cache/MemoryCache.cpp:
+        (WebCore::MemoryCache::resourceForURL): Deleted.
+        Drop this API as it is bug prone and rarely does what we want.
+
+        * testing/Internals.cpp:
+        (WebCore::Internals::isLoadingFromMemoryCache):
+        Update call to create a dummy ResourceRequest and call
+        resourceForRequest() instead of resourceForUrl(), as this API no
+        longer exists. The new code also set the cachePartition on the
+        dummy request so that this function actually behaves as expected
+        if the cachePartition in the memory cache is non-empty.
+
+
</ins><span class="cx"> 2015-04-06  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Synchronize fullscreen animation between processes.
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (182448 => 182449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.cpp        2015-04-07 00:29:39 UTC (rev 182448)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp        2015-04-07 06:22:59 UTC (rev 182449)
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx">         if (!loader-&gt;frameLoader())
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        CachedResource* cachedResource = MemoryCache::singleton().resourceForURL(loader-&gt;request().url(), loader-&gt;frameLoader()-&gt;frame().page()-&gt;sessionID());
</del><ins>+        CachedResource* cachedResource = MemoryCache::singleton().resourceForRequest(loader-&gt;request(), loader-&gt;frameLoader()-&gt;frame().page()-&gt;sessionID());
</ins><span class="cx">         if (!cachedResource)
</span><span class="cx">             return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheMemoryCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/MemoryCache.cpp (182448 => 182449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2015-04-07 00:29:39 UTC (rev 182448)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2015-04-07 06:22:59 UTC (rev 182449)
</span><span class="lines">@@ -168,11 +168,6 @@
</span><span class="cx">     revalidatingResource.clearResourceToRevalidate();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-CachedResource* MemoryCache::resourceForURL(const URL&amp; resourceURL, SessionID sessionID)
-{
-    return resourceForRequest(ResourceRequest(resourceURL), sessionID);
-}
-
</del><span class="cx"> CachedResource* MemoryCache::resourceForRequest(const ResourceRequest&amp; request, SessionID sessionID)
</span><span class="cx"> {
</span><span class="cx">     auto* resources = sessionResourceMap(sessionID);
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheMemoryCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/MemoryCache.h (182448 => 182449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/MemoryCache.h        2015-04-07 00:29:39 UTC (rev 182448)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.h        2015-04-07 06:22:59 UTC (rev 182449)
</span><span class="lines">@@ -91,7 +91,6 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT static MemoryCache&amp; singleton();
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT CachedResource* resourceForURL(const URL&amp;, SessionID = SessionID::defaultSessionID());
</del><span class="cx">     WEBCORE_EXPORT CachedResource* resourceForRequest(const ResourceRequest&amp;, SessionID);
</span><span class="cx"> 
</span><span class="cx">     bool add(CachedResource&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (182448 => 182449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2015-04-07 00:29:39 UTC (rev 182448)
+++ trunk/Source/WebCore/testing/Internals.cpp        2015-04-07 06:22:59 UTC (rev 182449)
</span><span class="lines">@@ -405,7 +405,12 @@
</span><span class="cx"> {
</span><span class="cx">     if (!contextDocument() || !contextDocument()-&gt;page())
</span><span class="cx">         return false;
</span><del>-    CachedResource* resource = MemoryCache::singleton().resourceForURL(contextDocument()-&gt;completeURL(url), contextDocument()-&gt;page()-&gt;sessionID());
</del><ins>+
+    ResourceRequest request(contextDocument()-&gt;completeURL(url));
+#if ENABLE(CACHE_PARTITIONING)
+    request.setDomainForCachePartition(contextDocument()-&gt;topOrigin()-&gt;domainForCachePartition());
+#endif
+    CachedResource* resource = MemoryCache::singleton().resourceForRequest(request, contextDocument()-&gt;page()-&gt;sessionID());
</ins><span class="cx">     return resource &amp;&amp; resource-&gt;status() == CachedResource::Cached;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (182448 => 182449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2015-04-07 00:29:39 UTC (rev 182448)
+++ trunk/Source/WebKit/mac/ChangeLog        2015-04-07 06:22:59 UTC (rev 182449)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-04-06  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Bing video search result pages are not PageCacheable
+        https://bugs.webkit.org/show_bug.cgi?id=143463
+        &lt;rdar://problem/20440916&gt;
+
+        Reviewed by Alexey Proskuryakov.
+
+        Fix the iOS / WK1 build by using MemoryCache::resourceForRequest()
+        instead of resourceForUrl().
+
+        * Misc/WebCache.mm:
+        (+[WebCache imageForURL:]):
+
</ins><span class="cx"> 2015-04-05  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove &quot;go ahead and&quot; from comments
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebCachemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebCache.mm (182448 => 182449)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebCache.mm        2015-04-07 00:29:39 UTC (rev 182448)
+++ trunk/Source/WebKit/mac/Misc/WebCache.mm        2015-04-07 06:22:59 UTC (rev 182449)
</span><span class="lines">@@ -201,7 +201,8 @@
</span><span class="cx">     if (!url)
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    WebCore::CachedResource* cachedResource = WebCore::MemoryCache::singleton().resourceForURL(url);
</del><ins>+    WebCore::ResourceRequest request(url);
+    WebCore::CachedResource* cachedResource = WebCore::MemoryCache::singleton().resourceForRequest(request, WebCore::SessionID::defaultSessionID());
</ins><span class="cx">     if (!is&lt;WebCore::CachedImage&gt;(cachedResource))
</span><span class="cx">         return nullptr;
</span><span class="cx">     WebCore::CachedImage&amp; cachedImage = downcast&lt;WebCore::CachedImage&gt;(*cachedResource);
</span></span></pre>
</div>
</div>

</body>
</html>