<!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>[245715] 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/245715">245715</a></dd>
<dt>Author</dt> <dd>youenn@apple.com</dd>
<dt>Date</dt> <dd>2019-05-23 14:15:33 -0700 (Thu, 23 May 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>CacheStorageConnection callbacks should be completed on network connection close
https://bugs.webkit.org/show_bug.cgi?id=195757

Reviewed by Alex Christensen.

Source/WebCore:

Move HashMap-based callbacks to WorkerCacheStorageConnection.
Make CacheStorageConnection default API to implement use callbacks.
This is used by WebKit layer to do AsyncReply IPC.

Move DOMCacheEngine callbacks to CompletionHandler.

Test: http/wpt/cache-storage/cache-storage-networkprocess-crash.html

* Modules/cache/CacheStorageConnection.cpp:
* Modules/cache/CacheStorageConnection.h:
(WebCore::CacheStorageConnection::engineRepresentation):
* Modules/cache/DOMCacheEngine.h:
* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::recordsDataFromRecords):
(WebCore::recordsDataOrErrorFromRecords):
(WebCore::recordsFromRecordsData):
(WebCore::recordsOrErrorFromRecordsData):
(WebCore::WorkerCacheStorageConnection::open):
(WebCore::WorkerCacheStorageConnection::openOrRemoveCompleted):
(WebCore::WorkerCacheStorageConnection::remove):
(WebCore::WorkerCacheStorageConnection::retrieveCaches):
(WebCore::WorkerCacheStorageConnection::retrieveCachesCompleted):
(WebCore::WorkerCacheStorageConnection::retrieveRecords):
(WebCore::WorkerCacheStorageConnection::retrieveRecordsCompleted):
(WebCore::WorkerCacheStorageConnection::batchDeleteOperation):
(WebCore::WorkerCacheStorageConnection::deleteRecordsCompleted):
(WebCore::WorkerCacheStorageConnection::batchPutOperation):
(WebCore::WorkerCacheStorageConnection::putRecordsCompleted):
(WebCore::WorkerCacheStorageConnection::reference):
(WebCore::WorkerCacheStorageConnection::dereference):
(WebCore::WorkerCacheStorageConnection::clearPendingRequests):
* Modules/cache/WorkerCacheStorageConnection.h:
* page/CacheStorageProvider.h:
(WebCore::CacheStorageProvider::createCacheStorageConnection):

Source/WebKit:

Update according new WebCore CacheStorageConnection interface.
Use Async IPC replies so that the completion handlers are called on network crash.

Allow to have specific error handling in case of cancelled reply or badly decoded message.
This allows to reject the corresponding JS promise.

* CMakeLists.txt:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::clearMemoryRepresentation):
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::requestSpace):
(WebKit::CacheStorage::Caches::writeRecord):
* NetworkProcess/cache/CacheStorageEngineConnection.cpp:
(WebKit::CacheStorageEngineConnection::open):
(WebKit::CacheStorageEngineConnection::remove):
(WebKit::CacheStorageEngineConnection::caches):
(WebKit::CacheStorageEngineConnection::retrieveRecords):
(WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
(WebKit::CacheStorageEngineConnection::putRecords):
* NetworkProcess/cache/CacheStorageEngineConnection.h:
(IPC::AsyncReplyError<WebCore::DOMCacheEngine::CacheIdentifierOrError>::create):
(IPC::AsyncReplyError<WebCore::DOMCacheEngine::RecordIdentifiersOrError>::create):
(IPC::AsyncReplyError<WebCore::DOMCacheEngine::CacheInfosOrError>::create):
(IPC::AsyncReplyError<WebCore::DOMCacheEngine::RecordsOrError>::create):
* NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
* Platform/IPC/ArgumentCoders.h:
* Platform/IPC/Connection.h:
(IPC::AsyncReplyError::create):
* Scripts/webkit/messages.py:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Cache/WebCacheStorageConnection.cpp:
(WebKit::WebCacheStorageConnection::open):
(WebKit::WebCacheStorageConnection::remove):
(WebKit::WebCacheStorageConnection::retrieveCaches):
(WebKit::WebCacheStorageConnection::retrieveRecords):
(WebKit::WebCacheStorageConnection::batchDeleteOperation):
(WebKit::WebCacheStorageConnection::batchPutOperation):
(WebKit::WebCacheStorageConnection::engineRepresentation):
* WebProcess/Cache/WebCacheStorageConnection.h:
* WebProcess/Cache/WebCacheStorageConnection.messages.in: Removed.
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveMessage):

LayoutTests:

