<!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>[180149] 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/180149">180149</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2015-02-16 09:17:39 -0800 (Mon, 16 Feb 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Develop/Disable Caches does not properly disable disk cache
https://bugs.webkit.org/show_bug.cgi?id=141636

Reviewed by Anders Carlsson.

Source/WebKit2:

The menu item sets the cache model to &quot;document viewer&quot; to disable the caches (cache size 0).
However the cache model was never passed to the network process after the initialization.

* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
(WebKit::NetworkCacheStorage::retrieve):
(WebKit::NetworkCacheStorage::store):
(WebKit::NetworkCacheStorage::update):

    Don't try to store or retrieve when the maximum cache size is set to zero.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setCacheModel):

   Message the network process too.

* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetCacheModel): Deleted.

    Remove the now unused SPI.

* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:

Tools:

Make testRunner.setCacheModel() use the WKContext interface so the model gets passed to
the network process too.

This makes setCacheModel asynchronous but there don't seem to be any tests that expect otherwise.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
(WTR::InjectedBundle::setCacheModel):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:

    Forward to TestController.

(WTR::TestRunner::setCacheModel):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):

LayoutTests:

* http/tests/cache/disk-cache-disable-expected.txt: Added.
* http/tests/cache/disk-cache-disable.html: Added.
* http/tests/cache/resources/cache-test.js:
(runTests): Add optional completion handler.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestscacheresourcescachetestjs">trunk/LayoutTests/http/tests/cache/resources/cache-test.js</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk1TestExpectations">trunk/LayoutTests/platform/mac-wk1/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformwinTestExpectations">trunk/LayoutTests/platform/win/TestExpectations</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkProcessmessagesin">trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheStorageCocoamm">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolcpp">trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePrivateh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundleh">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestInvocationcpp">trunk/Tools/WebKitTestRunner/TestInvocation.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestscachediskcachedisableexpectedtxt">trunk/LayoutTests/http/tests/cache/disk-cache-disable-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestscachediskcachedisablehtml">trunk/LayoutTests/http/tests/cache/disk-cache-disable.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (180148 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-02-16 17:16:16 UTC (rev 180148)
+++ trunk/LayoutTests/ChangeLog        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2015-02-16  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Develop/Disable Caches does not properly disable disk cache
+        https://bugs.webkit.org/show_bug.cgi?id=141636
+
+        Reviewed by Anders Carlsson.
+
+        * http/tests/cache/disk-cache-disable-expected.txt: Added.
+        * http/tests/cache/disk-cache-disable.html: Added.
+        * http/tests/cache/resources/cache-test.js:
+        (runTests): Add optional completion handler.
+
+2015-02-16  Antti Koivisto  &lt;antti@apple.com&gt;
+
</ins><span class="cx">         Assertion in disk cache code with redirect to a non-http resource
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=141644
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestscachediskcachedisableexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/cache/disk-cache-disable-expected.txt (0 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/cache/disk-cache-disable-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/cache/disk-cache-disable-expected.txt        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+Test that disabling disk cache by setting the cache model works.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Default (cache enabled)
+response headers: {&quot;Cache-control&quot;:&quot;max-age=100&quot;}
+response source: Disk cache
+
+Disabling cache
+response headers: {&quot;Cache-control&quot;:&quot;max-age=100&quot;}
+response source: Network
+
+Re-enabling cache
+response headers: {&quot;Cache-control&quot;:&quot;max-age=100&quot;}
+response source: Disk cache
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscachediskcachedisablehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/cache/disk-cache-disable.html (0 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/cache/disk-cache-disable.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/cache/disk-cache-disable.html        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+&lt;script src=&quot;/js-test-resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/cache-test.js&quot;&gt;&lt;/script&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+var tests =
+[
+  { responseHeaders: {'Cache-control': 'max-age=100' } },
+];
+
+description(&quot;Test that disabling disk cache by setting the cache model works.&quot;);
+
+debug(&quot;Default (cache enabled)&quot;);
+runTests(tests, function () {
+    debug(&quot;Disabling cache&quot;);
+    testRunner.setCacheModel(0); // DocumentViewer
+    runTests(tests, function () {
+         debug(&quot;Re-enabling cache&quot;);
+         testRunner.setCacheModel(1); // DocumentBrowser
+         runTests(tests);
+    });
+});
+
+&lt;/script&gt;
+&lt;script src=&quot;/js-test-resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscacheresourcescachetestjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/cache/resources/cache-test.js (180148 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/cache/resources/cache-test.js        2015-02-16 17:16:16 UTC (rev 180148)
+++ trunk/LayoutTests/http/tests/cache/resources/cache-test.js        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -87,19 +87,21 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function runTests(tests)
</del><ins>+function runTests(tests, completionHandler)
</ins><span class="cx"> {
</span><span class="cx">     loadResources(tests, function () {
</span><span class="cx">         // Otherwise we just get responses from the memory cache.
</span><span class="cx">         internals.clearMemoryCache();
</span><span class="cx">         // Wait a bit so things settle down in the disk cache.
</span><del>-        // FIXME: Shoudn't be needed, the cache should also return in-memory entries that are pending writing.
</del><span class="cx">         setTimeout(function () {
</span><span class="cx">             loadResources(tests, function () {
</span><span class="cx">                 printResults(tests);
</span><del>-                finishJSTest();
</del><ins>+                if (completionHandler)
+                    completionHandler();
+                else
+                    finishJSTest();
</ins><span class="cx">             });
</span><del>-        }, 2000);
</del><ins>+        }, 100);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (180148 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2015-02-16 17:16:16 UTC (rev 180148)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -185,6 +185,10 @@
</span><span class="cx"> http/tests/local/fileapi/send-dragged-file.html
</span><span class="cx"> http/tests/local/fileapi/send-sliced-dragged-file.html
</span><span class="cx"> 
</span><ins>+# Disk cache is not enabled yet on iOS
+http/tests/cache/disk-cache-validation.html
+http/tests/cache/disk-cache-disable.html
+
</ins><span class="cx"> ###
</span><span class="cx"> # Known failures
</span><span class="cx"> ##
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (180148 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/TestExpectations        2015-02-16 17:16:16 UTC (rev 180148)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -91,6 +91,7 @@
</span><span class="cx"> 
</span><span class="cx"> # Disk cache is WK2 only
</span><span class="cx"> http/tests/cache/disk-cache-validation.html
</span><ins>+http/tests/cache/disk-cache-disable.html
</ins><span class="cx"> 
</span><span class="cx"> ### END OF (2) Failures without bug reports
</span><span class="cx"> ########################################
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwinTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/TestExpectations (180148 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/TestExpectations        2015-02-16 17:16:16 UTC (rev 180148)
+++ trunk/LayoutTests/platform/win/TestExpectations        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -2050,9 +2050,12 @@
</span><span class="cx"> # HTTP 204 (No Content) should be ignored
</span><span class="cx"> webkit.org/b/60206 http/tests/navigation/response204.html [ Failure ]
</span><span class="cx"> 
</span><ins>+# Disk cache is WK2 only
+http/tests/cache/disk-cache-validation.html
+http/tests/cache/disk-cache-disable.html
+
</ins><span class="cx"> # The following are unreviewed:
</span><span class="cx"> http/tests/cache/content-type-ignored-during-revalidation.html [ Failure ]
</span><del>-http/tests/cache/disk-cache-validation.html [ Failure ]
</del><span class="cx"> http/tests/cache/partitioned-cache.html [ Failure ]
</span><span class="cx"> http/tests/cache/partitioned-cache-iframe.html [ Failure ]
</span><span class="cx"> http/tests/cache/post-redirect-get.php [ Failure ] # Easy
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (180148 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-02-16 17:16:16 UTC (rev 180148)
+++ trunk/Source/WebKit2/ChangeLog        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -1,5 +1,35 @@
</span><span class="cx"> 2015-02-16  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Develop/Disable Caches does not properly disable disk cache
+        https://bugs.webkit.org/show_bug.cgi?id=141636
+
+        Reviewed by Anders Carlsson.
+
+        The menu item sets the cache model to &quot;document viewer&quot; to disable the caches (cache size 0).
+        However the cache model was never passed to the network process after the initialization.
+
+        * NetworkProcess/NetworkProcess.messages.in:
+        * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
+        (WebKit::NetworkCacheStorage::retrieve):
+        (WebKit::NetworkCacheStorage::store):
+        (WebKit::NetworkCacheStorage::update):
+
+            Don't try to store or retrieve when the maximum cache size is set to zero.
+
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::setCacheModel):
+
+           Message the network process too.
+
+        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+        (WKBundleSetCacheModel): Deleted.
+
+            Remove the now unused SPI.
+
+        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
+
+2015-02-16  Antti Koivisto  &lt;antti@apple.com&gt;
+
</ins><span class="cx">         Assertion in disk cache code with redirect to a non-http resource
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=141644
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in (180148 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in        2015-02-16 17:16:16 UTC (rev 180148)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx">     GetNetworkProcessStatistics(uint64_t callbackID)
</span><span class="cx">     
</span><span class="cx">     ClearCacheForAllOrigins(uint32_t cachesToClear)
</span><ins>+    SetCacheModel(uint32_t cacheModel);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(NETWORK_PROCESS)
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheStorageCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm (180148 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm        2015-02-16 17:16:16 UTC (rev 180148)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -414,6 +414,11 @@
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx">     ASSERT(priority &lt;= maximumRetrievePriority);
</span><span class="cx"> 
</span><ins>+    if (!m_maximumSize) {
+        completionHandler(nullptr);
+        return;
+    }
+
</ins><span class="cx">     if (!m_contentsFilter.mayContain(key.shortHash())) {
</span><span class="cx">         completionHandler(nullptr);
</span><span class="cx">         return;
</span><span class="lines">@@ -432,6 +437,11 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx"> 
</span><ins>+    if (!m_maximumSize) {
+        completionHandler(false, Data());
+        return;
+    }
+
</ins><span class="cx">     auto writeOperation = std::make_unique&lt;WriteOperation&gt;(WriteOperation { key, entry, { }, WTF::move(completionHandler) });
</span><span class="cx">     m_pendingWriteOperations.append(WTF::move(writeOperation));
</span><span class="cx"> 
</span><span class="lines">@@ -445,6 +455,11 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx"> 
</span><ins>+    if (!m_maximumSize) {
+        completionHandler(false, Data());
+        return;
+    }
+
</ins><span class="cx">     auto writeOperation = std::make_unique&lt;WriteOperation&gt;(WriteOperation { key, updateEntry, existingEntry, WTF::move(completionHandler) });
</span><span class="cx">     m_pendingWriteOperations.append(WTF::move(writeOperation));
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (180148 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2015-02-16 17:16:16 UTC (rev 180148)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -1067,9 +1067,12 @@
</span><span class="cx"> void WebProcessPool::setCacheModel(CacheModel cacheModel)
</span><span class="cx"> {
</span><span class="cx">     m_cacheModel = cacheModel;
</span><del>-    sendToAllProcesses(Messages::WebProcess::SetCacheModel(static_cast&lt;uint32_t&gt;(m_cacheModel)));
</del><ins>+    sendToAllProcesses(Messages::WebProcess::SetCacheModel(m_cacheModel));
</ins><span class="cx"> 
</span><del>-    // FIXME: Inform the Network Process if in use.
</del><ins>+#if ENABLE(NETWORK_PROCESS)
+    if (m_usesNetworkProcess &amp;&amp; m_networkProcess)
+        m_networkProcess-&gt;send(Messages::NetworkProcess::SetCacheModel(m_cacheModel), 0);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebProcessPool::setDefaultRequestTimeoutInterval(double timeoutInterval)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp (180148 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp        2015-02-16 17:16:16 UTC (rev 180148)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -68,11 +68,6 @@
</span><span class="cx">     return toAPI(toImpl(bundleRef)-&gt;webConnectionToUIProcess());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WKBundleSetCacheModel(WKBundleRef bundleRef, uint32_t cacheModel)
-{
-    toImpl(bundleRef)-&gt;setCacheModel(cacheModel);
-}
-
</del><span class="cx"> void WKBundleGarbageCollectJavaScriptObjects(WKBundleRef bundleRef)
</span><span class="cx"> {
</span><span class="cx">     toImpl(bundleRef)-&gt;garbageCollectJavaScriptObjects();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h (180148 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h        2015-02-16 17:16:16 UTC (rev 180148)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx"> 
</span><span class="cx"> // TestRunner only SPI
</span><span class="cx"> WK_EXPORT void WKBundleSetAlwaysAcceptCookies(WKBundleRef bundle, bool);
</span><del>-WK_EXPORT void WKBundleSetCacheModel(WKBundleRef bundle, uint32_t cacheModel);
</del><span class="cx"> // Will make WebProcess ignore this preference until a preferences change notification, only for WebKitTestRunner use.
</span><span class="cx"> WK_EXPORT void WKBundleOverrideBoolPreferenceForTestRunner(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, WKStringRef preference, bool enabled);
</span><span class="cx"> WK_EXPORT void WKBundleSetAllowUniversalAccessFromFileURLs(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (180148 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-02-16 17:16:16 UTC (rev 180148)
+++ trunk/Tools/ChangeLog        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2015-02-16  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        Develop/Disable Caches does not properly disable disk cache
+        https://bugs.webkit.org/show_bug.cgi?id=141636
+
+        Reviewed by Anders Carlsson.
+
+        Make testRunner.setCacheModel() use the WKContext interface so the model gets passed to
+        the network process too.
+
+        This makes setCacheModel asynchronous but there don't seem to be any tests that expect otherwise.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::beginTesting):
+        (WTR::InjectedBundle::setCacheModel):
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+
+            Forward to TestController.
+
+        (WTR::TestRunner::setCacheModel):
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+
</ins><span class="cx"> 2015-02-16  Andrzej Badowski  &lt;a.badowski@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed. Add myself as a committer.
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (180148 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp        2015-02-16 17:16:16 UTC (rev 180148)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -251,7 +251,6 @@
</span><span class="cx">     WKBundleSetPopupBlockingEnabled(m_bundle, m_pageGroup, false);
</span><span class="cx">     WKBundleSetAlwaysAcceptCookies(m_bundle, false); // FIXME: Do this from UI process, so that Networking process gets the preference, too.
</span><span class="cx">     WKBundleSetSerialLoadingEnabled(m_bundle, false);
</span><del>-    WKBundleSetCacheModel(m_bundle, 1 /*CacheModelDocumentBrowser*/);
</del><span class="cx"> 
</span><span class="cx">     WKBundleRemoveAllUserContent(m_bundle, m_pageGroup);
</span><span class="cx"> 
</span><span class="lines">@@ -492,6 +491,13 @@
</span><span class="cx">     WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InjectedBundle::setCacheModel(int model)
+{
+    WKRetainPtr&lt;WKStringRef&gt; messageName(AdoptWK, WKStringCreateWithUTF8CString(&quot;SetCacheModel&quot;));
+    WKRetainPtr&lt;WKUInt64Ref&gt; messageBody(AdoptWK, WKUInt64Create(model));
+    WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get());
+}
+
</ins><span class="cx"> bool InjectedBundle::shouldProcessWorkQueue() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_useWorkQueue)
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundleh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h (180148 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h        2015-02-16 17:16:16 UTC (rev 180148)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -101,6 +101,9 @@
</span><span class="cx">     // Page Visibility.
</span><span class="cx">     void setHidden(bool);
</span><span class="cx"> 
</span><ins>+    // Cache.
+    void setCacheModel(int);
+
</ins><span class="cx">     // Work queue.
</span><span class="cx">     bool shouldProcessWorkQueue() const;
</span><span class="cx">     void processWorkQueue();
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (180148 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2015-02-16 17:16:16 UTC (rev 180148)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -651,7 +651,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setCacheModel(int model)
</span><span class="cx"> {
</span><del>-    WKBundleSetCacheModel(InjectedBundle::singleton().bundle(), model);
</del><ins>+    InjectedBundle::singleton().setCacheModel(model);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setAsynchronousSpellCheckingEnabled(bool enabled)
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestInvocationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (180148 => 180149)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp        2015-02-16 17:16:16 UTC (rev 180148)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp        2015-02-16 17:17:39 UTC (rev 180149)
</span><span class="lines">@@ -467,6 +467,13 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (WKStringIsEqualToUTF8CString(messageName, &quot;SetCacheModel&quot;)) {
+        ASSERT(WKGetTypeID(messageBody) == WKUInt64GetTypeID());
+        uint64_t model = WKUInt64GetValue(static_cast&lt;WKUInt64Ref&gt;(messageBody));
+        WKContextSetCacheModel(TestController::singleton().context(), model);
+        return;
+    }
+
</ins><span class="cx">     if (WKStringIsEqualToUTF8CString(messageName, &quot;SetCustomPolicyDelegate&quot;)) {
</span><span class="cx">         ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
</span><span class="cx">         WKDictionaryRef messageBodyDictionary = static_cast&lt;WKDictionaryRef&gt;(messageBody);
</span></span></pre>
</div>
</div>

</body>
</html>