<!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>[166434] 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/166434">166434</a></dd>
<dt>Author</dt> <dd>bburg@apple.com</dd>
<dt>Date</dt> <dd>2014-03-28 15:46:27 -0700 (Fri, 28 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Replay: add page-level setting to bypass the MemoryCache
https://bugs.webkit.org/show_bug.cgi?id=130728

Reviewed by Timothy Hatcher.

Source/WebCore:

When replaying a specific Page we don't want to store its cached resources in the
MemoryCache. This patch adds a page setting to prevent the page's resources from
being saved in the MemoryCache.

If Settings::usesMemoryCache() is false, page resources are given the special
SessionID bypassCacheSessionID(). The cached resource loader and memory cache
act as if the memory cache is disabled if the resource has this special session id.

Hook up ReplayController to override the memory cache setting during capture/replay.

Test: http/tests/cache/bypass-memory-cache-after-reload.html

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::revalidateResource):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::add):
* page/Page.cpp:
(WebCore::Page::sessionID):
* page/SessionID.h:
(WebCore::SessionID::bypassCacheSessionID):
* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
(WebCore::Settings::setUsesMemoryCache):
(WebCore::Settings::usesMemoryCache):
* replay/ReplayController.cpp:
(WebCore::ReplayController::setForceDeterministicSettings):
* replay/ReplayController.h:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setUsesMemoryCache):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

Source/WebKit2:

* UIProcess/APISession.cpp:
(API::generateID): update the base ID for generating unique sessions.

LayoutTests:

Mac WebKit2 needs different expectations because of resource load timing characteristics
introduced by the interaction of Settings::usesMemoryCache and NetworkProcess.