* http/wpt/cache-storage/cache-storage-networkprocess-crash-expected.txt: Added.
* http/wpt/cache-storage/cache-storage-networkprocess-crash.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="#trunkSourceWebCoreModulescacheCacheStorageConnectioncpp">trunk/Source/WebCore/Modules/cache/CacheStorageConnection.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulescacheCacheStorageConnectionh">trunk/Source/WebCore/Modules/cache/CacheStorageConnection.h</a></li>
<li><a href="#trunkSourceWebCoreModulescacheDOMCacheEngineh">trunk/Source/WebCore/Modules/cache/DOMCacheEngine.h</a></li>
<li><a href="#trunkSourceWebCoreModulescacheWorkerCacheStorageConnectioncpp">trunk/Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulescacheWorkerCacheStorageConnectionh">trunk/Source/WebCore/Modules/cache/WorkerCacheStorageConnection.h</a></li>
<li><a href="#trunkSourceWebCorepageCacheStorageProviderh">trunk/Source/WebCore/page/CacheStorageProvider.h</a></li>
<li><a href="#trunkSourceWebKitCMakeListstxt">trunk/Source/WebKit/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitDerivedSourcesoutputxcfilelist">trunk/Source/WebKit/DerivedSources-output.xcfilelist</a></li>
<li><a href="#trunkSourceWebKitDerivedSourcesmake">trunk/Source/WebKit/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesscacheCacheStorageEnginecpp">trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesscacheCacheStorageEngineCachescpp">trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesscacheCacheStorageEngineConnectioncpp">trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesscacheCacheStorageEngineConnectionh">trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesscacheCacheStorageEngineConnectionmessagesin">trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.messages.in</a></li>
<li><a href="#trunkSourceWebKitPlatformIPCArgumentCodersh">trunk/Source/WebKit/Platform/IPC/ArgumentCoders.h</a></li>
<li><a href="#trunkSourceWebKitPlatformIPCConnectionh">trunk/Source/WebKit/Platform/IPC/Connection.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkitmessagespy">trunk/Source/WebKit/Scripts/webkit/messages.py</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKitWebProcessCacheWebCacheStorageConnectioncpp">trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessCacheWebCacheStorageConnectionh">trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessCacheWebCacheStorageProvidercpp">trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageProvider.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessCacheWebCacheStorageProviderh">trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageProvider.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessNetworkNetworkProcessConnectioncpp">trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttpwptcachestoragecachestoragenetworkprocesscrashexpectedtxt">trunk/LayoutTests/http/wpt/cache-storage/cache-storage-networkprocess-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttpwptcachestoragecachestoragenetworkprocesscrashhtml">trunk/LayoutTests/http/wpt/cache-storage/cache-storage-networkprocess-crash.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitWebProcessCacheWebCacheStorageConnectionmessagesin">trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.messages.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/LayoutTests/ChangeLog 2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -1,5 +1,15 @@
</span><span class="cx"> 2019-05-23  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><ins>+        CacheStorageConnection callbacks should be completed on network connection close
+        https://bugs.webkit.org/show_bug.cgi?id=195757
+
+        Reviewed by Alex Christensen.
+
+        * http/wpt/cache-storage/cache-storage-networkprocess-crash-expected.txt: Added.
+        * http/wpt/cache-storage/cache-storage-networkprocess-crash.html: Added.
+
+2019-05-23  Youenn Fablet  <youenn@apple.com>
+
</ins><span class="cx">         Multiple videos (with audios) with autoplay & playinline not working. Only one video play at a time.
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=193312
</span><span class="cx">         <rdar://problem/47189864>
</span></span></pre></div>
<a id="trunkLayoutTestshttpwptcachestoragecachestoragenetworkprocesscrashexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/wpt/cache-storage/cache-storage-networkprocess-crash-expected.txt (0 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/wpt/cache-storage/cache-storage-networkprocess-crash-expected.txt                         (rev 0)
+++ trunk/LayoutTests/http/wpt/cache-storage/cache-storage-networkprocess-crash-expected.txt    2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+CONSOLE MESSAGE: Cache API operation failed: Internal error
+CONSOLE MESSAGE: Cache API operation failed: Internal error
+CONSOLE MESSAGE: Cache API operation failed: Internal error
+CONSOLE MESSAGE: Cache API operation failed: Internal error
+CONSOLE MESSAGE: Cache API operation failed: Internal error
+
+PASS Pending cache operation on network process crash 
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttpwptcachestoragecachestoragenetworkprocesscrashhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/wpt/cache-storage/cache-storage-networkprocess-crash.html (0 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/wpt/cache-storage/cache-storage-networkprocess-crash.html                         (rev 0)
+++ trunk/LayoutTests/http/wpt/cache-storage/cache-storage-networkprocess-crash.html    2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>Cache Storage: network process crash</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<script>
+promise_test(async test => {
+    const cache = await self.caches.open("test1");
+    const response1Mo = new Response(new ArrayBuffer(1024 * 1024));
+    if (!window.testRunner)
+        return Promise.reject("Requires internals API");
+    testRunner.terminateNetworkProcess();
+    return promise_rejects(test, new TypeError, Promise.all([
+        cache.put("1Mo1", response1Mo.clone()),
+        cache.put("1Mo2", response1Mo.clone()),
+        cache.put("1Mo3", response1Mo.clone()),
+        cache.put("1Mo4", response1Mo.clone()),
+        cache.put("1Mo5", response1Mo.clone()),
+    ]));
+}, "Pending cache operation on network process crash");
+</script>
+</body>
+</html>
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebCore/ChangeLog      2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -1,5 +1,47 @@
</span><span class="cx"> 2019-05-23  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><ins>+        CacheStorageConnection callbacks should be completed on network connection close
+        https://bugs.webkit.org/show_bug.cgi?id=195757
+
+        Reviewed by Alex Christensen.
+
+        Move HashMap-based callbacks to WorkerCacheStorageConnection.
+        Make CacheStorageConnection default API to implement use callbacks.
+        This is used by WebKit layer to do AsyncReply IPC.
+
+        Move DOMCacheEngine callbacks to CompletionHandler.
+
+        Test: http/wpt/cache-storage/cache-storage-networkprocess-crash.html
+
+        * Modules/cache/CacheStorageConnection.cpp:
+        * Modules/cache/CacheStorageConnection.h:
+        (WebCore::CacheStorageConnection::engineRepresentation):
+        * Modules/cache/DOMCacheEngine.h:
+        * Modules/cache/WorkerCacheStorageConnection.cpp:
+        (WebCore::recordsDataFromRecords):
+        (WebCore::recordsDataOrErrorFromRecords):
+        (WebCore::recordsFromRecordsData):
+        (WebCore::recordsOrErrorFromRecordsData):
+        (WebCore::WorkerCacheStorageConnection::open):
+        (WebCore::WorkerCacheStorageConnection::openOrRemoveCompleted):
+        (WebCore::WorkerCacheStorageConnection::remove):
+        (WebCore::WorkerCacheStorageConnection::retrieveCaches):
+        (WebCore::WorkerCacheStorageConnection::retrieveCachesCompleted):
+        (WebCore::WorkerCacheStorageConnection::retrieveRecords):
+        (WebCore::WorkerCacheStorageConnection::retrieveRecordsCompleted):
+        (WebCore::WorkerCacheStorageConnection::batchDeleteOperation):
+        (WebCore::WorkerCacheStorageConnection::deleteRecordsCompleted):
+        (WebCore::WorkerCacheStorageConnection::batchPutOperation):
+        (WebCore::WorkerCacheStorageConnection::putRecordsCompleted):
+        (WebCore::WorkerCacheStorageConnection::reference):
+        (WebCore::WorkerCacheStorageConnection::dereference):
+        (WebCore::WorkerCacheStorageConnection::clearPendingRequests):
+        * Modules/cache/WorkerCacheStorageConnection.h:
+        * page/CacheStorageProvider.h:
+        (WebCore::CacheStorageProvider::createCacheStorageConnection):
+
+2019-05-23  Youenn Fablet  <youenn@apple.com>
+
</ins><span class="cx">         Multiple videos (with audios) with autoplay & playinline not working. Only one video play at a time.
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=193312
</span><span class="cx">         <rdar://problem/47189864>
</span></span></pre></div>
<a id="trunkSourceWebCoreModulescacheCacheStorageConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/cache/CacheStorageConnection.cpp (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/cache/CacheStorageConnection.cpp    2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebCore/Modules/cache/CacheStorageConnection.cpp       2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -33,65 +33,6 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> using namespace WebCore::DOMCacheEngine;
</span><span class="cx"> 
</span><del>-void CacheStorageConnection::clearPendingRequests()
-{
-    auto openAndRemoveCachePendingRequests = WTFMove(m_openAndRemoveCachePendingRequests);
-    for (auto& callback : openAndRemoveCachePendingRequests.values())
-        callback(makeUnexpected(DOMCacheEngine::Error::Stopped));
-
-    auto retrieveCachesPendingRequests = WTFMove(m_retrieveCachesPendingRequests);
-    for (auto& callback : retrieveCachesPendingRequests.values())
-        callback(makeUnexpected(DOMCacheEngine::Error::Stopped));
-
-    auto retrieveRecordsPendingRequests = WTFMove(m_retrieveRecordsPendingRequests);
-    for (auto& callback : retrieveRecordsPendingRequests.values())
-        callback(makeUnexpected(DOMCacheEngine::Error::Stopped));
-
-    auto batchDeleteAndPutPendingRequests = WTFMove(m_batchDeleteAndPutPendingRequests);
-    for (auto& callback : batchDeleteAndPutPendingRequests.values())
-        callback(makeUnexpected(DOMCacheEngine::Error::Stopped));
-}
-
-void CacheStorageConnection::open(const ClientOrigin& origin, const String& cacheName, CacheIdentifierCallback&& callback)
-{
-    uint64_t requestIdentifier = ++m_lastRequestIdentifier;
-    m_openAndRemoveCachePendingRequests.add(requestIdentifier, WTFMove(callback));
-
-    doOpen(requestIdentifier, origin, cacheName);
-}
-
-void CacheStorageConnection::remove(uint64_t cacheIdentifier, CacheIdentifierCallback&& callback)
-{
-    uint64_t requestIdentifier = ++m_lastRequestIdentifier;
-    m_openAndRemoveCachePendingRequests.add(requestIdentifier, WTFMove(callback));
-
-    doRemove(requestIdentifier, cacheIdentifier);
-}
-
-void CacheStorageConnection::retrieveCaches(const ClientOrigin& origin, uint64_t updateCounter, CacheInfosCallback&& callback)
-{
-    uint64_t requestIdentifier = ++m_lastRequestIdentifier;
-    m_retrieveCachesPendingRequests.add(requestIdentifier, WTFMove(callback));
-
-    doRetrieveCaches(requestIdentifier, origin, updateCounter);
-}
-
-void CacheStorageConnection::retrieveRecords(uint64_t cacheIdentifier, const URL& url, RecordsCallback&& callback)
-{
-    uint64_t requestIdentifier = ++m_lastRequestIdentifier;
-    m_retrieveRecordsPendingRequests.add(requestIdentifier, WTFMove(callback));
-
-    doRetrieveRecords(requestIdentifier, cacheIdentifier, url);
-}
-
-void CacheStorageConnection::batchDeleteOperation(uint64_t cacheIdentifier, const ResourceRequest& request, CacheQueryOptions&& options, RecordIdentifiersCallback&& callback)
-{
-    uint64_t requestIdentifier = ++m_lastRequestIdentifier;
-    m_batchDeleteAndPutPendingRequests.add(requestIdentifier, WTFMove(callback));
-
-    doBatchDeleteOperation(requestIdentifier, cacheIdentifier, request, WTFMove(options));
-}
-
</del><span class="cx"> static inline uint64_t computeRealBodySize(const DOMCacheEngine::ResponseBody& body)
</span><span class="cx"> {
</span><span class="cx">     uint64_t result = 0;
</span><span class="lines">@@ -123,42 +64,4 @@
</span><span class="cx">     }).iterator->value;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CacheStorageConnection::batchPutOperation(uint64_t cacheIdentifier, Vector<Record>&& records, RecordIdentifiersCallback&& callback)
-{
-    uint64_t requestIdentifier = ++m_lastRequestIdentifier;
-    m_batchDeleteAndPutPendingRequests.add(requestIdentifier, WTFMove(callback));
-
-    doBatchPutOperation(requestIdentifier, cacheIdentifier, WTFMove(records));
-}
-
-void CacheStorageConnection::openOrRemoveCompleted(uint64_t requestIdentifier, const CacheIdentifierOrError& result)
-{
-    if (auto callback = m_openAndRemoveCachePendingRequests.take(requestIdentifier))
-        callback(result);
-}
-
-void CacheStorageConnection::updateCaches(uint64_t requestIdentifier, CacheInfosOrError&& result)
-{
-    if (auto callback = m_retrieveCachesPendingRequests.take(requestIdentifier))
-        callback(WTFMove(result));
-}
-
-void CacheStorageConnection::updateRecords(uint64_t requestIdentifier, RecordsOrError&& result)
-{
-    if (auto callback = m_retrieveRecordsPendingRequests.take(requestIdentifier))
-        callback(WTFMove(result));
-}
-
-void CacheStorageConnection::deleteRecordsCompleted(uint64_t requestIdentifier, Expected<Vector<uint64_t>, Error>&& result)
-{
-    if (auto callback = m_batchDeleteAndPutPendingRequests.take(requestIdentifier))
-        callback(WTFMove(result));
-}
-
-void CacheStorageConnection::putRecordsCompleted(uint64_t requestIdentifier, Expected<Vector<uint64_t>, Error>&& result)
-{
-    if (auto callback = m_batchDeleteAndPutPendingRequests.take(requestIdentifier))
-        callback(WTFMove(result));
-}
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulescacheCacheStorageConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/cache/CacheStorageConnection.h (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/cache/CacheStorageConnection.h      2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebCore/Modules/cache/CacheStorageConnection.h 2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -37,56 +37,27 @@
</span><span class="cx"> 
</span><span class="cx"> class CacheStorageConnection : public ThreadSafeRefCounted<CacheStorageConnection> {
</span><span class="cx"> public:
</span><del>-    static Ref<CacheStorageConnection> create() { return adoptRef(*new CacheStorageConnection()); }
</del><span class="cx">     virtual ~CacheStorageConnection() = default;
</span><span class="cx"> 
</span><del>-    void open(const ClientOrigin&, const String& cacheName, DOMCacheEngine::CacheIdentifierCallback&&);
-    void remove(uint64_t cacheIdentifier, DOMCacheEngine::CacheIdentifierCallback&&);
-    void retrieveCaches(const ClientOrigin&, uint64_t updateCounter, DOMCacheEngine::CacheInfosCallback&&);
</del><ins>+    virtual void open(const ClientOrigin&, const String& cacheName, DOMCacheEngine::CacheIdentifierCallback&&) = 0;
+    virtual void remove(uint64_t cacheIdentifier, DOMCacheEngine::CacheIdentifierCallback&&) = 0;
+    virtual void retrieveCaches(const ClientOrigin&, uint64_t updateCounter, DOMCacheEngine::CacheInfosCallback&&) = 0;
</ins><span class="cx"> 
</span><del>-    void retrieveRecords(uint64_t cacheIdentifier, const URL&, DOMCacheEngine::RecordsCallback&&);
-    void batchDeleteOperation(uint64_t cacheIdentifier, const ResourceRequest&, CacheQueryOptions&&, DOMCacheEngine::RecordIdentifiersCallback&&);
-    void batchPutOperation(uint64_t cacheIdentifier, Vector<DOMCacheEngine::Record>&&, DOMCacheEngine::RecordIdentifiersCallback&&);
</del><ins>+    virtual void retrieveRecords(uint64_t cacheIdentifier, const URL&, DOMCacheEngine::RecordsCallback&&) = 0;
+    virtual void batchDeleteOperation(uint64_t cacheIdentifier, const ResourceRequest&, CacheQueryOptions&&, DOMCacheEngine::RecordIdentifiersCallback&&) = 0;
+    virtual void batchPutOperation(uint64_t cacheIdentifier, Vector<DOMCacheEngine::Record>&&, DOMCacheEngine::RecordIdentifiersCallback&&) = 0;
+
+    virtual void reference(uint64_t /* cacheIdentifier */) = 0;
+    virtual void dereference(uint64_t /* cacheIdentifier */) = 0;
+
</ins><span class="cx">     uint64_t computeRecordBodySize(const FetchResponse&, const DOMCacheEngine::ResponseBody&);
</span><span class="cx"> 
</span><del>-    virtual void reference(uint64_t /* cacheIdentifier */) { }
-    virtual void dereference(uint64_t /* cacheIdentifier */) { }
-
</del><span class="cx">     // Used only for testing purposes.
</span><span class="cx">     virtual void clearMemoryRepresentation(const ClientOrigin&, DOMCacheEngine::CompletionCallback&& callback) { callback(DOMCacheEngine::Error::NotImplemented); }
</span><del>-    virtual void engineRepresentation(WTF::Function<void(const String&)>&& callback) { callback(String { }); }
</del><ins>+    virtual void engineRepresentation(CompletionHandler<void(const String&)>&& callback) { callback(String { }); }
</ins><span class="cx">     virtual void updateQuotaBasedOnSpaceUsage(const ClientOrigin&) { }
</span><span class="cx"> 
</span><del>-    void clearPendingRequests();
-
</del><span class="cx"> protected:
</span><del>-    CacheStorageConnection() =  default;
-
-    void openCompleted(uint64_t identifier, const DOMCacheEngine::CacheIdentifierOrError& result) { openOrRemoveCompleted(identifier, result); }
-    void removeCompleted(uint64_t identifier, const DOMCacheEngine::CacheIdentifierOrError& result) { openOrRemoveCompleted(identifier, result); }
-    WEBCORE_EXPORT void updateCaches(uint64_t requestIdentifier, DOMCacheEngine::CacheInfosOrError&&);
-
-    WEBCORE_EXPORT void updateRecords(uint64_t requestIdentifier, DOMCacheEngine::RecordsOrError&&);
-    WEBCORE_EXPORT void deleteRecordsCompleted(uint64_t requestIdentifier, DOMCacheEngine::RecordIdentifiersOrError&&);
-    WEBCORE_EXPORT void putRecordsCompleted(uint64_t requestIdentifier, DOMCacheEngine::RecordIdentifiersOrError&&);
-
-private:
-    virtual void doOpen(uint64_t requestIdentifier, const ClientOrigin&, const String& /* cacheName */) { openCompleted(requestIdentifier, makeUnexpected(DOMCacheEngine::Error::NotImplemented)); }
-    virtual void doRemove(uint64_t requestIdentifier, uint64_t /* cacheIdentifier */) { removeCompleted(requestIdentifier, makeUnexpected(DOMCacheEngine::Error::NotImplemented)); }
-    virtual void doRetrieveCaches(uint64_t requestIdentifier, const ClientOrigin&, uint64_t /* updateCounter */) { updateCaches(requestIdentifier, { }); }
-
-    virtual void doRetrieveRecords(uint64_t requestIdentifier, uint64_t /* cacheIdentifier */, const URL& /* url */) { updateRecords(requestIdentifier, { }); }
-    virtual void doBatchDeleteOperation(uint64_t requestIdentifier, uint64_t /* cacheIdentifier */, const ResourceRequest&, CacheQueryOptions&&) { deleteRecordsCompleted(requestIdentifier, makeUnexpected(DOMCacheEngine::Error::NotImplemented)); }
-    virtual void doBatchPutOperation(uint64_t requestIdentifier, uint64_t /* cacheIdentifier */, Vector<DOMCacheEngine::Record>&&) { putRecordsCompleted(requestIdentifier, makeUnexpected(DOMCacheEngine::Error::NotImplemented)); }
-
-    WEBCORE_EXPORT void openOrRemoveCompleted(uint64_t requestIdentifier, const DOMCacheEngine::CacheIdentifierOrError&);
-
-    HashMap<uint64_t, DOMCacheEngine::CacheIdentifierCallback> m_openAndRemoveCachePendingRequests;
-    HashMap<uint64_t, DOMCacheEngine::CacheInfosCallback> m_retrieveCachesPendingRequests;
-    HashMap<uint64_t, DOMCacheEngine::RecordsCallback> m_retrieveRecordsPendingRequests;
-    HashMap<uint64_t, DOMCacheEngine::RecordIdentifiersCallback> m_batchDeleteAndPutPendingRequests;
</del><span class="cx">     HashMap<uint64_t, uint64_t> m_opaqueResponseToSizeWithPaddingMap;
</span><del>-
-    uint64_t m_lastRequestIdentifier { 0 };
</del><span class="cx"> };
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulescacheDOMCacheEngineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/cache/DOMCacheEngine.h (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/cache/DOMCacheEngine.h      2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebCore/Modules/cache/DOMCacheEngine.h 2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include "ResourceResponse.h"
</span><span class="cx"> #include "ScriptExecutionContext.h"
</span><span class="cx"> #include "SharedBuffer.h"
</span><ins>+#include <wtf/CompletionHandler.h>
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -99,19 +100,19 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> using CacheIdentifierOrError = Expected<CacheIdentifierOperationResult, Error>;
</span><del>-using CacheIdentifierCallback = WTF::Function<void(const CacheIdentifierOrError&)>;
</del><ins>+using CacheIdentifierCallback = CompletionHandler<void(const CacheIdentifierOrError&)>;
</ins><span class="cx"> 
</span><span class="cx"> using RecordIdentifiersOrError = Expected<Vector<uint64_t>, Error>;
</span><del>-using RecordIdentifiersCallback = WTF::Function<void(RecordIdentifiersOrError&&)>;
</del><ins>+using RecordIdentifiersCallback = CompletionHandler<void(RecordIdentifiersOrError&&)>;
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> using CacheInfosOrError = Expected<CacheInfos, Error>;
</span><del>-using CacheInfosCallback = WTF::Function<void(CacheInfosOrError&&)>;
</del><ins>+using CacheInfosCallback = CompletionHandler<void(CacheInfosOrError&&)>;
</ins><span class="cx"> 
</span><span class="cx"> using RecordsOrError = Expected<Vector<Record>, Error>;
</span><del>-using RecordsCallback = WTF::Function<void(RecordsOrError&&)>;
</del><ins>+using RecordsCallback = CompletionHandler<void(RecordsOrError&&)>;
</ins><span class="cx"> 
</span><del>-using CompletionCallback = WTF::Function<void(Optional<Error>&&)>;
</del><ins>+using CompletionCallback = CompletionHandler<void(Optional<Error>&&)>;
</ins><span class="cx"> 
</span><span class="cx"> template<class Encoder> inline void CacheInfos::encode(Encoder& encoder) const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulescacheWorkerCacheStorageConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp      2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp 2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -88,6 +88,31 @@
</span><span class="cx">     };
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline Vector<CrossThreadRecordData> recordsDataFromRecords(const Vector<Record>& records)
+{
+    return WTF::map(records, toCrossThreadRecordData);
+}
+
+static inline Expected<Vector<CrossThreadRecordData>, Error> recordsDataOrErrorFromRecords(const RecordsOrError& result)
+{
+    if (!result.has_value())
+        return makeUnexpected(result.error());
+
+    return recordsDataFromRecords(result.value());
+}
+
+static inline Vector<Record> recordsFromRecordsData(Vector<CrossThreadRecordData>&& recordsData)
+{
+    return WTF::map(WTFMove(recordsData), fromCrossThreadRecordData);
+}
+
+static inline RecordsOrError recordsOrErrorFromRecordsData(Expected<Vector<CrossThreadRecordData>, Error>&& recordsData)
+{
+    if (!recordsData.has_value())
+        return makeUnexpected(recordsData.error());
+    return recordsFromRecordsData(WTFMove(recordsData.value()));
+}
+
</ins><span class="cx"> Ref<WorkerCacheStorageConnection> WorkerCacheStorageConnection::create(WorkerGlobalScope& scope)
</span><span class="cx"> {
</span><span class="cx">     auto connection = adoptRef(*new WorkerCacheStorageConnection(scope));
</span><span class="lines">@@ -109,31 +134,46 @@
</span><span class="cx">         callOnMainThread([mainThreadConnection = WTFMove(m_mainThreadConnection)]() mutable { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WorkerCacheStorageConnection::doOpen(uint64_t requestIdentifier, const ClientOrigin& origin, const String& cacheName)
</del><ins>+void WorkerCacheStorageConnection::open(const ClientOrigin& origin, const String& cacheName, CacheIdentifierCallback&& callback)
</ins><span class="cx"> {
</span><ins>+    uint64_t requestIdentifier = ++m_lastRequestIdentifier;
+    m_openAndRemoveCachePendingRequests.add(requestIdentifier, WTFMove(callback));
+
</ins><span class="cx">     callOnMainThread([workerThread = makeRef(m_scope.thread()), mainThreadConnection = m_mainThreadConnection, requestIdentifier, origin = origin.isolatedCopy(), cacheName = cacheName.isolatedCopy()] () mutable {
</span><span class="cx">         mainThreadConnection->open(origin, cacheName, [workerThread = WTFMove(workerThread), requestIdentifier] (const CacheIdentifierOrError& result) mutable {
</span><span class="cx">             workerThread->runLoop().postTaskForMode([requestIdentifier, result] (auto& scope) mutable {
</span><del>-                downcast<WorkerGlobalScope>(scope).cacheStorageConnection().openCompleted(requestIdentifier, result);
</del><ins>+                downcast<WorkerGlobalScope>(scope).cacheStorageConnection().openOrRemoveCompleted(requestIdentifier, result);
</ins><span class="cx">             }, WorkerRunLoop::defaultMode());
</span><span class="cx">         });
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WorkerCacheStorageConnection::doRemove(uint64_t requestIdentifier, uint64_t cacheIdentifier)
</del><ins>+void WorkerCacheStorageConnection::openOrRemoveCompleted(uint64_t requestIdentifier, const CacheIdentifierOrError& result)
</ins><span class="cx"> {
</span><ins>+    if (auto callback = m_openAndRemoveCachePendingRequests.take(requestIdentifier))
+        callback(result);
+}
+
+void WorkerCacheStorageConnection::remove(uint64_t cacheIdentifier, CacheIdentifierCallback&& callback)
+{
+    uint64_t requestIdentifier = ++m_lastRequestIdentifier;
+    m_openAndRemoveCachePendingRequests.add(requestIdentifier, WTFMove(callback));
+
</ins><span class="cx">     callOnMainThread([workerThread = makeRef(m_scope.thread()), mainThreadConnection = m_mainThreadConnection, requestIdentifier, cacheIdentifier] () mutable {
</span><span class="cx">         mainThreadConnection->remove(cacheIdentifier, [workerThread = WTFMove(workerThread), requestIdentifier, cacheIdentifier] (const CacheIdentifierOrError& result) mutable {
</span><span class="cx">             ASSERT_UNUSED(cacheIdentifier, !result.has_value() || !result.value().identifier || result.value().identifier == cacheIdentifier);
</span><span class="cx">             workerThread->runLoop().postTaskForMode([requestIdentifier, result] (auto& scope) mutable {
</span><del>-                downcast<WorkerGlobalScope>(scope).cacheStorageConnection().removeCompleted(requestIdentifier, result);
</del><ins>+                downcast<WorkerGlobalScope>(scope).cacheStorageConnection().openOrRemoveCompleted(requestIdentifier, result);
</ins><span class="cx">             }, WorkerRunLoop::defaultMode());
</span><span class="cx">         });
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WorkerCacheStorageConnection::doRetrieveCaches(uint64_t requestIdentifier, const ClientOrigin& origin, uint64_t updateCounter)
</del><ins>+void WorkerCacheStorageConnection::retrieveCaches(const ClientOrigin& origin, uint64_t updateCounter, CacheInfosCallback&& callback)
</ins><span class="cx"> {
</span><ins>+    uint64_t requestIdentifier = ++m_lastRequestIdentifier;
+    m_retrieveCachesPendingRequests.add(requestIdentifier, WTFMove(callback));
+
</ins><span class="cx">     callOnMainThread([workerThread = makeRef(m_scope.thread()), mainThreadConnection = m_mainThreadConnection, requestIdentifier, origin = origin.isolatedCopy(), updateCounter] () mutable {
</span><span class="cx">         mainThreadConnection->retrieveCaches(origin, updateCounter, [workerThread = WTFMove(workerThread), requestIdentifier] (CacheInfosOrError&& result) mutable {
</span><span class="cx">             CacheInfosOrError isolatedResult;
</span><span class="lines">@@ -143,64 +183,43 @@
</span><span class="cx">                 isolatedResult = result.value().isolatedCopy();
</span><span class="cx"> 
</span><span class="cx">             workerThread->runLoop().postTaskForMode([requestIdentifier, result = WTFMove(isolatedResult)] (auto& scope) mutable {
</span><del>-                downcast<WorkerGlobalScope>(scope).cacheStorageConnection().updateCaches(requestIdentifier, WTFMove(result));
</del><ins>+                downcast<WorkerGlobalScope>(scope).cacheStorageConnection().retrieveCachesCompleted(requestIdentifier, WTFMove(result));
</ins><span class="cx">             }, WorkerRunLoop::defaultMode());
</span><span class="cx">         });
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WorkerCacheStorageConnection::reference(uint64_t cacheIdentifier)
</del><ins>+void WorkerCacheStorageConnection::retrieveCachesCompleted(uint64_t requestIdentifier, CacheInfosOrError&& result)
</ins><span class="cx"> {
</span><del>-    callOnMainThread([mainThreadConnection = m_mainThreadConnection, cacheIdentifier]() {
-        mainThreadConnection->reference(cacheIdentifier);
-    });
</del><ins>+    if (auto callback = m_retrieveCachesPendingRequests.take(requestIdentifier))
+        callback(WTFMove(result));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WorkerCacheStorageConnection::dereference(uint64_t cacheIdentifier)
</del><ins>+void WorkerCacheStorageConnection::retrieveRecords(uint64_t cacheIdentifier, const URL& url, RecordsCallback&& callback)
</ins><span class="cx"> {
</span><del>-    callOnMainThread([mainThreadConnection = m_mainThreadConnection, cacheIdentifier]() {
-        mainThreadConnection->dereference(cacheIdentifier);
-    });
-}
</del><ins>+    uint64_t requestIdentifier = ++m_lastRequestIdentifier;
+    m_retrieveRecordsPendingRequests.add(requestIdentifier, WTFMove(callback));
</ins><span class="cx"> 
</span><del>-static inline Vector<CrossThreadRecordData> recordsDataFromRecords(const Vector<Record>& records)
-{
-    return WTF::map(records, toCrossThreadRecordData);
-}
-
-static inline Expected<Vector<CrossThreadRecordData>, Error> recordsDataOrErrorFromRecords(const RecordsOrError& result)
-{
-    if (!result.has_value())
-        return makeUnexpected(result.error());
-
-    return recordsDataFromRecords(result.value());
-}
-
-static inline Vector<Record> recordsFromRecordsData(Vector<CrossThreadRecordData>&& recordsData)
-{
-    return WTF::map(WTFMove(recordsData), fromCrossThreadRecordData);
-}
-
-static inline RecordsOrError recordsOrErrorFromRecordsData(Expected<Vector<CrossThreadRecordData>, Error>&& recordsData)
-{
-    if (!recordsData.has_value())
-        return makeUnexpected(recordsData.error());
-    return recordsFromRecordsData(WTFMove(recordsData.value()));
-}
-
-void WorkerCacheStorageConnection::doRetrieveRecords(uint64_t requestIdentifier, uint64_t cacheIdentifier, const URL& url)
-{
</del><span class="cx">     callOnMainThread([workerThread = makeRef(m_scope.thread()), mainThreadConnection = m_mainThreadConnection, requestIdentifier, cacheIdentifier, url = url.isolatedCopy()]() mutable {
</span><span class="cx">         mainThreadConnection->retrieveRecords(cacheIdentifier, url, [workerThread = WTFMove(workerThread), requestIdentifier](RecordsOrError&& result) mutable {
</span><span class="cx">             workerThread->runLoop().postTaskForMode([result = recordsDataOrErrorFromRecords(result), requestIdentifier] (auto& scope) mutable {
</span><del>-                downcast<WorkerGlobalScope>(scope).cacheStorageConnection().updateRecords(requestIdentifier, recordsOrErrorFromRecordsData(WTFMove(result)));
</del><ins>+                downcast<WorkerGlobalScope>(scope).cacheStorageConnection().retrieveRecordsCompleted(requestIdentifier, recordsOrErrorFromRecordsData(WTFMove(result)));
</ins><span class="cx">             }, WorkerRunLoop::defaultMode());
</span><span class="cx">         });
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WorkerCacheStorageConnection::doBatchDeleteOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, const ResourceRequest& request, CacheQueryOptions&& options)
</del><ins>+void WorkerCacheStorageConnection::retrieveRecordsCompleted(uint64_t requestIdentifier, RecordsOrError&& result)
</ins><span class="cx"> {
</span><ins>+    if (auto callback = m_retrieveRecordsPendingRequests.take(requestIdentifier))
+        callback(WTFMove(result));
+}
+
+void WorkerCacheStorageConnection::batchDeleteOperation(uint64_t cacheIdentifier, const ResourceRequest& request, CacheQueryOptions&& options, RecordIdentifiersCallback&& callback)
+{
+    uint64_t requestIdentifier = ++m_lastRequestIdentifier;
+    m_batchDeleteAndPutPendingRequests.add(requestIdentifier, WTFMove(callback));
+
</ins><span class="cx">     callOnMainThread([workerThread = makeRef(m_scope.thread()), mainThreadConnection = m_mainThreadConnection, requestIdentifier, cacheIdentifier, request = request.isolatedCopy(), options = options.isolatedCopy()]() mutable {
</span><span class="cx">         mainThreadConnection->batchDeleteOperation(cacheIdentifier, request, WTFMove(options), [workerThread = WTFMove(workerThread), requestIdentifier](RecordIdentifiersOrError&& result) mutable {
</span><span class="cx">             workerThread->runLoop().postTaskForMode([requestIdentifier, result = WTFMove(result)] (auto& scope) mutable {
</span><span class="lines">@@ -210,8 +229,17 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WorkerCacheStorageConnection::doBatchPutOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<Record>&& records)
</del><ins>+void WorkerCacheStorageConnection::deleteRecordsCompleted(uint64_t requestIdentifier, Expected<Vector<uint64_t>, Error>&& result)
</ins><span class="cx"> {
</span><ins>+    if (auto callback = m_batchDeleteAndPutPendingRequests.take(requestIdentifier))
+        callback(WTFMove(result));
+}
+
+void WorkerCacheStorageConnection::batchPutOperation(uint64_t cacheIdentifier, Vector<DOMCacheEngine::Record>&& records, DOMCacheEngine::RecordIdentifiersCallback&& callback)
+{
+    uint64_t requestIdentifier = ++m_lastRequestIdentifier;
+    m_batchDeleteAndPutPendingRequests.add(requestIdentifier, WTFMove(callback));
+
</ins><span class="cx">     callOnMainThread([workerThread = makeRef(m_scope.thread()), mainThreadConnection = m_mainThreadConnection, requestIdentifier, cacheIdentifier, recordsData = recordsDataFromRecords(records)]() mutable {
</span><span class="cx">         mainThreadConnection->batchPutOperation(cacheIdentifier, recordsFromRecordsData(WTFMove(recordsData)), [workerThread = WTFMove(workerThread), requestIdentifier] (RecordIdentifiersOrError&& result) mutable {
</span><span class="cx">             workerThread->runLoop().postTaskForMode([requestIdentifier, result = WTFMove(result)] (auto& scope) mutable {
</span><span class="lines">@@ -221,4 +249,43 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WorkerCacheStorageConnection::putRecordsCompleted(uint64_t requestIdentifier, Expected<Vector<uint64_t>, Error>&& result)
+{
+    if (auto callback = m_batchDeleteAndPutPendingRequests.take(requestIdentifier))
+        callback(WTFMove(result));
+}
+
+void WorkerCacheStorageConnection::reference(uint64_t cacheIdentifier)
+{
+    callOnMainThread([mainThreadConnection = m_mainThreadConnection, cacheIdentifier]() {
+        mainThreadConnection->reference(cacheIdentifier);
+    });
+}
+
+void WorkerCacheStorageConnection::dereference(uint64_t cacheIdentifier)
+{
+    callOnMainThread([mainThreadConnection = m_mainThreadConnection, cacheIdentifier]() {
+        mainThreadConnection->dereference(cacheIdentifier);
+    });
+}
+
+void WorkerCacheStorageConnection::clearPendingRequests()
+{
+    auto openAndRemoveCachePendingRequests = WTFMove(m_openAndRemoveCachePendingRequests);
+    for (auto& callback : openAndRemoveCachePendingRequests.values())
+        callback(makeUnexpected(DOMCacheEngine::Error::Stopped));
+
+    auto retrieveCachesPendingRequests = WTFMove(m_retrieveCachesPendingRequests);
+    for (auto& callback : retrieveCachesPendingRequests.values())
+        callback(makeUnexpected(DOMCacheEngine::Error::Stopped));
+
+    auto retrieveRecordsPendingRequests = WTFMove(m_retrieveRecordsPendingRequests);
+    for (auto& callback : retrieveRecordsPendingRequests.values())
+        callback(makeUnexpected(DOMCacheEngine::Error::Stopped));
+
+    auto batchDeleteAndPutPendingRequests = WTFMove(m_batchDeleteAndPutPendingRequests);
+    for (auto& callback : batchDeleteAndPutPendingRequests.values())
+        callback(makeUnexpected(DOMCacheEngine::Error::Stopped));
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulescacheWorkerCacheStorageConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/cache/WorkerCacheStorageConnection.h (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/cache/WorkerCacheStorageConnection.h        2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebCore/Modules/cache/WorkerCacheStorageConnection.h   2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -38,25 +38,46 @@
</span><span class="cx">     static Ref<WorkerCacheStorageConnection> create(WorkerGlobalScope&);
</span><span class="cx">     ~WorkerCacheStorageConnection();
</span><span class="cx"> 
</span><ins>+    void clearPendingRequests();
+
</ins><span class="cx"> private:
</span><span class="cx">     explicit WorkerCacheStorageConnection(WorkerGlobalScope&);
</span><span class="cx"> 
</span><span class="cx">     // WebCore::CacheStorageConnection.
</span><del>-    void doOpen(uint64_t requestIdentifier, const ClientOrigin&, const String& cacheName) final;
-    void doRemove(uint64_t requestIdentifier, uint64_t cacheIdentifier) final;
-    void doRetrieveCaches(uint64_t requestIdentifier, const ClientOrigin&, uint64_t updateCounter) final;
</del><ins>+    void open(const ClientOrigin&, const String& cacheName, DOMCacheEngine::CacheIdentifierCallback&&) final;
+    void remove(uint64_t cacheIdentifier, DOMCacheEngine::CacheIdentifierCallback&&) final;
+    void retrieveCaches(const ClientOrigin&, uint64_t updateCounter, DOMCacheEngine::CacheInfosCallback&&) final;
</ins><span class="cx"> 
</span><del>-    void doRetrieveRecords(uint64_t requestIdentifier, uint64_t cacheIdentifier, const URL&) final;
</del><ins>+    void retrieveRecords(uint64_t cacheIdentifier, const URL&, DOMCacheEngine::RecordsCallback&&) final;
+    void batchDeleteOperation(uint64_t cacheIdentifier, const ResourceRequest&, CacheQueryOptions&&, DOMCacheEngine::RecordIdentifiersCallback&&) final;
+    void batchPutOperation(uint64_t cacheIdentifier, Vector<DOMCacheEngine::Record>&&, DOMCacheEngine::RecordIdentifiersCallback&&) final;
</ins><span class="cx"> 
</span><span class="cx">     void reference(uint64_t cacheIdentifier) final;
</span><span class="cx">     void dereference(uint64_t cacheIdentifier) final;
</span><span class="cx"> 
</span><del>-    void doBatchDeleteOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, const WebCore::ResourceRequest&, WebCore::CacheQueryOptions&&) final;
-    void doBatchPutOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<DOMCacheEngine::Record>&&) final;
</del><ins>+    void doOpen(uint64_t requestIdentifier, const ClientOrigin&, const String& cacheName);
+    void doRemove(uint64_t requestIdentifier, uint64_t cacheIdentifier);
+    void doRetrieveCaches(uint64_t requestIdentifier, const ClientOrigin&, uint64_t updateCounter);
+    void doRetrieveRecords(uint64_t requestIdentifier, uint64_t cacheIdentifier, const URL&);
+    void doBatchDeleteOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, const WebCore::ResourceRequest&, WebCore::CacheQueryOptions&&);
+    void doBatchPutOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<DOMCacheEngine::Record>&&);
</ins><span class="cx"> 
</span><ins>+    void openOrRemoveCompleted(uint64_t requestIdentifier, const DOMCacheEngine::CacheIdentifierOrError&);
+    void retrieveCachesCompleted(uint64_t requestIdentifier, DOMCacheEngine::CacheInfosOrError&&);
+    void retrieveRecordsCompleted(uint64_t requestIdentifier, DOMCacheEngine::RecordsOrError&&);
+    void deleteRecordsCompleted(uint64_t requestIdentifier, DOMCacheEngine::RecordIdentifiersOrError&&);
+    void putRecordsCompleted(uint64_t requestIdentifier, DOMCacheEngine::RecordIdentifiersOrError&&);
+
</ins><span class="cx">     WorkerGlobalScope& m_scope;
</span><span class="cx"> 
</span><span class="cx">     RefPtr<CacheStorageConnection> m_mainThreadConnection;
</span><ins>+
+    HashMap<uint64_t, DOMCacheEngine::CacheIdentifierCallback> m_openAndRemoveCachePendingRequests;
+    HashMap<uint64_t, DOMCacheEngine::CacheInfosCallback> m_retrieveCachesPendingRequests;
+    HashMap<uint64_t, DOMCacheEngine::RecordsCallback> m_retrieveRecordsPendingRequests;
+    HashMap<uint64_t, DOMCacheEngine::RecordIdentifiersCallback> m_batchDeleteAndPutPendingRequests;
+
+    uint64_t m_lastRequestIdentifier { 0 };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepageCacheStorageProviderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/CacheStorageProvider.h (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/CacheStorageProvider.h 2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebCore/page/CacheStorageProvider.h    2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -33,8 +33,23 @@
</span><span class="cx"> 
</span><span class="cx"> class CacheStorageProvider : public RefCounted<CacheStorageProvider> {
</span><span class="cx"> public:
</span><ins>+    class DummyCacheStorageConnection final : public WebCore::CacheStorageConnection {
+    public:
+        static Ref<DummyCacheStorageConnection> create() { return adoptRef(*new DummyCacheStorageConnection); }
+
+    private:
+        void open(const ClientOrigin&, const String&, DOMCacheEngine::CacheIdentifierCallback&&) final { }
+        void remove(uint64_t, DOMCacheEngine::CacheIdentifierCallback&&) final { }
+        void retrieveCaches(const ClientOrigin&, uint64_t, DOMCacheEngine::CacheInfosCallback&&) final { }
+        void retrieveRecords(uint64_t, const URL&, DOMCacheEngine::RecordsCallback&&) final { }
+        void batchDeleteOperation(uint64_t, const ResourceRequest&, CacheQueryOptions&&, DOMCacheEngine::RecordIdentifiersCallback&&) final { }
+        void batchPutOperation(uint64_t, Vector<DOMCacheEngine::Record>&&, DOMCacheEngine::RecordIdentifiersCallback&&) final { }
+        void reference(uint64_t) final { }
+        void dereference(uint64_t) final { }
+    };
+
</ins><span class="cx">     static Ref<CacheStorageProvider> create() { return adoptRef(*new CacheStorageProvider); }
</span><del>-    virtual Ref<CacheStorageConnection> createCacheStorageConnection(PAL::SessionID) { return CacheStorageConnection::create(); }
</del><ins>+    virtual Ref<CacheStorageConnection> createCacheStorageConnection(PAL::SessionID) { return DummyCacheStorageConnection::create(); }
</ins><span class="cx">     virtual ~CacheStorageProvider() { };
</span><span class="cx"> 
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebKitCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/CMakeLists.txt (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/CMakeLists.txt       2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/CMakeLists.txt  2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -163,8 +163,6 @@
</span><span class="cx"> 
</span><span class="cx">     WebProcess/Automation/WebAutomationSessionProxy.messages.in
</span><span class="cx"> 
</span><del>-    WebProcess/Cache/WebCacheStorageConnection.messages.in
-
</del><span class="cx">     WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in
</span><span class="cx"> 
</span><span class="cx">     WebProcess/FullScreen/WebFullScreenManager.messages.in
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/ChangeLog       2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -1,3 +1,55 @@
</span><ins>+2019-05-23  Youenn Fablet  <youenn@apple.com>
+
+        CacheStorageConnection callbacks should be completed on network connection close
+        https://bugs.webkit.org/show_bug.cgi?id=195757
+
+        Reviewed by Alex Christensen.
+
+        Update according new WebCore CacheStorageConnection interface.
+        Use Async IPC replies so that the completion handlers are called on network crash.
+
+        Allow to have specific error handling in case of cancelled reply or badly decoded message.
+        This allows to reject the corresponding JS promise.
+
+        * CMakeLists.txt:
+        * DerivedSources-output.xcfilelist:
+        * DerivedSources.make:
+        * NetworkProcess/cache/CacheStorageEngine.cpp:
+        (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
+        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
+        (WebKit::CacheStorage::Caches::requestSpace):
+        (WebKit::CacheStorage::Caches::writeRecord):
+        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
+        (WebKit::CacheStorageEngineConnection::open):
+        (WebKit::CacheStorageEngineConnection::remove):
+        (WebKit::CacheStorageEngineConnection::caches):
+        (WebKit::CacheStorageEngineConnection::retrieveRecords):
+        (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
+        (WebKit::CacheStorageEngineConnection::putRecords):
+        * NetworkProcess/cache/CacheStorageEngineConnection.h:
+        (IPC::AsyncReplyError<WebCore::DOMCacheEngine::CacheIdentifierOrError>::create):
+        (IPC::AsyncReplyError<WebCore::DOMCacheEngine::RecordIdentifiersOrError>::create):
+        (IPC::AsyncReplyError<WebCore::DOMCacheEngine::CacheInfosOrError>::create):
+        (IPC::AsyncReplyError<WebCore::DOMCacheEngine::RecordsOrError>::create):
+        * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
+        * Platform/IPC/ArgumentCoders.h:
+        * Platform/IPC/Connection.h:
+        (IPC::AsyncReplyError::create):
+        * Scripts/webkit/messages.py:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/Cache/WebCacheStorageConnection.cpp:
+        (WebKit::WebCacheStorageConnection::open):
+        (WebKit::WebCacheStorageConnection::remove):
+        (WebKit::WebCacheStorageConnection::retrieveCaches):
+        (WebKit::WebCacheStorageConnection::retrieveRecords):
+        (WebKit::WebCacheStorageConnection::batchDeleteOperation):
+        (WebKit::WebCacheStorageConnection::batchPutOperation):
+        (WebKit::WebCacheStorageConnection::engineRepresentation):
+        * WebProcess/Cache/WebCacheStorageConnection.h:
+        * WebProcess/Cache/WebCacheStorageConnection.messages.in: Removed.
+        * WebProcess/Network/NetworkProcessConnection.cpp:
+        (WebKit::NetworkProcessConnection::didReceiveMessage):
+
</ins><span class="cx"> 2019-05-23  Sihui Liu  <sihui_liu@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Handling for non-persistent data should be consistent in computeNetworkProcessAccessTypeForDataFetch
</span></span></pre></div>
<a id="trunkSourceWebKitDerivedSourcesoutputxcfilelist"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/DerivedSources-output.xcfilelist (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/DerivedSources-output.xcfilelist     2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/DerivedSources-output.xcfilelist        2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -117,7 +117,6 @@
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/WebAutomationSessionProxyMessageReceiver.cpp
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/WebAutomationSessionProxyMessages.h
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/WebAutomationSessionProxyScriptSource.h
</span><del>-$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/WebCacheStorageConnectionMessageReceiver.cpp
</del><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/WebCacheStorageConnectionMessages.h
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/WebConnectionMessageReceiver.cpp
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/WebConnectionMessages.h
</span></span></pre></div>
<a id="trunkSourceWebKitDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/DerivedSources.make (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/DerivedSources.make  2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/DerivedSources.make     2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -150,7 +150,6 @@
</span><span class="cx">     WebAuthenticatorCoordinatorProxy \
</span><span class="cx">     WebAutomationSession \
</span><span class="cx">     WebAutomationSessionProxy \
</span><del>-    WebCacheStorageConnection \
</del><span class="cx">     WebConnection \
</span><span class="cx">     WebCookieManager \
</span><span class="cx">     WebCookieManagerProxy \
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesscacheCacheStorageEnginecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp  2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp     2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -600,7 +600,7 @@
</span><span class="cx"> 
</span><span class="cx"> void Engine::clearMemoryRepresentation(const WebCore::ClientOrigin& origin, WebCore::DOMCacheEngine::CompletionCallback&& callback)
</span><span class="cx"> {
</span><del>-    readCachesFromDisk(origin, [callback = WTFMove(callback)](CachesOrError&& result) {
</del><ins>+    readCachesFromDisk(origin, [callback = WTFMove(callback)](CachesOrError&& result) mutable {
</ins><span class="cx">         if (!result.has_value()) {
</span><span class="cx">             callback(result.error());
</span><span class="cx">             return;
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesscacheCacheStorageEngineCachescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp    2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp       2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -515,7 +515,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_quotaManager->requestSpace(spaceRequired, [callback = WTFMove(callback)](auto decision) {
</del><ins>+    m_quotaManager->requestSpace(spaceRequired, [callback = WTFMove(callback)](auto decision) mutable {
</ins><span class="cx">         switch (decision) {
</span><span class="cx">         case WebCore::StorageQuotaManager::Decision::Deny:
</span><span class="cx">             callback(Error::QuotaExceeded);
</span><span class="lines">@@ -540,7 +540,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_storage->store(Cache::encode(recordInformation, record), { }, [protectedStorage = makeRef(*m_storage), callback = WTFMove(callback)](int error) {
</del><ins>+    m_storage->store(Cache::encode(recordInformation, record), { }, [protectedStorage = makeRef(*m_storage), callback = WTFMove(callback)](int error) mutable {
</ins><span class="cx">         if (error) {
</span><span class="cx">             RELEASE_LOG_ERROR(CacheStorage, "Caches::writeRecord failed with error %d", error);
</span><span class="cx">             callback(Error::WriteDisk);
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesscacheCacheStorageEngineConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp        2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp   2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "NetworkConnectionToWebProcess.h"
</span><del>-#include "WebCacheStorageConnectionMessages.h"
</del><span class="cx"> #include "WebCoreArgumentCoders.h"
</span><span class="cx"> #include <WebCore/CacheQueryOptions.h>
</span><span class="cx"> 
</span><span class="lines">@@ -41,11 +40,11 @@
</span><span class="cx"> #define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), CacheStorage, "%p - CacheStorageEngineConnection::" fmt, &m_connection.connection(), ##__VA_ARGS__)
</span><span class="cx"> #define RELEASE_LOG_FUNCTION_IF_ALLOWED_IN_CALLBACK(functionName, fmt, resultGetter) \
</span><span class="cx">     if (!result.has_value())\
</span><del>-        RELEASE_LOG_ERROR_IF(sessionID.isAlwaysOnLoggingAllowed(), CacheStorage, "%p - CacheStorageEngineConnection::%s (%" PRIu64 ") - failed - error %d", connection.ptr(), functionName, requestIdentifier, (int)result.error()); \
</del><ins>+        RELEASE_LOG_ERROR_IF(sessionID.isAlwaysOnLoggingAllowed(), CacheStorage, "CacheStorageEngineConnection::%s - failed - error %d", functionName, (int)result.error()); \
</ins><span class="cx">     else {\
</span><span class="cx">         auto value = resultGetter(result.value()); \
</span><span class="cx">         UNUSED_PARAM(value); \
</span><del>-        RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), CacheStorage, "%p - CacheStorageEngineConnection::%s (%" PRIu64 ") - succeeded - " fmt, connection.ptr(), functionName, requestIdentifier, value); \
</del><ins>+        RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), CacheStorage, "CacheStorageEngineConnection::%s - succeeded - " fmt, functionName, value); \
</ins><span class="cx">     }
</span><span class="cx"> CacheStorageEngineConnection::CacheStorageEngineConnection(NetworkConnectionToWebProcess& connection)
</span><span class="cx">     : m_connection(connection)
</span><span class="lines">@@ -63,57 +62,57 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CacheStorageEngineConnection::open(PAL::SessionID sessionID, uint64_t requestIdentifier, WebCore::ClientOrigin&& origin, String&& cacheName)
</del><ins>+void CacheStorageEngineConnection::open(PAL::SessionID sessionID, WebCore::ClientOrigin&& origin, String&& cacheName, CacheIdentifierCallback&& callback)
</ins><span class="cx"> {
</span><del>-    RELEASE_LOG_IF_ALLOWED("open (%" PRIu64 ")", requestIdentifier);
-    Engine::open(m_connection.networkProcess(), sessionID, WTFMove(origin), WTFMove(cacheName), [connection = makeRef(m_connection.connection()), sessionID, requestIdentifier](const CacheIdentifierOrError& result) {
</del><ins>+    RELEASE_LOG_IF_ALLOWED("open cache");
+    Engine::open(m_connection.networkProcess(), sessionID, WTFMove(origin), WTFMove(cacheName), [callback = WTFMove(callback), sessionID](auto& result) mutable {
</ins><span class="cx">         RELEASE_LOG_FUNCTION_IF_ALLOWED_IN_CALLBACK("open", "cache identifier is %" PRIu64, [](const auto& value) { return value.identifier; });
</span><del>-        connection->send(Messages::WebCacheStorageConnection::OpenCompleted(requestIdentifier, result), sessionID.sessionID());
</del><ins>+        callback(result);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CacheStorageEngineConnection::remove(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier)
</del><ins>+void CacheStorageEngineConnection::remove(PAL::SessionID sessionID, uint64_t cacheIdentifier, CacheIdentifierCallback&& callback)
</ins><span class="cx"> {
</span><del>-    RELEASE_LOG_IF_ALLOWED("remove (%" PRIu64 ") cache %" PRIu64, requestIdentifier, cacheIdentifier);
-    Engine::remove(m_connection.networkProcess(), sessionID, cacheIdentifier, [connection = makeRef(m_connection.connection()), sessionID, requestIdentifier](const CacheIdentifierOrError& result) {
</del><ins>+    RELEASE_LOG_IF_ALLOWED("remove cache %" PRIu64, cacheIdentifier);
+    Engine::remove(m_connection.networkProcess(), sessionID, cacheIdentifier, [callback = WTFMove(callback), sessionID](auto& result) mutable {
</ins><span class="cx">         RELEASE_LOG_FUNCTION_IF_ALLOWED_IN_CALLBACK("remove", "removed cache %" PRIu64, [](const auto& value) { return value.identifier; });
</span><del>-        connection->send(Messages::WebCacheStorageConnection::RemoveCompleted(requestIdentifier, result), sessionID.sessionID());
</del><ins>+        callback(result);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CacheStorageEngineConnection::caches(PAL::SessionID sessionID, uint64_t requestIdentifier, WebCore::ClientOrigin&& origin, uint64_t updateCounter)
</del><ins>+void CacheStorageEngineConnection::caches(PAL::SessionID sessionID, WebCore::ClientOrigin&& origin, uint64_t updateCounter, CacheInfosCallback&& callback)
</ins><span class="cx"> {
</span><del>-    RELEASE_LOG_IF_ALLOWED("caches (%" PRIu64 ")", requestIdentifier);
-    Engine::retrieveCaches(m_connection.networkProcess(), sessionID, WTFMove(origin), updateCounter, [connection = makeRef(m_connection.connection()), sessionID, origin, requestIdentifier](CacheInfosOrError&& result) {
</del><ins>+    RELEASE_LOG_IF_ALLOWED("caches");
+    Engine::retrieveCaches(m_connection.networkProcess(), sessionID, WTFMove(origin), updateCounter, [callback = WTFMove(callback), sessionID, origin](auto&& result) mutable {
</ins><span class="cx">         RELEASE_LOG_FUNCTION_IF_ALLOWED_IN_CALLBACK("caches", "caches size is %lu", [](const auto& value) { return value.infos.size(); });
</span><del>-        connection->send(Messages::WebCacheStorageConnection::UpdateCaches(requestIdentifier, result), sessionID.sessionID());
</del><ins>+        callback(WTFMove(result));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CacheStorageEngineConnection::retrieveRecords(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, URL&& url)
</del><ins>+void CacheStorageEngineConnection::retrieveRecords(PAL::SessionID sessionID, uint64_t cacheIdentifier, URL&& url, RecordsCallback&& callback)
</ins><span class="cx"> {
</span><del>-    RELEASE_LOG_IF_ALLOWED("retrieveRecords (%" PRIu64 ") in cache %" PRIu64, requestIdentifier, cacheIdentifier);
-    Engine::retrieveRecords(m_connection.networkProcess(), sessionID, cacheIdentifier, WTFMove(url), [connection = makeRef(m_connection.connection()), sessionID, requestIdentifier](RecordsOrError&& result) {
</del><ins>+    RELEASE_LOG_IF_ALLOWED("retrieveRecords in cache %" PRIu64, cacheIdentifier);
+    Engine::retrieveRecords(m_connection.networkProcess(), sessionID, cacheIdentifier, WTFMove(url), [callback = WTFMove(callback), sessionID](auto&& result) mutable {
</ins><span class="cx">         RELEASE_LOG_FUNCTION_IF_ALLOWED_IN_CALLBACK("retrieveRecords", "records size is %lu", [](const auto& value) { return value.size(); });
</span><del>-        connection->send(Messages::WebCacheStorageConnection::UpdateRecords(requestIdentifier, result), sessionID.sessionID());
</del><ins>+        callback(WTFMove(result));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CacheStorageEngineConnection::deleteMatchingRecords(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, WebCore::ResourceRequest&& request, WebCore::CacheQueryOptions&& options)
</del><ins>+void CacheStorageEngineConnection::deleteMatchingRecords(PAL::SessionID sessionID, uint64_t cacheIdentifier, WebCore::ResourceRequest&& request, WebCore::CacheQueryOptions&& options, RecordIdentifiersCallback&& callback)
</ins><span class="cx"> {
</span><del>-    RELEASE_LOG_IF_ALLOWED("deleteMatchingRecords (%" PRIu64 ") in cache %" PRIu64, requestIdentifier, cacheIdentifier);
-    Engine::deleteMatchingRecords(m_connection.networkProcess(), sessionID, cacheIdentifier, WTFMove(request), WTFMove(options), [connection = makeRef(m_connection.connection()), sessionID, requestIdentifier](RecordIdentifiersOrError&& result) {
</del><ins>+    RELEASE_LOG_IF_ALLOWED("deleteMatchingRecords in cache %" PRIu64, cacheIdentifier);
+    Engine::deleteMatchingRecords(m_connection.networkProcess(), sessionID, cacheIdentifier, WTFMove(request), WTFMove(options), [callback = WTFMove(callback), sessionID](auto&& result) mutable {
</ins><span class="cx">         RELEASE_LOG_FUNCTION_IF_ALLOWED_IN_CALLBACK("deleteMatchingRecords", "deleted %lu records",  [](const auto& value) { return value.size(); });
</span><del>-        connection->send(Messages::WebCacheStorageConnection::DeleteRecordsCompleted(requestIdentifier, result), sessionID.sessionID());
</del><ins>+        callback(WTFMove(result));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CacheStorageEngineConnection::putRecords(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<Record>&& records)
</del><ins>+void CacheStorageEngineConnection::putRecords(PAL::SessionID sessionID, uint64_t cacheIdentifier, Vector<Record>&& records, RecordIdentifiersCallback&& callback)
</ins><span class="cx"> {
</span><del>-    RELEASE_LOG_IF_ALLOWED("putRecords (%" PRIu64 ") in cache %" PRIu64 ", %lu records", requestIdentifier, cacheIdentifier, records.size());
-    Engine::putRecords(m_connection.networkProcess(), sessionID, cacheIdentifier, WTFMove(records), [connection = makeRef(m_connection.connection()), sessionID, requestIdentifier](RecordIdentifiersOrError&& result) {
</del><ins>+    RELEASE_LOG_IF_ALLOWED("putRecords in cache %" PRIu64 ", %lu records", cacheIdentifier, records.size());
+    Engine::putRecords(m_connection.networkProcess(), sessionID, cacheIdentifier, WTFMove(records), [callback = WTFMove(callback), sessionID](auto&& result) mutable {
</ins><span class="cx">         RELEASE_LOG_FUNCTION_IF_ALLOWED_IN_CALLBACK("putRecords", "put %lu records",  [](const auto& value) { return value.size(); });
</span><del>-        connection->send(Messages::WebCacheStorageConnection::PutRecordsCompleted(requestIdentifier, result), sessionID.sessionID());
</del><ins>+        callback(WTFMove(result));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesscacheCacheStorageEngineConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.h (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.h  2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.h     2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "ArgumentCoders.h"
</span><span class="cx"> #include "CacheStorageEngine.h"
</span><ins>+#include "Connection.h"
</ins><span class="cx"> #include <WebCore/CacheStorageConnection.h>
</span><span class="cx"> #include <pal/SessionID.h>
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="lines">@@ -33,8 +34,20 @@
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> 
</span><span class="cx"> namespace IPC {
</span><del>-class Connection;
-class Decoder;
</del><ins>+
+template<> struct AsyncReplyError<WebCore::DOMCacheEngine::CacheIdentifierOrError> {
+    static WebCore::DOMCacheEngine::CacheIdentifierOrError create() { return makeUnexpected(WebCore::DOMCacheEngine::Error::Internal); };
+};
+template<> struct AsyncReplyError<WebCore::DOMCacheEngine::RecordIdentifiersOrError> {
+    static WebCore::DOMCacheEngine::RecordIdentifiersOrError create() { return makeUnexpected(WebCore::DOMCacheEngine::Error::Internal); };
+};
+template<> struct AsyncReplyError<WebCore::DOMCacheEngine::CacheInfosOrError> {
+    static WebCore::DOMCacheEngine::CacheInfosOrError create() { return makeUnexpected(WebCore::DOMCacheEngine::Error::Internal); };
+};
+template<> struct AsyncReplyError<WebCore::DOMCacheEngine::RecordsOrError> {
+    static WebCore::DOMCacheEngine::RecordsOrError create() { return makeUnexpected(WebCore::DOMCacheEngine::Error::Internal); };
+};
+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -50,13 +63,13 @@
</span><span class="cx"> private:
</span><span class="cx">     explicit CacheStorageEngineConnection(NetworkConnectionToWebProcess&);
</span><span class="cx"> 
</span><del>-    void open(PAL::SessionID, uint64_t openRequestIdentifier, WebCore::ClientOrigin&&, String&& cacheName);
-    void remove(PAL::SessionID, uint64_t removeRequestIdentifier, uint64_t cacheIdentifier);
-    void caches(PAL::SessionID, uint64_t retrieveCachesIdentifier, WebCore::ClientOrigin&&, uint64_t updateCounter);
</del><ins>+    void open(PAL::SessionID, WebCore::ClientOrigin&&, String&& cacheName, WebCore::DOMCacheEngine::CacheIdentifierCallback&&);
+    void remove(PAL::SessionID, uint64_t cacheIdentifier, WebCore::DOMCacheEngine::CacheIdentifierCallback&&);
+    void caches(PAL::SessionID, WebCore::ClientOrigin&&, uint64_t updateCounter, WebCore::DOMCacheEngine::CacheInfosCallback&&);
</ins><span class="cx"> 
</span><del>-    void retrieveRecords(PAL::SessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, URL&&);
-    void deleteMatchingRecords(PAL::SessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, WebCore::ResourceRequest&&, WebCore::CacheQueryOptions&&);
-    void putRecords(PAL::SessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record>&&);
</del><ins>+    void retrieveRecords(PAL::SessionID, uint64_t cacheIdentifier, URL&&, WebCore::DOMCacheEngine::RecordsCallback&&);
+    void deleteMatchingRecords(PAL::SessionID, uint64_t cacheIdentifier, WebCore::ResourceRequest&&, WebCore::CacheQueryOptions&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&);
+    void putRecords(PAL::SessionID, uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record>&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&);
</ins><span class="cx"> 
</span><span class="cx">     void reference(PAL::SessionID, uint64_t cacheIdentifier);
</span><span class="cx">     void dereference(PAL::SessionID, uint64_t cacheIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesscacheCacheStorageEngineConnectionmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.messages.in (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.messages.in        2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.messages.in   2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -21,17 +21,17 @@
</span><span class="cx"> # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> 
</span><span class="cx"> messages -> CacheStorageEngineConnection {
</span><del>-    Reference(PAL::SessionID sessionID, uint64_t cacheIdentifier);
-    Dereference(PAL::SessionID sessionID, uint64_t cacheIdentifier);
</del><ins>+    Reference(PAL::SessionID sessionID, uint64_t cacheIdentifier)
+    Dereference(PAL::SessionID sessionID, uint64_t cacheIdentifier)
</ins><span class="cx"> 
</span><del>-    Open(PAL::SessionID sessionID, uint64_t requestIdentifier, struct WebCore::ClientOrigin origin, String cacheName);
-    Remove(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier);
-    Caches(PAL::SessionID sessionID, uint64_t requestIdentifier, struct WebCore::ClientOrigin origin, uint64_t updateCounter);
</del><ins>+    Open(PAL::SessionID sessionID, struct WebCore::ClientOrigin origin, String cacheName) -> (WebCore::DOMCacheEngine::CacheIdentifierOrError result) Async
+    Remove(PAL::SessionID sessionID, uint64_t cacheIdentifier) -> (WebCore::DOMCacheEngine::CacheIdentifierOrError result) Async
+    Caches(PAL::SessionID sessionID, struct WebCore::ClientOrigin origin, uint64_t updateCounter) -> (WebCore::DOMCacheEngine::CacheInfosOrError result) Async
</ins><span class="cx"> 
</span><ins>+    RetrieveRecords(PAL::SessionID sessionID, uint64_t cacheIdentifier, URL url) -> (WebCore::DOMCacheEngine::RecordsOrError result) Async
+    DeleteMatchingRecords(PAL::SessionID sessionID, uint64_t cacheIdentifier, WebCore::ResourceRequest request, struct WebCore::CacheQueryOptions options) -> (WebCore::DOMCacheEngine::RecordIdentifiersOrError result) Async
+    PutRecords(PAL::SessionID sessionID, uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record> record) -> (WebCore::DOMCacheEngine::RecordIdentifiersOrError result) Async
+
</ins><span class="cx">     ClearMemoryRepresentation(PAL::SessionID sessionID, struct WebCore::ClientOrigin origin) -> (Optional<WebCore::DOMCacheEngine::Error> error) Async
</span><span class="cx">     EngineRepresentation(PAL::SessionID sessionID) -> (String representation) Async
</span><del>-
-    RetrieveRecords(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, URL url);
-    DeleteMatchingRecords(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, WebCore::ResourceRequest request, struct WebCore::CacheQueryOptions options);
-    PutRecords(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record> record);
</del><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitPlatformIPCArgumentCodersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Platform/IPC/ArgumentCoders.h (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Platform/IPC/ArgumentCoders.h        2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/Platform/IPC/ArgumentCoders.h   2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/MonotonicTime.h>
</span><span class="cx"> #include <wtf/SHA1.h>
</span><ins>+#include <wtf/Unexpected.h>
</ins><span class="cx"> #include <wtf/WallTime.h>
</span><span class="cx"> 
</span><span class="cx"> namespace IPC {
</span></span></pre></div>
<a id="trunkSourceWebKitPlatformIPCConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Platform/IPC/Connection.h (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Platform/IPC/Connection.h    2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/Platform/IPC/Connection.h       2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -83,6 +83,10 @@
</span><span class="cx">     } \
</span><span class="cx"> while (0)
</span><span class="cx"> 
</span><ins>+template<typename AsyncReplyResult> struct AsyncReplyError {
+    static AsyncReplyResult create() { return { }; };
+};
+
</ins><span class="cx"> class MachMessage;
</span><span class="cx"> class UnixMessage;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkitmessagespy"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/messages.py (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/messages.py   2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/Scripts/webkit/messages.py      2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -594,13 +594,15 @@
</span><span class="cx">                 for x in message.reply_parameters:
</span><span class="cx">                     result.append('    Optional<%s> %s;\n' % (x.type, x.name))
</span><span class="cx">                     result.append('    decoder >> %s;\n' % x.name)
</span><del>-                    result.append('    if (!%s) {\n        ASSERT_NOT_REACHED();\n        return;\n    }\n' % x.name)
</del><ins>+                    result.append('    if (!%s) {\n        ASSERT_NOT_REACHED();\n        completionHandler(' % x.name)
+                    result.append(', '.join(['IPC::AsyncReplyError<' + x.type + '>::create()' for x in message.reply_parameters]))
+                    result.append(');\n        return;\n    }\n')
</ins><span class="cx">                 result.append('    completionHandler(')
</span><span class="cx">                 if len(message.reply_parameters):
</span><span class="cx">                     result.append('WTFMove(*%s)' % ('), WTFMove(*'.join(x.name for x in message.reply_parameters)))
</span><span class="cx">                 result.append(');\n}\n\n')
</span><span class="cx">                 result.append('void %s::cancelReply(CompletionHandler<void(%s)>&& completionHandler)\n{\n    completionHandler(' % move_parameters)
</span><del>-                result.append(', '.join(['{ }' for x in message.reply_parameters]))
</del><ins>+                result.append(', '.join(['IPC::AsyncReplyError<' + x.type + '>::create()' for x in message.reply_parameters]))
</ins><span class="cx">                 result.append(');\n}\n\n')
</span><span class="cx"> 
</span><span class="cx">             result.append('void %s::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection' % (message.name))
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj     2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -969,7 +969,6 @@
</span><span class="cx">          517A52D91F43A9DA00DCDC0A /* WebSWServerConnectionMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 517A52D61F43A9B600DCDC0A /* WebSWServerConnectionMessages.h */; };
</span><span class="cx">          517A530F1F47A86200DCDC0A /* WebSWClientConnectionMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517A530E1F47A84300DCDC0A /* WebSWClientConnectionMessageReceiver.cpp */; };
</span><span class="cx">          517A53101F47A86200DCDC0A /* WebSWClientConnectionMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 517A530D1F47A84300DCDC0A /* WebSWClientConnectionMessages.h */; };
</span><del>-               517CF0E3163A486C00C2950D /* WebCacheStorageConnectionMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517CF0E1163A486C00C2950D /* WebCacheStorageConnectionMessageReceiver.cpp */; };
</del><span class="cx">           517CF0E3163A486C00C2950E /* NetworkProcessConnectionMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517CF0E1163A486C00C2950E /* NetworkProcessConnectionMessageReceiver.cpp */; };
</span><span class="cx">          517CF0E3163A486C00C2950F /* CacheStorageEngineConnectionMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517CF0E1163A486C00C2950F /* CacheStorageEngineConnectionMessageReceiver.cpp */; };
</span><span class="cx">          517CF0E4163A486C00C2950E /* NetworkProcessConnectionMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 517CF0E2163A486C00C2950E /* NetworkProcessConnectionMessages.h */; };
</span><span class="lines">@@ -3099,7 +3098,6 @@
</span><span class="cx">          4151E5C31FBB90A900E47E2D /* FormDataReference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormDataReference.h; sourceTree = "<group>"; };
</span><span class="cx">          4157853021276B6F00DD3800 /* copy-webcontent-resources-to-private-headers.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "copy-webcontent-resources-to-private-headers.sh"; sourceTree = "<group>"; };
</span><span class="cx">          4157E4AF20E2EC9800A6C0D7 /* com.google.o1dbrowserplugin.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.google.o1dbrowserplugin.sb; sourceTree = "<group>"; };
</span><del>-               41897ECB1F415D5C0016FA42 /* WebCacheStorageConnection.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebCacheStorageConnection.messages.in; sourceTree = "<group>"; };
</del><span class="cx">           41897ECC1F415D5C0016FA42 /* WebCacheStorageProvider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebCacheStorageProvider.cpp; sourceTree = "<group>"; };
</span><span class="cx">          41897ECD1F415D5C0016FA42 /* WebCacheStorageConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebCacheStorageConnection.h; sourceTree = "<group>"; };
</span><span class="cx">          41897ECE1F415D5C0016FA42 /* WebCacheStorageConnection.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebCacheStorageConnection.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -3289,7 +3287,6 @@
</span><span class="cx">          517A530C1F479E9700DCDC0A /* WebSWClientConnection.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebSWClientConnection.messages.in; sourceTree = "<group>"; };
</span><span class="cx">          517A530D1F47A84300DCDC0A /* WebSWClientConnectionMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSWClientConnectionMessages.h; path = DerivedSources/WebKit2/WebSWClientConnectionMessages.h; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="cx">          517A530E1F47A84300DCDC0A /* WebSWClientConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebSWClientConnectionMessageReceiver.cpp; path = DerivedSources/WebKit2/WebSWClientConnectionMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
</span><del>-               517CF0E1163A486C00C2950D /* WebCacheStorageConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebCacheStorageConnectionMessageReceiver.cpp; path = DerivedSources/WebKit2/WebCacheStorageConnectionMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
</del><span class="cx">           517CF0E1163A486C00C2950E /* NetworkProcessConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkProcessConnectionMessageReceiver.cpp; path = DerivedSources/WebKit2/NetworkProcessConnectionMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="cx">          517CF0E1163A486C00C2950F /* CacheStorageEngineConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CacheStorageEngineConnectionMessageReceiver.cpp; path = DerivedSources/WebKit2/CacheStorageEngineConnectionMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="cx">          517CF0E2163A486C00C2950E /* NetworkProcessConnectionMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkProcessConnectionMessages.h; path = DerivedSources/WebKit2/NetworkProcessConnectionMessages.h; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="lines">@@ -6516,7 +6513,6 @@
</span><span class="cx">                  children = (
</span><span class="cx">                          41897ECE1F415D5C0016FA42 /* WebCacheStorageConnection.cpp */,
</span><span class="cx">                          41897ECD1F415D5C0016FA42 /* WebCacheStorageConnection.h */,
</span><del>-                               41897ECB1F415D5C0016FA42 /* WebCacheStorageConnection.messages.in */,
</del><span class="cx">                           41897ECC1F415D5C0016FA42 /* WebCacheStorageProvider.cpp */,
</span><span class="cx">                          41D129D91F3D101400D15E47 /* WebCacheStorageProvider.h */,
</span><span class="cx">                  );
</span><span class="lines">@@ -8676,7 +8672,6 @@
</span><span class="cx">                          1C0A19511C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessageReceiver.cpp */,
</span><span class="cx">                          1C0A19521C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessages.h */,
</span><span class="cx">                          1C0A195B1C916E1B00FE0EBB /* WebAutomationSessionProxyScriptSource.h */,
</span><del>-                               517CF0E1163A486C00C2950D /* WebCacheStorageConnectionMessageReceiver.cpp */,
</del><span class="cx">                           1A1FEC1A1627B45600700F6D /* WebConnectionMessageReceiver.cpp */,
</span><span class="cx">                          1A1FEC1B1627B45700700F6D /* WebConnectionMessages.h */,
</span><span class="cx">                          330934431315B9220097A7BC /* WebCookieManagerMessageReceiver.cpp */,
</span><span class="lines">@@ -11258,7 +11253,6 @@
</span><span class="cx">                          57DCED702142EE680016B847 /* WebAuthenticatorCoordinatorProxyMessageReceiver.cpp in Sources */,
</span><span class="cx">                          1C0A19571C90068F00FE0EBB /* WebAutomationSessionMessageReceiver.cpp in Sources */,
</span><span class="cx">                          1C0A19531C8FFDFB00FE0EBB /* WebAutomationSessionProxyMessageReceiver.cpp in Sources */,
</span><del>-                               517CF0E3163A486C00C2950D /* WebCacheStorageConnectionMessageReceiver.cpp in Sources */,
</del><span class="cx">                           1A1FEC1C1627B45700700F6D /* WebConnectionMessageReceiver.cpp in Sources */,
</span><span class="cx">                          330934471315B9220097A7BC /* WebCookieManagerMessageReceiver.cpp in Sources */,
</span><span class="cx">                          330934491315B9220097A7BC /* WebCookieManagerProxyMessageReceiver.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessCacheWebCacheStorageConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp       2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp  2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -56,34 +56,34 @@
</span><span class="cx">     return WebProcess::singleton().ensureNetworkProcessConnection().connection();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebCacheStorageConnection::doOpen(uint64_t requestIdentifier, const WebCore::ClientOrigin& origin, const String& cacheName)
</del><ins>+void WebCacheStorageConnection::open(const WebCore::ClientOrigin& origin, const String& cacheName, DOMCacheEngine::CacheIdentifierCallback&& callback)
</ins><span class="cx"> {
</span><del>-    connection().send(Messages::CacheStorageEngineConnection::Open(m_sessionID, requestIdentifier, origin, cacheName), 0);
</del><ins>+    connection().sendWithAsyncReply(Messages::CacheStorageEngineConnection::Open(m_sessionID, origin, cacheName), WTFMove(callback));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebCacheStorageConnection::doRemove(uint64_t requestIdentifier, uint64_t cacheIdentifier)
</del><ins>+void WebCacheStorageConnection::remove(uint64_t cacheIdentifier, DOMCacheEngine::CacheIdentifierCallback&& callback)
</ins><span class="cx"> {
</span><del>-    connection().send(Messages::CacheStorageEngineConnection::Remove(m_sessionID, requestIdentifier, cacheIdentifier), 0);
</del><ins>+    connection().sendWithAsyncReply(Messages::CacheStorageEngineConnection::Remove(m_sessionID, cacheIdentifier), WTFMove(callback));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebCacheStorageConnection::doRetrieveCaches(uint64_t requestIdentifier, const WebCore::ClientOrigin& origin, uint64_t updateCounter)
</del><ins>+void WebCacheStorageConnection::retrieveCaches(const WebCore::ClientOrigin& origin, uint64_t updateCounter, DOMCacheEngine::CacheInfosCallback&& callback)
</ins><span class="cx"> {
</span><del>-    connection().send(Messages::CacheStorageEngineConnection::Caches(m_sessionID, requestIdentifier, origin, updateCounter), 0);
</del><ins>+    connection().sendWithAsyncReply(Messages::CacheStorageEngineConnection::Caches(m_sessionID, origin, updateCounter), WTFMove(callback));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebCacheStorageConnection::doRetrieveRecords(uint64_t requestIdentifier, uint64_t cacheIdentifier, const URL& url)
</del><ins>+void WebCacheStorageConnection::retrieveRecords(uint64_t cacheIdentifier, const URL& url, DOMCacheEngine::RecordsCallback&& callback)
</ins><span class="cx"> {
</span><del>-    connection().send(Messages::CacheStorageEngineConnection::RetrieveRecords(m_sessionID, requestIdentifier, cacheIdentifier, url), 0);
</del><ins>+    connection().sendWithAsyncReply(Messages::CacheStorageEngineConnection::RetrieveRecords(m_sessionID, cacheIdentifier, url), WTFMove(callback));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebCacheStorageConnection::doBatchDeleteOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, const WebCore::ResourceRequest& request, WebCore::CacheQueryOptions&& options)
</del><ins>+void WebCacheStorageConnection::batchDeleteOperation(uint64_t cacheIdentifier, const WebCore::ResourceRequest& request, WebCore::CacheQueryOptions&& options, DOMCacheEngine::RecordIdentifiersCallback&& callback)
</ins><span class="cx"> {
</span><del>-    connection().send(Messages::CacheStorageEngineConnection::DeleteMatchingRecords(m_sessionID, requestIdentifier, cacheIdentifier, request, options), 0);
</del><ins>+    connection().sendWithAsyncReply(Messages::CacheStorageEngineConnection::DeleteMatchingRecords(m_sessionID, cacheIdentifier, request, options), WTFMove(callback));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebCacheStorageConnection::doBatchPutOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<Record>&& records)
</del><ins>+void WebCacheStorageConnection::batchPutOperation(uint64_t cacheIdentifier, Vector<Record>&& records, DOMCacheEngine::RecordIdentifiersCallback&& callback)
</ins><span class="cx"> {
</span><del>-    connection().send(Messages::CacheStorageEngineConnection::PutRecords(m_sessionID, requestIdentifier, cacheIdentifier, records), 0);
</del><ins>+    connection().sendWithAsyncReply(Messages::CacheStorageEngineConnection::PutRecords(m_sessionID, cacheIdentifier, records), WTFMove(callback));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebCacheStorageConnection::reference(uint64_t cacheIdentifier)
</span><span class="lines">@@ -96,42 +96,12 @@
</span><span class="cx">     connection().send(Messages::CacheStorageEngineConnection::Dereference(m_sessionID, cacheIdentifier), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebCacheStorageConnection::openCompleted(uint64_t requestIdentifier, const CacheIdentifierOrError& result)
-{
-    CacheStorageConnection::openCompleted(requestIdentifier, result);
-}
-
-void WebCacheStorageConnection::removeCompleted(uint64_t requestIdentifier, const CacheIdentifierOrError& result)
-{
-    CacheStorageConnection::removeCompleted(requestIdentifier, result);
-}
-
-void WebCacheStorageConnection::updateCaches(uint64_t requestIdentifier, CacheInfosOrError&& result)
-{
-    CacheStorageConnection::updateCaches(requestIdentifier, WTFMove(result));
-}
-
-void WebCacheStorageConnection::updateRecords(uint64_t requestIdentifier, RecordsOrError&& result)
-{
-    CacheStorageConnection::updateRecords(requestIdentifier, WTFMove(result));
-}
-
-void WebCacheStorageConnection::deleteRecordsCompleted(uint64_t requestIdentifier, RecordIdentifiersOrError&& result)
-{
-    CacheStorageConnection::deleteRecordsCompleted(requestIdentifier, WTFMove(result));
-}
-
-void WebCacheStorageConnection::putRecordsCompleted(uint64_t requestIdentifier, RecordIdentifiersOrError&& result)
-{
-    CacheStorageConnection::putRecordsCompleted(requestIdentifier, WTFMove(result));
-}
-
</del><span class="cx"> void WebCacheStorageConnection::clearMemoryRepresentation(const WebCore::ClientOrigin& origin, CompletionCallback&& callback)
</span><span class="cx"> {
</span><span class="cx">     connection().sendWithAsyncReply(Messages::CacheStorageEngineConnection::ClearMemoryRepresentation { m_sessionID, origin }, WTFMove(callback));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebCacheStorageConnection::engineRepresentation(WTF::Function<void(const String&)>&& callback)
</del><ins>+void WebCacheStorageConnection::engineRepresentation(CompletionHandler<void(const String&)>&& callback)
</ins><span class="cx"> {
</span><span class="cx">     connection().sendWithAsyncReply(Messages::CacheStorageEngineConnection::EngineRepresentation { m_sessionID }, WTFMove(callback));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessCacheWebCacheStorageConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.h (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.h 2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.h    2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -52,29 +52,21 @@
</span><span class="cx">     IPC::Connection& connection();
</span><span class="cx"> 
</span><span class="cx">     // WebCore::CacheStorageConnection
</span><del>-    void doOpen(uint64_t requestIdentifier, const WebCore::ClientOrigin&, const String& cacheName) final;
-    void doRemove(uint64_t requestIdentifier, uint64_t cacheIdentifier) final;
-    void doRetrieveCaches(uint64_t requestIdentifier, const WebCore::ClientOrigin&, uint64_t updateCounter) final;
</del><ins>+    void open(const WebCore::ClientOrigin&, const String& cacheName, WebCore::DOMCacheEngine::CacheIdentifierCallback&&) final;
+    void remove(uint64_t cacheIdentifier, WebCore::DOMCacheEngine::CacheIdentifierCallback&&) final;
+    void retrieveCaches(const WebCore::ClientOrigin&, uint64_t updateCounter, WebCore::DOMCacheEngine::CacheInfosCallback&&) final;
</ins><span class="cx"> 
</span><del>-    void doRetrieveRecords(uint64_t requestIdentifier, uint64_t cacheIdentifier, const URL&) final;
-    void doBatchDeleteOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, const WebCore::ResourceRequest&, WebCore::CacheQueryOptions&&) final;
-    void doBatchPutOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record>&&) final;
</del><ins>+    void retrieveRecords(uint64_t cacheIdentifier, const URL&, WebCore::DOMCacheEngine::RecordsCallback&&) final;
+    void batchDeleteOperation(uint64_t cacheIdentifier, const WebCore::ResourceRequest&, WebCore::CacheQueryOptions&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&) final;
+    void batchPutOperation(uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record>&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&) final;
</ins><span class="cx"> 
</span><span class="cx">     void reference(uint64_t cacheIdentifier) final;
</span><span class="cx">     void dereference(uint64_t cacheIdentifier) final;
</span><span class="cx"> 
</span><span class="cx">     void clearMemoryRepresentation(const WebCore::ClientOrigin&, WebCore::DOMCacheEngine::CompletionCallback&&) final;
</span><del>-    void engineRepresentation(WTF::Function<void(const String&)>&&) final;
</del><ins>+    void engineRepresentation(CompletionHandler<void(const String&)>&&) final;
</ins><span class="cx">     void updateQuotaBasedOnSpaceUsage(const WebCore::ClientOrigin&) final;
</span><span class="cx"> 
</span><del>-    void openCompleted(uint64_t requestIdentifier, const WebCore::DOMCacheEngine::CacheIdentifierOrError&);
-    void removeCompleted(uint64_t requestIdentifier, const WebCore::DOMCacheEngine::CacheIdentifierOrError&);
-    void updateCaches(uint64_t requestIdentifier, WebCore::DOMCacheEngine::CacheInfosOrError&&);
-
-    void updateRecords(uint64_t requestIdentifier, WebCore::DOMCacheEngine::RecordsOrError&&);
-    void deleteRecordsCompleted(uint64_t requestIdentifier, WebCore::DOMCacheEngine::RecordIdentifiersOrError&&);
-    void putRecordsCompleted(uint64_t requestIdentifier, WebCore::DOMCacheEngine::RecordIdentifiersOrError&&);
-
</del><span class="cx">     WebCacheStorageProvider& m_provider;
</span><span class="cx">     PAL::SessionID m_sessionID;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessCacheWebCacheStorageConnectionmessagesin"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.messages.in (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.messages.in       2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.messages.in  2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -1,31 +0,0 @@
</span><del>-# Copyright (C) 2017 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer.
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-messages -> WebCacheStorageConnection {
-    OpenCompleted(uint64_t requestIdentifier, WebCore::DOMCacheEngine::CacheIdentifierOrError result);
-    RemoveCompleted(uint64_t requestIdentifier, WebCore::DOMCacheEngine::CacheIdentifierOrError result);
-    UpdateCaches(uint64_t requestIdentifier, WebCore::DOMCacheEngine::CacheInfosOrError result);
-
-    UpdateRecords(uint64_t requestIdentifier, WebCore::DOMCacheEngine::RecordsOrError result);
-    DeleteRecordsCompleted(uint64_t requestIdentifier, WebCore::DOMCacheEngine::RecordIdentifiersOrError result);
-    PutRecordsCompleted(uint64_t requestIdentifier, WebCore::DOMCacheEngine::RecordIdentifiersOrError result);
-}
</del></span></pre></div>
<a id="trunkSourceWebKitWebProcessCacheWebCacheStorageProvidercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageProvider.cpp (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageProvider.cpp 2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageProvider.cpp    2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -49,10 +49,4 @@
</span><span class="cx">     return *m_defaultConnection;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebCacheStorageProvider::process(IPC::Connection& connection, IPC::Decoder& decoder)
-{
-    if (auto* cacheConnection = m_connections.get(decoder.destinationID()))
-        cacheConnection->didReceiveMessage(connection, decoder);
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebKitWebProcessCacheWebCacheStorageProviderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageProvider.h (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageProvider.h   2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageProvider.h      2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -43,8 +43,6 @@
</span><span class="cx"> 
</span><span class="cx">     Ref<WebCore::CacheStorageConnection> createCacheStorageConnection(PAL::SessionID) final;
</span><span class="cx"> 
</span><del>-    void process(IPC::Connection&, IPC::Decoder&);
-
</del><span class="cx"> private:
</span><span class="cx">     WebCacheStorageProvider() = default;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessNetworkNetworkProcessConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp (245714 => 245715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp      2019-05-23 21:08:54 UTC (rev 245714)
+++ trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp 2019-05-23 21:15:33 UTC (rev 245715)
</span><span class="lines">@@ -32,8 +32,6 @@
</span><span class="cx"> #include "ServiceWorkerClientFetchMessages.h"
</span><span class="cx"> #include "StorageAreaMap.h"
</span><span class="cx"> #include "StorageAreaMapMessages.h"
</span><del>-#include "WebCacheStorageConnection.h"
-#include "WebCacheStorageConnectionMessages.h"
</del><span class="cx"> #include "WebCacheStorageProvider.h"
</span><span class="cx"> #include "WebCoreArgumentCoders.h"
</span><span class="cx"> #include "WebIDBConnectionToServerMessages.h"
</span><span class="lines">@@ -121,10 +119,6 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><del>-    if (decoder.messageReceiverName() == Messages::WebCacheStorageConnection::messageReceiverName()) {
-        WebProcess::singleton().cacheStorageProvider().process(connection, decoder);
-        return;
-    }
</del><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx">     if (decoder.messageReceiverName() == Messages::WebIDBConnectionToServer::messageReceiverName()) {
</span></span></pre>
</div>
</div>

</body>
</html>