* http/tests/cache/bypass-memory-cache-after-reload-expected.txt: Added.
* http/tests/cache/bypass-memory-cache-after-reload.html: Added.
* platform/mac-wk2/http/tests/cache/bypass-memory-cache-after-reload-expected.txt: 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="#trunkSourceWebCoreloadercacheCachedResourceLoadercpp">trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheMemoryCachecpp">trunk/Source/WebCore/loader/cache/MemoryCache.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepageSessionIDh">trunk/Source/WebCore/page/SessionID.h</a></li>
<li><a href="#trunkSourceWebCorepageSettingscpp">trunk/Source/WebCore/page/Settings.cpp</a></li>
<li><a href="#trunkSourceWebCorepageSettingsh">trunk/Source/WebCore/page/Settings.h</a></li>
<li><a href="#trunkSourceWebCorereplayReplayControllercpp">trunk/Source/WebCore/replay/ReplayController.cpp</a></li>
<li><a href="#trunkSourceWebCorereplayReplayControllerh">trunk/Source/WebCore/replay/ReplayController.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingscpp">trunk/Source/WebCore/testing/InternalSettings.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingsh">trunk/Source/WebCore/testing/InternalSettings.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingsidl">trunk/Source/WebCore/testing/InternalSettings.idl</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPISessioncpp">trunk/Source/WebKit2/UIProcess/APISession.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestscachebypassmemorycacheafterreloadexpectedtxt">trunk/LayoutTests/http/tests/cache/bypass-memory-cache-after-reload-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestscachebypassmemorycacheafterreloadhtml">trunk/LayoutTests/http/tests/cache/bypass-memory-cache-after-reload.html</a></li>
<li>trunk/LayoutTests/platform/mac-wk2/http/tests/cache/</li>
<li><a href="#trunkLayoutTestsplatformmacwk2httptestscachebypassmemorycacheafterreloadexpectedtxt">trunk/LayoutTests/platform/mac-wk2/http/tests/cache/bypass-memory-cache-after-reload-expected.txt</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (166433 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-03-28 22:31:48 UTC (rev 166433)
+++ trunk/LayoutTests/ChangeLog        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-03-28  Brian Burg  &lt;bburg@apple.com&gt;
+
+        Web Replay: add page-level setting to bypass the MemoryCache
+        https://bugs.webkit.org/show_bug.cgi?id=130728
+
+        Reviewed by Timothy Hatcher.
+
+        Mac WebKit2 needs different expectations because of resource load timing characteristics
+        introduced by the interaction of Settings::usesMemoryCache and NetworkProcess.
+
+        * http/tests/cache/bypass-memory-cache-after-reload-expected.txt: Added.
+        * http/tests/cache/bypass-memory-cache-after-reload.html: Added.
+        * platform/mac-wk2/http/tests/cache/bypass-memory-cache-after-reload-expected.txt: Added.
+
</ins><span class="cx"> 2014-03-28  Radu Stavila  &lt;stavila@adobe.com&gt;
</span><span class="cx"> 
</span><span class="cx">         In some situations, partial layouts of floating elements produce incorrect results.
</span></span></pre></div>
<a id="trunkLayoutTestshttptestscachebypassmemorycacheafterreloadexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/cache/bypass-memory-cache-after-reload-expected.txt (0 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/cache/bypass-memory-cache-after-reload-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/cache/bypass-memory-cache-after-reload-expected.txt        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html - didFinishLoading
+http://127.0.0.1:8000/cache/resources/random-cached.cgi - willSendRequest &lt;NSURLRequest URL http://127.0.0.1:8000/cache/resources/random-cached.cgi, main document URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http method GET&gt; redirectResponse (null)
+http://127.0.0.1:8000/cache/resources/random-cached.cgi - didReceiveResponse &lt;NSURLResponse http://127.0.0.1:8000/cache/resources/random-cached.cgi, http status code 200&gt;
+http://127.0.0.1:8000/cache/resources/random-cached.cgi - didFinishLoading
+http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html - willSendRequest &lt;NSURLRequest URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, main document URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http method GET&gt; redirectResponse (null)
+http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html - didReceiveResponse &lt;NSURLResponse http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http status code 200&gt;
+http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html - didFinishLoading
+http://127.0.0.1:8000/cache/resources/random-cached.cgi - willSendRequest &lt;NSURLRequest URL http://127.0.0.1:8000/cache/resources/random-cached.cgi, main document URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http method GET&gt; redirectResponse (null)
+http://127.0.0.1:8000/cache/resources/random-cached.cgi - didReceiveResponse &lt;NSURLResponse http://127.0.0.1:8000/cache/resources/random-cached.cgi, http status code 200&gt;
+http://127.0.0.1:8000/cache/resources/random-cached.cgi - didFinishLoading
+FINISHED LOADING
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscachebypassmemorycacheafterreloadhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/cache/bypass-memory-cache-after-reload.html (0 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/cache/bypass-memory-cache-after-reload.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/cache/bypass-memory-cache-after-reload.html        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+&lt;body&gt;
+&lt;h1&gt;&lt;/h1&gt;
+&lt;script&gt;
+// Test that a subresource fetched after onload, following a reload, is
+// not cached if we configure the page's settings to bypass the memory cache.
+if (!sessionStorage.lastRandom) {
+    if (window.testRunner &amp;&amp; window.internals) {
+        internals.settings.setUsesMemoryCache(false);
+        testRunner.dumpResourceLoadCallbacks();
+        testRunner.dumpAsText();
+        testRunner.waitUntilDone();
+    }
+}
+
+function done(result)
+{
+    delete sessionStorage.lastRandom;
+
+    document.body.innerText = result;
+
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+function scriptLoaded()
+{
+    setTimeout(function()
+    {
+        if (!window.randomNumber)
+            done('FAIL: window.randomNumber not defined!');
+        else if (sessionStorage.lastRandom) {
+            // We don't want to compare the actual random numbers because
+            // the request may or may not be cached by the network stack.
+            done('FINISHED LOADING');
+        } else {
+            sessionStorage.lastRandom = randomNumber;
+            location.reload();
+        }
+    }, 0);
+}
+
+onload = function()
+{
+    setTimeout(function()
+    {
+        var s = document.createElement(&quot;script&quot;);
+        s.src = &quot;resources/random-cached.cgi&quot;;
+        s.onload = scriptLoaded;
+        document.body.appendChild(s);
+    }, 0);
+};
+&lt;/script&gt;
+&lt;/body&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2httptestscachebypassmemorycacheafterreloadexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-wk2/http/tests/cache/bypass-memory-cache-after-reload-expected.txt (0 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/http/tests/cache/bypass-memory-cache-after-reload-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/http/tests/cache/bypass-memory-cache-after-reload-expected.txt        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html - didFinishLoading
+http://127.0.0.1:8000/favicon.ico - willSendRequest &lt;NSURLRequest URL http://127.0.0.1:8000/favicon.ico, main document URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http method GET&gt; redirectResponse (null)
+http://127.0.0.1:8000/cache/resources/random-cached.cgi - willSendRequest &lt;NSURLRequest URL http://127.0.0.1:8000/cache/resources/random-cached.cgi, main document URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http method GET&gt; redirectResponse (null)
+http://127.0.0.1:8000/favicon.ico - didReceiveResponse &lt;NSURLResponse http://127.0.0.1:8000/favicon.ico, http status code 200&gt;
+http://127.0.0.1:8000/favicon.ico - didFinishLoading
+http://127.0.0.1:8000/cache/resources/random-cached.cgi - didReceiveResponse &lt;NSURLResponse http://127.0.0.1:8000/cache/resources/random-cached.cgi, http status code 200&gt;
+http://127.0.0.1:8000/cache/resources/random-cached.cgi - didFinishLoading
+http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html - willSendRequest &lt;NSURLRequest URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, main document URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http method GET&gt; redirectResponse (null)
+http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html - didReceiveResponse &lt;NSURLResponse http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http status code 200&gt;
+http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html - didFinishLoading
+http://127.0.0.1:8000/cache/resources/random-cached.cgi - willSendRequest &lt;NSURLRequest URL http://127.0.0.1:8000/cache/resources/random-cached.cgi, main document URL http://127.0.0.1:8000/cache/bypass-memory-cache-after-reload.html, http method GET&gt; redirectResponse (null)
+http://127.0.0.1:8000/cache/resources/random-cached.cgi - didReceiveResponse &lt;NSURLResponse http://127.0.0.1:8000/cache/resources/random-cached.cgi, http status code 200&gt;
+http://127.0.0.1:8000/cache/resources/random-cached.cgi - didFinishLoading
+FINISHED LOADING
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (166433 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-28 22:31:48 UTC (rev 166433)
+++ trunk/Source/WebCore/ChangeLog        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2014-03-28  Brian Burg  &lt;bburg@apple.com&gt;
+
+        Web Replay: add page-level setting to bypass the MemoryCache
+        https://bugs.webkit.org/show_bug.cgi?id=130728
+
+        Reviewed by Timothy Hatcher.
+
+        When replaying a specific Page we don't want to store its cached resources in the
+        MemoryCache. This patch adds a page setting to prevent the page's resources from
+        being saved in the MemoryCache.
+
+        If Settings::usesMemoryCache() is false, page resources are given the special
+        SessionID bypassCacheSessionID(). The cached resource loader and memory cache
+        act as if the memory cache is disabled if the resource has this special session id.
+
+        Hook up ReplayController to override the memory cache setting during capture/replay.
+
+        Test: http/tests/cache/bypass-memory-cache-after-reload.html
+
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::requestResource):
+        (WebCore::CachedResourceLoader::revalidateResource):
+        * loader/cache/MemoryCache.cpp:
+        (WebCore::MemoryCache::add):
+        * page/Page.cpp:
+        (WebCore::Page::sessionID):
+        * page/SessionID.h:
+        (WebCore::SessionID::bypassCacheSessionID):
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        * page/Settings.h:
+        (WebCore::Settings::setUsesMemoryCache):
+        (WebCore::Settings::usesMemoryCache):
+        * replay/ReplayController.cpp:
+        (WebCore::ReplayController::setForceDeterministicSettings):
+        * replay/ReplayController.h:
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::Backup::Backup):
+        (WebCore::InternalSettings::Backup::restoreTo):
+        (WebCore::InternalSettings::setUsesMemoryCache):
+        * testing/InternalSettings.h:
+        * testing/InternalSettings.idl:
+
</ins><span class="cx"> 2014-03-28  Radu Stavila  &lt;stavila@adobe.com&gt;
</span><span class="cx"> 
</span><span class="cx">         In some situations, partial layouts of floating elements produce incorrect results.
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (166433 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2014-03-28 22:31:48 UTC (rev 166433)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -484,7 +484,10 @@
</span><span class="cx">         m_validatedURLs.add(request.resourceRequest().url());
</span><span class="cx"> 
</span><span class="cx">     ASSERT(resource-&gt;url() == url.string());
</span><del>-    m_documentResources.set(resource-&gt;url(), resource);
</del><ins>+
+    if (sessionID() != SessionID::bypassCacheSessionID())
+        m_documentResources.set(resource-&gt;url(), resource);
+
</ins><span class="cx">     return resource;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -496,6 +499,7 @@
</span><span class="cx">     ASSERT(resource-&gt;canUseCacheValidator());
</span><span class="cx">     ASSERT(!resource-&gt;resourceToRevalidate());
</span><span class="cx">     ASSERT(resource-&gt;sessionID() == sessionID());
</span><ins>+    ASSERT(sessionID() != SessionID::bypassCacheSessionID());
</ins><span class="cx"> 
</span><span class="cx">     // Copy the URL out of the resource to be revalidated in case it gets deleted by the remove() call below.
</span><span class="cx">     String url = resource-&gt;url();
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheMemoryCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/MemoryCache.cpp (166433 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2014-03-28 22:31:48 UTC (rev 166433)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -110,6 +110,9 @@
</span><span class="cx">     if (disabled())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+    if (resource-&gt;sessionID() == SessionID::bypassCacheSessionID())
+        return false;
+
</ins><span class="cx">     ASSERT(WTF::isMainThread());
</span><span class="cx"> 
</span><span class="cx">     CachedResourceMap&amp; resources = getSessionMap(resource-&gt;sessionID());
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (166433 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2014-03-28 22:31:48 UTC (rev 166433)
+++ trunk/Source/WebCore/page/Page.cpp        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -1520,6 +1520,9 @@
</span><span class="cx">     if (settings().privateBrowsingEnabled())
</span><span class="cx">         return SessionID::legacyPrivateSessionID();
</span><span class="cx"> 
</span><ins>+    if (!settings().usesMemoryCache())
+        return SessionID::bypassCacheSessionID();
+
</ins><span class="cx">     return SessionID::defaultSessionID();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageSessionIDh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/SessionID.h (166433 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/SessionID.h        2014-03-28 22:31:48 UTC (rev 166433)
+++ trunk/Source/WebCore/page/SessionID.h        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx">     static SessionID emptySessionID() { return SessionID(0); }
</span><span class="cx">     static SessionID defaultSessionID() { return SessionID(1); }
</span><span class="cx">     static SessionID legacyPrivateSessionID() { return SessionID(2); }
</span><ins>+    static SessionID bypassCacheSessionID() { return SessionID(3); }
</ins><span class="cx"> private:
</span><span class="cx">     uint64_t m_sessionID;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.cpp (166433 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.cpp        2014-03-28 22:31:48 UTC (rev 166433)
+++ trunk/Source/WebCore/page/Settings.cpp        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -177,6 +177,7 @@
</span><span class="cx">     , m_isScriptEnabled(false)
</span><span class="cx">     , m_needsAdobeFrameReloadingQuirk(false)
</span><span class="cx">     , m_usesPageCache(false)
</span><ins>+    , m_usesMemoryCache(true)
</ins><span class="cx">     , m_fontRenderingMode(0)
</span><span class="cx">     , m_showTiledScrollingIndicator(false)
</span><span class="cx">     , m_tiledBackingStoreEnabled(false)
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.h (166433 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.h        2014-03-28 22:31:48 UTC (rev 166433)
+++ trunk/Source/WebCore/page/Settings.h        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -181,7 +181,10 @@
</span><span class="cx"> 
</span><span class="cx">     void setUsesPageCache(bool);
</span><span class="cx">     bool usesPageCache() const { return m_usesPageCache; }
</span><del>-        
</del><ins>+
+    void setUsesMemoryCache(bool usesMemoryCache) { m_usesMemoryCache = usesMemoryCache; }
+    bool usesMemoryCache() const { return m_usesMemoryCache; }
+
</ins><span class="cx">     void setFontRenderingMode(FontRenderingMode mode);
</span><span class="cx">     FontRenderingMode fontRenderingMode() const;
</span><span class="cx"> 
</span><span class="lines">@@ -307,6 +310,7 @@
</span><span class="cx">     bool m_isScriptEnabled : 1;
</span><span class="cx">     bool m_needsAdobeFrameReloadingQuirk : 1;
</span><span class="cx">     bool m_usesPageCache : 1;
</span><ins>+    bool m_usesMemoryCache : 1;
</ins><span class="cx">     unsigned m_fontRenderingMode : 1;
</span><span class="cx">     bool m_showTiledScrollingIndicator : 1;
</span><span class="cx">     bool m_tiledBackingStoreEnabled : 1;
</span></span></pre></div>
<a id="trunkSourceWebCorereplayReplayControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/ReplayController.cpp (166433 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/ReplayController.cpp        2014-03-28 22:31:48 UTC (rev 166433)
+++ trunk/Source/WebCore/replay/ReplayController.cpp        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -71,10 +71,13 @@
</span><span class="cx">     ASSERT(shouldForce ^ (m_sessionState == SessionState::Inactive));
</span><span class="cx"> 
</span><span class="cx">     if (shouldForce) {
</span><ins>+        m_savedSettings.usesMemoryCache = m_page.settings().usesMemoryCache();
</ins><span class="cx">         m_savedSettings.usesPageCache = m_page.settings().usesPageCache();
</span><span class="cx"> 
</span><ins>+        m_page.settings().setUsesMemoryCache(false);
</ins><span class="cx">         m_page.settings().setUsesPageCache(false);
</span><span class="cx">     } else {
</span><ins>+        m_page.settings().setUsesMemoryCache(m_savedSettings.usesMemoryCache);
</ins><span class="cx">         m_page.settings().setUsesPageCache(m_savedSettings.usesPageCache);
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorereplayReplayControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/ReplayController.h (166433 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/ReplayController.h        2014-03-28 22:31:48 UTC (rev 166433)
+++ trunk/Source/WebCore/replay/ReplayController.h        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -154,10 +154,12 @@
</span><span class="cx">     void setForceDeterministicSettings(bool);
</span><span class="cx"> 
</span><span class="cx">     struct SavedSettings {
</span><ins>+        bool usesMemoryCache;
</ins><span class="cx">         bool usesPageCache;
</span><span class="cx"> 
</span><span class="cx">         SavedSettings()
</span><del>-            : usesPageCache(false)
</del><ins>+            : usesMemoryCache(true)
+            , usesPageCache(false)
</ins><span class="cx">         { }
</span><span class="cx">     };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (166433 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.cpp        2014-03-28 22:31:48 UTC (rev 166433)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -91,6 +91,7 @@
</span><span class="cx">     , m_autoscrollForDragAndDropEnabled(settings.autoscrollForDragAndDropEnabled())
</span><span class="cx">     , m_pluginReplacementEnabled(RuntimeEnabledFeatures::sharedFeatures().pluginReplacementEnabled())
</span><span class="cx">     , m_shouldConvertPositionStyleOnCopy(settings.shouldConvertPositionStyleOnCopy())
</span><ins>+    , m_usesMemoryCache(settings.usesMemoryCache())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -149,6 +150,7 @@
</span><span class="cx">     settings.setUseLegacyBackgroundSizeShorthandBehavior(m_useLegacyBackgroundSizeShorthandBehavior);
</span><span class="cx">     settings.setAutoscrollForDragAndDropEnabled(m_autoscrollForDragAndDropEnabled);
</span><span class="cx">     settings.setShouldConvertPositionStyleOnCopy(m_shouldConvertPositionStyleOnCopy);
</span><ins>+    settings.setUsesMemoryCache(m_usesMemoryCache);
</ins><span class="cx">     RuntimeEnabledFeatures::sharedFeatures().setPluginReplacementEnabled(m_pluginReplacementEnabled);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -493,4 +495,10 @@
</span><span class="cx">     settings()-&gt;setShouldConvertPositionStyleOnCopy(convert);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InternalSettings::setUsesMemoryCache(bool usesMemoryCache, ExceptionCode&amp; ec)
+{
+    InternalSettingsGuardForSettings();
+    settings()-&gt;setUsesMemoryCache(usesMemoryCache);
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.h (166433 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.h        2014-03-28 22:31:48 UTC (rev 166433)
+++ trunk/Source/WebCore/testing/InternalSettings.h        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -88,6 +88,7 @@
</span><span class="cx">         bool m_autoscrollForDragAndDropEnabled;
</span><span class="cx">         bool m_pluginReplacementEnabled;
</span><span class="cx">         bool m_shouldConvertPositionStyleOnCopy;
</span><ins>+        bool m_usesMemoryCache;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     static PassRefPtr&lt;InternalSettings&gt; create(Page* page)
</span><span class="lines">@@ -132,8 +133,8 @@
</span><span class="cx">     void setPluginReplacementEnabled(bool);
</span><span class="cx">     void setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground, ExceptionCode&amp;);
</span><span class="cx">     void setShouldConvertPositionStyleOnCopy(bool convert, ExceptionCode&amp;);
</span><ins>+    void setUsesMemoryCache(bool usesMemoryCache, ExceptionCode&amp;);
</ins><span class="cx"> 
</span><del>-
</del><span class="cx"> private:
</span><span class="cx">     explicit InternalSettings(Page*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.idl (166433 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.idl        2014-03-28 22:31:48 UTC (rev 166433)
+++ trunk/Source/WebCore/testing/InternalSettings.idl        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -59,4 +59,5 @@
</span><span class="cx">     void setPluginReplacementEnabled(boolean enabled);
</span><span class="cx">     [RaisesException] void setBackgroundShouldExtendBeyondPage(boolean hasExtendedBackground);
</span><span class="cx">     [RaisesException] void setShouldConvertPositionStyleOnCopy(boolean convert);
</span><ins>+    [RaisesException] void setUsesMemoryCache(boolean usesMemoryCache);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (166433 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-03-28 22:31:48 UTC (rev 166433)
+++ trunk/Source/WebKit2/ChangeLog        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-03-28  Brian Burg  &lt;bburg@apple.com&gt;
+
+        Web Replay: add page-level setting to bypass the MemoryCache
+        https://bugs.webkit.org/show_bug.cgi?id=130728
+
+        Reviewed by Timothy Hatcher.
+
+        * UIProcess/APISession.cpp:
+        (API::generateID): update the base ID for generating unique sessions.
+
</ins><span class="cx"> 2014-03-28  Cody Krieger  &lt;cjk@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add willSubmitForm callback support to WKWebProcessPlugInFormDelegatePrivate.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPISessioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/APISession.cpp (166433 => 166434)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/APISession.cpp        2014-03-28 22:31:48 UTC (rev 166433)
+++ trunk/Source/WebKit2/UIProcess/APISession.cpp        2014-03-28 22:46:27 UTC (rev 166434)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx"> 
</span><del>-    static uint64_t uniqueSessionID = WebCore::SessionID::legacyPrivateSessionID().sessionID();
</del><ins>+    static uint64_t uniqueSessionID = WebCore::SessionID::bypassCacheSessionID().sessionID();
</ins><span class="cx">     ASSERT_UNUSED(isEphemeral, isEphemeral);
</span><span class="cx">     return ++uniqueSessionID;
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>