<!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>[242503] trunk/Source/WebKit</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/242503">242503</a></dd>
<dt>Author</dt> <dd>youenn@apple.com</dd>
<dt>Date</dt> <dd>2019-03-05 13:49:28 -0800 (Tue, 05 Mar 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Introduce ServiceWorkerFetchTask
https://bugs.webkit.org/show_bug.cgi?id=195130

Reviewed by Chris Dumez.

ServiceWorkerFetchTask is added to represent NetworkProcess side of an ongoing fetch intercepted by service worker.
This patch should not change existing behavior.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didFailFetch): Deleted.
(WebKit::NetworkProcess::didNotHandleFetch): Deleted.
(WebKit::NetworkProcess::didReceiveFetchRedirectResponse): Deleted.
(WebKit::NetworkProcess::didReceiveFetchResponse): Deleted.
(WebKit::NetworkProcess::didReceiveFetchData): Deleted.
(WebKit::NetworkProcess::didReceiveFetchFormData): Deleted.
(WebKit::NetworkProcess::didFinishFetch): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::cancelFetch):
(WebKit::WebSWServerConnection::continueDidReceiveFetchResponse):
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::didReceiveFetchRedirectResponse): Deleted.
(WebKit::WebSWServerConnection::didReceiveFetchResponse): Deleted.
(WebKit::WebSWServerConnection::didReceiveFetchData): Deleted.
(WebKit::WebSWServerConnection::didReceiveFetchFormData): Deleted.
(WebKit::WebSWServerConnection::didFinishFetch): Deleted.
(WebKit::WebSWServerConnection::didFailFetch): Deleted.
(WebKit::WebSWServerConnection::didNotHandleFetch): Deleted.
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::connectionClosed):
(WebKit::WebSWServerToContextConnection::startFetch):
(WebKit::WebSWServerToContextConnection::cancelFetch):
(WebKit::WebSWServerToContextConnection::continueDidReceiveFetchResponse):
(WebKit::WebSWServerToContextConnection::didReceiveFetchTaskMessage):
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::startFetch):
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveRedirection):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
(WebKit::WebServiceWorkerFetchTaskClient::didFail):
(WebKit::WebServiceWorkerFetchTaskClient::didFinish):
(WebKit::WebServiceWorkerFetchTaskClient::didNotHandle):
* NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: Added.
(WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
(WebKit::ServiceWorkerFetchTask::didReceiveResponse):
(WebKit::ServiceWorkerFetchTask::didReceiveData):
(WebKit::ServiceWorkerFetchTask::didReceiveFormData):
(WebKit::ServiceWorkerFetchTask::didFinish):
(WebKit::ServiceWorkerFetchTask::didFail):
(WebKit::ServiceWorkerFetchTask::didNotHandle):
* NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: Added.
(WebKit::ServiceWorkerFetchTask::create):
(WebKit::ServiceWorkerFetchTask::Identifier::hash const):
(WebKit::ServiceWorkerFetchTask::identifier const):
(WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
(WebKit::operator==):
(WTF::ServiceWorkerFetchTaskIdentifierHash::hash):
(WTF::ServiceWorkerFetchTaskIdentifierHash::equal):
(WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::emptyValue):
(WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::constructDeletedValue):
(WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::isDeletedValue):
* NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitCMakeListstxt">trunk/Source/WebKit/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitDerivedSourcesinputxcfilelist">trunk/Source/WebKit/DerivedSources-input.xcfilelist</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="#trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcesscpp">trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcesscpp">trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcessh">trunk/Source/WebKit/NetworkProcess/NetworkProcess.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcessmessagesin">trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessServiceWorkerWebSWServerConnectioncpp">trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessServiceWorkerWebSWServerConnectionh">trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessServiceWorkerWebSWServerToContextConnectioncpp">trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessServiceWorkerWebSWServerToContextConnectionh">trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h</a></li>
<li><a href="#trunkSourceWebKitSourcestxt">trunk/Source/WebKit/Sources.txt</a></li>
<li><a href="#trunkSourceWebKitSourcesCocoatxt">trunk/Source/WebKit/SourcesCocoa.txt</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKitWebProcessStorageWebSWContextManagerConnectioncpp">trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessStorageWebServiceWorkerFetchTaskClientcpp">trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitNetworkProcessServiceWorkerServiceWorkerFetchTaskcpp">trunk/Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessServiceWorkerServiceWorkerFetchTaskh">trunk/Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessServiceWorkerServiceWorkerFetchTaskmessagesin">trunk/Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/CMakeLists.txt (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/CMakeLists.txt       2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/CMakeLists.txt  2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -111,6 +111,7 @@
</span><span class="cx">     NetworkProcess/NetworkResourceLoader.messages.in
</span><span class="cx">     NetworkProcess/NetworkSocketStream.messages.in
</span><span class="cx"> 
</span><ins>+    NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in
</ins><span class="cx">     NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in
</span><span class="cx">     NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/ChangeLog       2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -1,5 +1,84 @@
</span><span class="cx"> 2019-03-05  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><ins>+        Introduce ServiceWorkerFetchTask
+        https://bugs.webkit.org/show_bug.cgi?id=195130
+
+        Reviewed by Chris Dumez.
+
+        ServiceWorkerFetchTask is added to represent NetworkProcess side of an ongoing fetch intercepted by service worker.
+        This patch should not change existing behavior.
+
+        * CMakeLists.txt:
+        * DerivedSources-input.xcfilelist:
+        * DerivedSources-output.xcfilelist:
+        * DerivedSources.make:
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::didFailFetch): Deleted.
+        (WebKit::NetworkProcess::didNotHandleFetch): Deleted.
+        (WebKit::NetworkProcess::didReceiveFetchRedirectResponse): Deleted.
+        (WebKit::NetworkProcess::didReceiveFetchResponse): Deleted.
+        (WebKit::NetworkProcess::didReceiveFetchData): Deleted.
+        (WebKit::NetworkProcess::didReceiveFetchFormData): Deleted.
+        (WebKit::NetworkProcess::didFinishFetch): Deleted.
+        * NetworkProcess/NetworkProcess.h:
+        * NetworkProcess/NetworkProcess.messages.in:
+        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
+        (WebKit::WebSWServerConnection::cancelFetch):
+        (WebKit::WebSWServerConnection::continueDidReceiveFetchResponse):
+        (WebKit::WebSWServerConnection::startFetch):
+        (WebKit::WebSWServerConnection::didReceiveFetchRedirectResponse): Deleted.
+        (WebKit::WebSWServerConnection::didReceiveFetchResponse): Deleted.
+        (WebKit::WebSWServerConnection::didReceiveFetchData): Deleted.
+        (WebKit::WebSWServerConnection::didReceiveFetchFormData): Deleted.
+        (WebKit::WebSWServerConnection::didFinishFetch): Deleted.
+        (WebKit::WebSWServerConnection::didFailFetch): Deleted.
+        (WebKit::WebSWServerConnection::didNotHandleFetch): Deleted.
+        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
+        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
+        (WebKit::WebSWServerToContextConnection::connectionClosed):
+        (WebKit::WebSWServerToContextConnection::startFetch):
+        (WebKit::WebSWServerToContextConnection::cancelFetch):
+        (WebKit::WebSWServerToContextConnection::continueDidReceiveFetchResponse):
+        (WebKit::WebSWServerToContextConnection::didReceiveFetchTaskMessage):
+        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
+        * SourcesCocoa.txt:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
+        (WebKit::WebSWContextManagerConnection::startFetch):
+        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
+        (WebKit::WebServiceWorkerFetchTaskClient::didReceiveRedirection):
+        (WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
+        (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
+        (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
+        (WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
+        (WebKit::WebServiceWorkerFetchTaskClient::didFail):
+        (WebKit::WebServiceWorkerFetchTaskClient::didFinish):
+        (WebKit::WebServiceWorkerFetchTaskClient::didNotHandle):
+        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: Added.
+        (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
+        (WebKit::ServiceWorkerFetchTask::didReceiveResponse):
+        (WebKit::ServiceWorkerFetchTask::didReceiveData):
+        (WebKit::ServiceWorkerFetchTask::didReceiveFormData):
+        (WebKit::ServiceWorkerFetchTask::didFinish):
+        (WebKit::ServiceWorkerFetchTask::didFail):
+        (WebKit::ServiceWorkerFetchTask::didNotHandle):
+        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: Added.
+        (WebKit::ServiceWorkerFetchTask::create):
+        (WebKit::ServiceWorkerFetchTask::Identifier::hash const):
+        (WebKit::ServiceWorkerFetchTask::identifier const):
+        (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
+        (WebKit::operator==):
+        (WTF::ServiceWorkerFetchTaskIdentifierHash::hash):
+        (WTF::ServiceWorkerFetchTaskIdentifierHash::equal):
+        (WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::emptyValue):
+        (WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::constructDeletedValue):
+        (WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::isDeletedValue):
+        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in: Added.
+
+2019-03-05  Youenn Fablet  <youenn@apple.com>
+
</ins><span class="cx">         Rename requestCacheStorageSpace to requestStorageSpace
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=195282
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitDerivedSourcesinputxcfilelist"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/DerivedSources-input.xcfilelist (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/DerivedSources-input.xcfilelist      2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/DerivedSources-input.xcfilelist 2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> $(PROJECT_DIR)/NetworkProcess/NetworkProcess.messages.in
</span><span class="cx"> $(PROJECT_DIR)/NetworkProcess/NetworkResourceLoader.messages.in
</span><span class="cx"> $(PROJECT_DIR)/NetworkProcess/NetworkSocketStream.messages.in
</span><ins>+$(PROJECT_DIR)/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in
</ins><span class="cx"> $(PROJECT_DIR)/NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in
</span><span class="cx"> $(PROJECT_DIR)/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in
</span><span class="cx"> $(PROJECT_DIR)/NetworkProcess/cache/CacheStorageEngineConnection.messages.in
</span></span></pre></div>
<a id="trunkSourceWebKitDerivedSourcesoutputxcfilelist"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/DerivedSources-output.xcfilelist (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/DerivedSources-output.xcfilelist     2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/DerivedSources-output.xcfilelist        2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -80,6 +80,8 @@
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/SecItemShimProxyMessages.h
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/ServiceWorkerClientFetchMessageReceiver.cpp
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/ServiceWorkerClientFetchMessages.h
</span><ins>+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/ServiceWorkerFetchTaskMessageReceiver.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/ServiceWorkerFetchTaskMessages.h
</ins><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/SmartMagnificationControllerMessageReceiver.cpp
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/SmartMagnificationControllerMessages.h
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/StorageAreaMapMessageReceiver.cpp
</span></span></pre></div>
<a id="trunkSourceWebKitDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/DerivedSources.make (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/DerivedSources.make  2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/DerivedSources.make     2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -131,6 +131,7 @@
</span><span class="cx">     RemoteWebInspectorUI \
</span><span class="cx">     SecItemShimProxy \
</span><span class="cx">     ServiceWorkerClientFetch \
</span><ins>+    ServiceWorkerFetchTask \
</ins><span class="cx">     SmartMagnificationController \
</span><span class="cx">     StorageAreaMap \
</span><span class="cx">     StorageManager \
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp     2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp        2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> #include "NetworkSocketStreamMessages.h"
</span><span class="cx"> #include "PingLoad.h"
</span><span class="cx"> #include "PreconnectTask.h"
</span><ins>+#include "ServiceWorkerFetchTaskMessages.h"
</ins><span class="cx"> #include "WebCoreArgumentCoders.h"
</span><span class="cx"> #include "WebErrors.h"
</span><span class="cx"> #include "WebIDBConnectionToClient.h"
</span><span class="lines">@@ -180,7 +181,7 @@
</span><span class="cx">             swConnection->didReceiveMessage(connection, decoder);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    
</del><ins>+
</ins><span class="cx">     if (decoder.messageReceiverName() == Messages::WebSWServerToContextConnection::messageReceiverName()) {
</span><span class="cx">         if (auto* contextConnection = m_networkProcess->connectionToContextProcessFromIPCConnection(connection)) {
</span><span class="cx">             contextConnection->didReceiveMessage(connection, decoder);
</span><span class="lines">@@ -187,6 +188,13 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">     }
</span><ins>+
+    if (decoder.messageReceiverName() == Messages::ServiceWorkerFetchTask::messageReceiverName()) {
+        if (auto* contextConnection = m_networkProcess->connectionToContextProcessFromIPCConnection(connection)) {
+            contextConnection->didReceiveFetchTaskMessage(connection, decoder);
+            return;
+        }
+    }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp    2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp       2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -2189,48 +2189,6 @@
</span><span class="cx">         parentProcessConnection()->send(Messages::NetworkProcessProxy::EstablishWorkerContextConnectionToNetworkProcess(securityOrigin), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkProcess::didFailFetch(SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier fetchIdentifier, const ResourceError& error)
-{
-    if (auto* connection = m_swServerConnections.get(serverConnectionIdentifier))
-        connection->didFailFetch(fetchIdentifier, error);
-}
-
-void NetworkProcess::didNotHandleFetch(SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier fetchIdentifier)
-{
-    if (auto* connection = m_swServerConnections.get(serverConnectionIdentifier))
-        connection->didNotHandleFetch(fetchIdentifier);
-}
-
-void NetworkProcess::didReceiveFetchRedirectResponse(SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier fetchIdentifier, const WebCore::ResourceResponse& response)
-{
-    if (auto* connection = m_swServerConnections.get(serverConnectionIdentifier))
-        connection->didReceiveFetchRedirectResponse(fetchIdentifier, response);
-}
-
-void NetworkProcess::didReceiveFetchResponse(SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier fetchIdentifier, const WebCore::ResourceResponse& response, bool needsContinueDidReceiveResponseMessage)
-{
-    if (auto* connection = m_swServerConnections.get(serverConnectionIdentifier))
-        connection->didReceiveFetchResponse(fetchIdentifier, response, needsContinueDidReceiveResponseMessage);
-}
-
-void NetworkProcess::didReceiveFetchData(SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier fetchIdentifier, const IPC::DataReference& data, int64_t encodedDataLength)
-{
-    if (auto* connection = m_swServerConnections.get(serverConnectionIdentifier))
-        connection->didReceiveFetchData(fetchIdentifier, data, encodedDataLength);
-}
-
-void NetworkProcess::didReceiveFetchFormData(SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier fetchIdentifier, const IPC::FormDataReference& formData)
-{
-    if (auto* connection = m_swServerConnections.get(serverConnectionIdentifier))
-        connection->didReceiveFetchFormData(fetchIdentifier, formData);
-}
-
-void NetworkProcess::didFinishFetch(SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier fetchIdentifier)
-{
-    if (auto* connection = m_swServerConnections.get(serverConnectionIdentifier))
-        connection->didFinishFetch(fetchIdentifier);
-}
-
</del><span class="cx"> void NetworkProcess::postMessageToServiceWorkerClient(const ServiceWorkerClientIdentifier& destinationIdentifier, MessageWithMessagePorts&& message, ServiceWorkerIdentifier sourceIdentifier, const String& sourceOrigin)
</span><span class="cx"> {
</span><span class="cx">     if (auto* connection = m_swServerConnections.get(destinationIdentifier.serverConnectionIdentifier))
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.h (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.h      2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.h 2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -426,14 +426,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><del>-    void didReceiveFetchRedirectResponse(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier, const WebCore::ResourceResponse&);
-    void didReceiveFetchResponse(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier, const WebCore::ResourceResponse&, bool needsContinueDidReceiveResponseMessage);
-    void didReceiveFetchData(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier, const IPC::DataReference&, int64_t encodedDataLength);
-    void didReceiveFetchFormData(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier, const IPC::FormDataReference&);
-    void didFinishFetch(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier);
-    void didFailFetch(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier, const WebCore::ResourceError&);
-    void didNotHandleFetch(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier);
-
</del><span class="cx">     void didCreateWorkerContextProcessConnection(const IPC::Attachment&);
</span><span class="cx">     
</span><span class="cx">     void postMessageToServiceWorkerClient(const WebCore::ServiceWorkerClientIdentifier& destinationIdentifier, WebCore::MessageWithMessagePorts&&, WebCore::ServiceWorkerIdentifier sourceIdentifier, const String& sourceOrigin);
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in    2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in       2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -149,13 +149,6 @@
</span><span class="cx">     SetCacheStorageParameters(PAL::SessionID sessionID, uint64_t quota, String cacheStorageDirectory, WebKit::SandboxExtension::Handle handle);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><del>-    DidNotHandleFetch(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, WebCore::FetchIdentifier fetchIdentifier)
-    DidFailFetch(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, WebCore::FetchIdentifier fetchIdentifier, WebCore::ResourceError error)
-    DidReceiveFetchRedirectResponse(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, WebCore::FetchIdentifier fetchIdentifier, WebCore::ResourceResponse response)
-    DidReceiveFetchResponse(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, WebCore::FetchIdentifier fetchIdentifier, WebCore::ResourceResponse response, bool needsContinueDidReceiveResponseMessage)
-    DidReceiveFetchData(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, WebCore::FetchIdentifier fetchIdentifier, IPC::SharedBufferDataReference data, int64_t encodedDataLength)
-    DidReceiveFetchFormData(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, WebCore::FetchIdentifier fetchIdentifier, IPC::FormDataReference data)
-    DidFinishFetch(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, WebCore::FetchIdentifier fetchIdentifier)
</del><span class="cx">     PostMessageToServiceWorkerClient(struct WebCore::ServiceWorkerClientIdentifier destinationIdentifier, struct WebCore::MessageWithMessagePorts message, WebCore::ServiceWorkerIdentifier sourceIdentifier, String sourceOrigin)
</span><span class="cx"> 
</span><span class="cx">     PostMessageToServiceWorker(WebCore::ServiceWorkerIdentifier destination, struct WebCore::MessageWithMessagePorts message, WebCore::ServiceWorkerOrClientIdentifier source, WebCore::SWServerConnectionIdentifier connectionIdentifier)
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessServiceWorkerServiceWorkerFetchTaskcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp (0 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp                              (rev 0)
+++ trunk/Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp 2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -0,0 +1,86 @@
</span><ins>+/*
+ * Copyright (C) 2019 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.
+ */
+
+#include "config.h"
+#include "ServiceWorkerFetchTask.h"
+
+#if ENABLE(SERVICE_WORKER)
+
+#include "Connection.h"
+#include "DataReference.h"
+#include "FormDataReference.h"
+#include "Logging.h"
+#include "ServiceWorkerClientFetchMessages.h"
+#include "WebCoreArgumentCoders.h"
+
+#define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(m_sessionID.isAlwaysOnLoggingAllowed(), ServiceWorker, "%p - ServiceWorkerFetchTask::" fmt, this, ##__VA_ARGS__)
+#define RELEASE_LOG_ERROR_IF_ALLOWED(fmt, ...) RELEASE_LOG_ERROR_IF(m_sessionID.isAlwaysOnLoggingAllowed(), ServiceWorker, "%p - ServiceWorkerFetchTask::" fmt, this, ##__VA_ARGS__)
+
+using namespace WebCore;
+
+namespace WebKit {
+
+void ServiceWorkerFetchTask::didReceiveRedirectResponse(const ResourceResponse& response)
+{
+    RELEASE_LOG_IF_ALLOWED("didReceiveRedirectResponse: %s", m_identifier.fetchIdentifier.loggingString().utf8().data());
+    m_connection->send(Messages::ServiceWorkerClientFetch::DidReceiveRedirectResponse { response }, m_identifier.fetchIdentifier.toUInt64());
+}
+
+void ServiceWorkerFetchTask::didReceiveResponse(const ResourceResponse& response, bool needsContinueDidReceiveResponseMessage)
+{
+    m_connection->send(Messages::ServiceWorkerClientFetch::DidReceiveResponse { response, needsContinueDidReceiveResponseMessage }, m_identifier.fetchIdentifier.toUInt64());
+}
+
+void ServiceWorkerFetchTask::didReceiveData(const IPC::DataReference& data, int64_t encodedDataLength)
+{
+    m_connection->send(Messages::ServiceWorkerClientFetch::DidReceiveData { data, encodedDataLength }, m_identifier.fetchIdentifier.toUInt64());
+}
+
+void ServiceWorkerFetchTask::didReceiveFormData(const IPC::FormDataReference& formData)
+{
+    m_connection->send(Messages::ServiceWorkerClientFetch::DidReceiveFormData { formData }, m_identifier.fetchIdentifier.toUInt64());
+}
+
+void ServiceWorkerFetchTask::didFinish()
+{
+    RELEASE_LOG_IF_ALLOWED("didFinishFetch: fetchIdentifier: %s", m_identifier.fetchIdentifier.loggingString().utf8().data());
+    m_connection->send(Messages::ServiceWorkerClientFetch::DidFinish { }, m_identifier.fetchIdentifier.toUInt64());
+}
+
+void ServiceWorkerFetchTask::didFail(const ResourceError& error)
+{
+    RELEASE_LOG_ERROR_IF_ALLOWED("didFailFetch: fetchIdentifier: %s", m_identifier.fetchIdentifier.loggingString().utf8().data());
+    m_connection->send(Messages::ServiceWorkerClientFetch::DidFail { error }, m_identifier.fetchIdentifier.toUInt64());
+}
+
+void ServiceWorkerFetchTask::didNotHandle()
+{
+    RELEASE_LOG_IF_ALLOWED("didNotHandleFetch: fetchIdentifier: %s", m_identifier.fetchIdentifier.loggingString().utf8().data());
+    m_connection->send(Messages::ServiceWorkerClientFetch::DidNotHandle { }, m_identifier.fetchIdentifier.toUInt64());
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(SERVICE_WORKER)
</ins></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessServiceWorkerServiceWorkerFetchTaskh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h (0 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h                                (rev 0)
+++ trunk/Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h   2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -0,0 +1,121 @@
</span><ins>+/*
+ * Copyright (C) 2019 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.
+ */
+
+#pragma once
+
+#if ENABLE(SERVICE_WORKER)
+
+#include <WebCore/FetchIdentifier.h>
+#include <WebCore/ServiceWorkerTypes.h>
+#include <pal/SessionID.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+class ResourceError;
+class ResourceResponse;
+}
+
+namespace IPC {
+class Connection;
+class DataReference;
+class Decoder;
+class FormDataReference;
+}
+
+namespace WebKit {
+
+class ServiceWorkerFetchTask : public RefCounted<ServiceWorkerFetchTask> {
+public:
+    static Ref<ServiceWorkerFetchTask> create(PAL::SessionID sessionID, Ref<IPC::Connection>&& connection, WebCore::SWServerConnectionIdentifier connectionIdentifier, WebCore::FetchIdentifier fetchIdentifier) { return adoptRef(*new ServiceWorkerFetchTask(sessionID, WTFMove(connection), connectionIdentifier, fetchIdentifier)); }
+
+    void fail(const WebCore::ResourceError& error) { didFail(error); }
+    void didReceiveMessage(IPC::Connection&, IPC::Decoder&);
+
+    struct Identifier {
+        WebCore::SWServerConnectionIdentifier connectionIdentifier;
+        WebCore::FetchIdentifier fetchIdentifier;
+        
+        unsigned hash() const
+        {
+            unsigned hashes[2];
+            hashes[0] = WTF::intHash(connectionIdentifier.toUInt64());
+            hashes[1] = WTF::intHash(fetchIdentifier.toUInt64());
+            return StringHasher::hashMemory(hashes, sizeof(hashes));
+        }
+    };
+
+    const Identifier& identifier() const { return m_identifier; }
+
+private:
+    ServiceWorkerFetchTask(PAL::SessionID sessionID, Ref<IPC::Connection>&& connection, WebCore::SWServerConnectionIdentifier connectionIdentifier, WebCore::FetchIdentifier fetchIdentifier)
+        : m_sessionID(sessionID)
+        , m_connection(WTFMove(connection))
+        , m_identifier { connectionIdentifier, fetchIdentifier }
+    { }
+
+    void didReceiveRedirectResponse(const WebCore::ResourceResponse&);
+    void didReceiveResponse(const WebCore::ResourceResponse&, bool needsContinueDidReceiveResponseMessage);
+    void didReceiveData(const IPC::DataReference&, int64_t encodedDataLength);
+    void didReceiveFormData(const IPC::FormDataReference&);
+    void didFinish();
+    void didFail(const WebCore::ResourceError&);
+    void didNotHandle();
+
+    PAL::SessionID m_sessionID;
+    Ref<IPC::Connection> m_connection;
+    Identifier m_identifier;
+};
+
+inline bool operator==(const ServiceWorkerFetchTask::Identifier& a, const ServiceWorkerFetchTask::Identifier& b)
+{
+    return a.connectionIdentifier == b.connectionIdentifier &&  a.fetchIdentifier == b.fetchIdentifier;
+}
+
+} // namespace WebKit
+
+
+namespace WTF {
+
+struct ServiceWorkerFetchTaskIdentifierHash {
+    static unsigned hash(const WebKit::ServiceWorkerFetchTask::Identifier& key) { return key.hash(); }
+    static bool equal(const WebKit::ServiceWorkerFetchTask::Identifier& a, const WebKit::ServiceWorkerFetchTask::Identifier& b) { return a == b; }
+    static const bool safeToCompareToEmptyOrDeleted = true;
+};
+
+template<> struct HashTraits<WebKit::ServiceWorkerFetchTask::Identifier> : GenericHashTraits<WebKit::ServiceWorkerFetchTask::Identifier> {
+    static WebKit::ServiceWorkerFetchTask::Identifier emptyValue() { return { }; }
+    
+    static void constructDeletedValue(WebKit::ServiceWorkerFetchTask::Identifier& slot) { slot.connectionIdentifier = makeObjectIdentifier<WebCore::SWServerConnectionIdentifierType>(std::numeric_limits<uint64_t>::max()); }
+    
+    static bool isDeletedValue(const WebKit::ServiceWorkerFetchTask::Identifier& slot) { return slot.connectionIdentifier.toUInt64() == std::numeric_limits<uint64_t>::max(); }
+};
+
+template<> struct DefaultHash<WebKit::ServiceWorkerFetchTask::Identifier> {
+    using Hash = ServiceWorkerFetchTaskIdentifierHash;
+};
+
+}
+
+#endif // ENABLE(SERVICE_WORKER)
</ins></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessServiceWorkerServiceWorkerFetchTaskmessagesin"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in (0 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in                              (rev 0)
+++ trunk/Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in 2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+# Copyright (C) 2019 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.
+
+#if ENABLE(SERVICE_WORKER)
+
+messages -> ServiceWorkerFetchTask {
+    DidNotHandle()
+    DidFail(WebCore::ResourceError error)
+    DidReceiveRedirectResponse(WebCore::ResourceResponse response)
+    DidReceiveResponse(WebCore::ResourceResponse response, bool needsContinueDidReceiveResponseMessage)
+    DidReceiveData(IPC::SharedBufferDataReference data, int64_t encodedDataLength)
+    DidReceiveFormData(IPC::FormDataReference data)
+    DidFinish()
+}
+
+#endif // ENABLE(SERVICE_WORKER)
</ins></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessServiceWorkerWebSWServerConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp       2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp  2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -128,6 +128,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebSWServerConnection::cancelFetch(ServiceWorkerRegistrationIdentifier serviceWorkerRegistrationIdentifier, FetchIdentifier fetchIdentifier)
</span><span class="cx"> {
</span><ins>+    SWSERVERCONNECTION_RELEASE_LOG_IF_ALLOWED("cancelFetch: %s", fetchIdentifier.loggingString().utf8().data());
</ins><span class="cx">     auto* worker = server().activeWorkerFromRegistrationID(serviceWorkerRegistrationIdentifier);
</span><span class="cx">     if (!worker || !worker->isRunning())
</span><span class="cx">         return;
</span><span class="lines">@@ -135,7 +136,7 @@
</span><span class="cx">     auto serviceWorkerIdentifier = worker->identifier();
</span><span class="cx">     server().runServiceWorkerIfNecessary(serviceWorkerIdentifier, [weakThis = makeWeakPtr(this), this, serviceWorkerIdentifier, fetchIdentifier](auto* contextConnection) mutable {
</span><span class="cx">         if (weakThis && contextConnection)
</span><del>-            sendToContextProcess(*contextConnection, Messages::WebSWContextManagerConnection::CancelFetch { this->identifier(), serviceWorkerIdentifier, fetchIdentifier });
</del><ins>+            static_cast<WebSWServerToContextConnection&>(*contextConnection).cancelFetch(this->identifier(), fetchIdentifier, serviceWorkerIdentifier);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -148,7 +149,7 @@
</span><span class="cx">     auto serviceWorkerIdentifier = worker->identifier();
</span><span class="cx">     server().runServiceWorkerIfNecessary(serviceWorkerIdentifier, [weakThis = makeWeakPtr(this), this, serviceWorkerIdentifier, fetchIdentifier](auto* contextConnection) mutable {
</span><span class="cx">         if (weakThis && contextConnection)
</span><del>-            sendToContextProcess(*contextConnection, Messages::WebSWContextManagerConnection::ContinueDidReceiveFetchResponse { this->identifier(), serviceWorkerIdentifier, fetchIdentifier });
</del><ins>+            static_cast<WebSWServerToContextConnection&>(*contextConnection).continueDidReceiveFetchResponse(this->identifier(), fetchIdentifier, serviceWorkerIdentifier);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -187,7 +188,7 @@
</span><span class="cx"> 
</span><span class="cx">             if (contextConnection) {
</span><span class="cx">                 SWSERVERCONNECTION_RELEASE_LOG_IF_ALLOWED("startFetch: Starting fetch %s via service worker %s", fetchIdentifier.loggingString().utf8().data(), serviceWorkerIdentifier.loggingString().utf8().data());
</span><del>-                sendToContextProcess(*contextConnection, Messages::WebSWContextManagerConnection::StartFetch { this->identifier(), serviceWorkerIdentifier, fetchIdentifier, request, options, formData, referrer });
</del><ins>+                static_cast<WebSWServerToContextConnection&>(*contextConnection).startFetch(m_sessionID, m_contentConnection.get(), this->identifier(), fetchIdentifier, serviceWorkerIdentifier, request, options, formData, referrer);
</ins><span class="cx">             } else {
</span><span class="cx">                 SWSERVERCONNECTION_RELEASE_LOG_ERROR_IF_ALLOWED("startFetch: fetchIdentifier: %s DidNotHandle because failed to run service worker", fetchIdentifier.loggingString().utf8().data());
</span><span class="cx">                 m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidNotHandle { }, fetchIdentifier.toUInt64());
</span><span class="lines">@@ -243,44 +244,6 @@
</span><span class="cx">     server().scheduleJob(WTFMove(jobData));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebSWServerConnection::didReceiveFetchRedirectResponse(FetchIdentifier fetchIdentifier, const ResourceResponse& response)
-{
-    m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidReceiveRedirectResponse { response }, fetchIdentifier.toUInt64());
-}
-
-void WebSWServerConnection::didReceiveFetchResponse(FetchIdentifier fetchIdentifier, const ResourceResponse& response, bool needsContinueDidReceiveResponseMessage)
-{
-    m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidReceiveResponse { response, needsContinueDidReceiveResponseMessage }, fetchIdentifier.toUInt64());
-}
-
-void WebSWServerConnection::didReceiveFetchData(FetchIdentifier fetchIdentifier, const IPC::DataReference& data, int64_t encodedDataLength)
-{
-    m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidReceiveData { data, encodedDataLength }, fetchIdentifier.toUInt64());
-}
-
-void WebSWServerConnection::didReceiveFetchFormData(FetchIdentifier fetchIdentifier, const IPC::FormDataReference& formData)
-{
-    m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidReceiveFormData { formData }, fetchIdentifier.toUInt64());
-}
-
-void WebSWServerConnection::didFinishFetch(FetchIdentifier fetchIdentifier)
-{
-    SWSERVERCONNECTION_RELEASE_LOG_IF_ALLOWED("didFinishFetch: fetchIdentifier: %s", fetchIdentifier.loggingString().utf8().data());
-    m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidFinish { }, fetchIdentifier.toUInt64());
-}
-
-void WebSWServerConnection::didFailFetch(FetchIdentifier fetchIdentifier, const ResourceError& error)
-{
-    SWSERVERCONNECTION_RELEASE_LOG_ERROR_IF_ALLOWED("didFailFetch: fetchIdentifier: %s", fetchIdentifier.loggingString().utf8().data());
-    m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidFail { error }, fetchIdentifier.toUInt64());
-}
-
-void WebSWServerConnection::didNotHandleFetch(FetchIdentifier fetchIdentifier)
-{
-    SWSERVERCONNECTION_RELEASE_LOG_IF_ALLOWED("didNotHandleFetch: fetchIdentifier: %s", fetchIdentifier.loggingString().utf8().data());
-    m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidNotHandle { }, fetchIdentifier.toUInt64());
-}
-
</del><span class="cx"> void WebSWServerConnection::postMessageToServiceWorkerClient(DocumentIdentifier destinationContextIdentifier, MessageWithMessagePorts&& message, ServiceWorkerIdentifier sourceIdentifier, const String& sourceOrigin)
</span><span class="cx"> {
</span><span class="cx">     auto* sourceServiceWorker = server().workerByID(sourceIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessServiceWorkerWebSWServerConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h 2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h    2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "MessageReceiver.h"
</span><span class="cx"> #include "MessageSender.h"
</span><ins>+#include "ServiceWorkerFetchTask.h"
</ins><span class="cx"> #include <WebCore/FetchIdentifier.h>
</span><span class="cx"> #include <WebCore/SWServer.h>
</span><span class="cx"> #include <pal/SessionID.h>
</span><span class="lines">@@ -63,14 +64,6 @@
</span><span class="cx"> 
</span><span class="cx">     PAL::SessionID sessionID() const { return m_sessionID; }
</span><span class="cx"> 
</span><del>-    void didReceiveFetchRedirectResponse(WebCore::FetchIdentifier, const WebCore::ResourceResponse&);
-    void didReceiveFetchResponse(WebCore::FetchIdentifier, const WebCore::ResourceResponse&, bool needsContinueDidReceiveResponseMessage);
-    void didReceiveFetchData(WebCore::FetchIdentifier, const IPC::DataReference&, int64_t encodedDataLength);
-    void didReceiveFetchFormData(WebCore::FetchIdentifier, const IPC::FormDataReference&);
-    void didFinishFetch(WebCore::FetchIdentifier);
-    void didFailFetch(WebCore::FetchIdentifier, const WebCore::ResourceError&);
-    void didNotHandleFetch(WebCore::FetchIdentifier);
-
</del><span class="cx">     void postMessageToServiceWorkerClient(WebCore::DocumentIdentifier destinationContextIdentifier, WebCore::MessageWithMessagePorts&&, WebCore::ServiceWorkerIdentifier sourceServiceWorkerIdentifier, const String& sourceOrigin);
</span><span class="cx">     void postMessageToServiceWorker(WebCore::ServiceWorkerIdentifier destination, WebCore::MessageWithMessagePorts&&, const WebCore::ServiceWorkerOrClientIdentifier& source);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessServiceWorkerWebSWServerToContextConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp      2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp 2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -28,7 +28,10 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx"> 
</span><ins>+#include "FormDataReference.h"
</ins><span class="cx"> #include "NetworkProcess.h"
</span><ins>+#include "ServiceWorkerFetchTask.h"
+#include "ServiceWorkerFetchTaskMessages.h"
</ins><span class="cx"> #include "WebCoreArgumentCoders.h"
</span><span class="cx"> #include "WebSWContextManagerConnectionMessages.h"
</span><span class="cx"> #include <WebCore/ServiceWorkerContextData.h>
</span><span class="lines">@@ -57,7 +60,9 @@
</span><span class="cx"> 
</span><span class="cx"> void WebSWServerToContextConnection::connectionClosed()
</span><span class="cx"> {
</span><del>-    // FIXME: Do what here...?
</del><ins>+    auto fetches = WTFMove(m_ongoingFetches);
+    for (auto& fetch : fetches.values())
+        fetch->fail(ResourceError { errorDomainWebKitInternal, 0, { }, "Service Worker context closed"_s });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebSWServerToContextConnection::installServiceWorkerContext(const ServiceWorkerContextData& data, PAL::SessionID sessionID, const String& userAgent)
</span><span class="lines">@@ -115,6 +120,59 @@
</span><span class="cx">     send(Messages::WebSWContextManagerConnection::TerminateProcess());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebSWServerToContextConnection::startFetch(PAL::SessionID sessionID, Ref<IPC::Connection>&& contentConnection, WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier contentFetchIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier, const ResourceRequest& request, const FetchOptions& options, const IPC::FormDataReference& data, const String& referrer)
+{
+    auto fetchIdentifier = FetchIdentifier::generate();
+    
+    m_ongoingFetches.add(fetchIdentifier, ServiceWorkerFetchTask::create(sessionID, WTFMove(contentConnection), serverConnectionIdentifier, contentFetchIdentifier));
+
+    ASSERT(!m_ongoingFetchIdentifiers.contains({serverConnectionIdentifier, contentFetchIdentifier}));
+    m_ongoingFetchIdentifiers.add({serverConnectionIdentifier, contentFetchIdentifier}, fetchIdentifier);
+
+    send(Messages::WebSWContextManagerConnection::StartFetch { serverConnectionIdentifier, serviceWorkerIdentifier, fetchIdentifier, request, options, data, referrer });
+}
+
+void WebSWServerToContextConnection::cancelFetch(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier contentFetchIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier)
+{
+    auto iterator = m_ongoingFetchIdentifiers.find({ serverConnectionIdentifier, contentFetchIdentifier });
+    if (iterator == m_ongoingFetchIdentifiers.end())
+        return;
+
+    send(Messages::WebSWContextManagerConnection::CancelFetch { serverConnectionIdentifier, serviceWorkerIdentifier, iterator->value });
+
+    m_ongoingFetches.remove(iterator->value);
+    m_ongoingFetchIdentifiers.remove(iterator);
+}
+
+void WebSWServerToContextConnection::continueDidReceiveFetchResponse(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier contentFetchIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier)
+{
+    auto iterator = m_ongoingFetchIdentifiers.find({ serverConnectionIdentifier, contentFetchIdentifier });
+    if (iterator == m_ongoingFetchIdentifiers.end())
+        return;
+    
+    send(Messages::WebSWContextManagerConnection::ContinueDidReceiveFetchResponse { serverConnectionIdentifier, serviceWorkerIdentifier, iterator->value });
+}
+
+void WebSWServerToContextConnection::didReceiveFetchTaskMessage(IPC::Connection& connection, IPC::Decoder& decoder)
+{
+    auto iterator = m_ongoingFetches.find(makeObjectIdentifier<FetchIdentifierType>(decoder.destinationID()));
+    if (iterator == m_ongoingFetches.end())
+        return;
+    
+    bool shouldRemove = decoder.messageName() == Messages::ServiceWorkerFetchTask::DidFail::name()
+        || decoder.messageName() == Messages::ServiceWorkerFetchTask::DidNotHandle::name()
+        || decoder.messageName() == Messages::ServiceWorkerFetchTask::DidFinish::name()
+        || decoder.messageName() == Messages::ServiceWorkerFetchTask::DidReceiveRedirectResponse::name();
+
+    iterator->value->didReceiveMessage(connection, decoder);
+
+    if (shouldRemove) {
+        ASSERT(m_ongoingFetchIdentifiers.contains(iterator->value->identifier()));
+        m_ongoingFetchIdentifiers.remove(iterator->value->identifier());
+        m_ongoingFetches.remove(iterator);
+    }
+}
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(SERVICE_WORKER)
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessServiceWorkerWebSWServerToContextConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h        2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h   2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -29,8 +29,22 @@
</span><span class="cx"> 
</span><span class="cx"> #include "MessageReceiver.h"
</span><span class="cx"> #include "MessageSender.h"
</span><ins>+#include "ServiceWorkerFetchTask.h"
</ins><span class="cx"> #include <WebCore/SWServerToContextConnection.h>
</span><span class="cx"> 
</span><ins>+namespace WebCore {
+struct FetchOptions;
+class ResourceRequest;
+}
+
+namespace IPC {
+class FormDataReference;
+}
+
+namespace PAL {
+class SessionID;
+}
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> class NetworkProcess;
</span><span class="lines">@@ -51,6 +65,12 @@
</span><span class="cx"> 
</span><span class="cx">     void terminate();
</span><span class="cx"> 
</span><ins>+    void startFetch(PAL::SessionID, Ref<IPC::Connection>&&, WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier, WebCore::ServiceWorkerIdentifier, const WebCore::ResourceRequest&, const WebCore::FetchOptions&, const IPC::FormDataReference&, const String&);
+    void cancelFetch(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier, WebCore::ServiceWorkerIdentifier);
+    void continueDidReceiveFetchResponse(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier, WebCore::ServiceWorkerIdentifier);
+
+    void didReceiveFetchTaskMessage(IPC::Connection&, IPC::Decoder&);
+
</ins><span class="cx"> private:
</span><span class="cx">     WebSWServerToContextConnection(NetworkProcess&, const WebCore::SecurityOriginData&, Ref<IPC::Connection>&&);
</span><span class="cx">     ~WebSWServerToContextConnection();
</span><span class="lines">@@ -75,6 +95,8 @@
</span><span class="cx">     Ref<IPC::Connection> m_ipcConnection;
</span><span class="cx">     Ref<NetworkProcess> m_networkProcess;
</span><span class="cx">     
</span><ins>+    HashMap<ServiceWorkerFetchTask::Identifier, WebCore::FetchIdentifier> m_ongoingFetchIdentifiers;
+    HashMap<WebCore::FetchIdentifier, Ref<ServiceWorkerFetchTask>> m_ongoingFetches;
</ins><span class="cx"> }; // class WebSWServerToContextConnection
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Sources.txt (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Sources.txt  2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/Sources.txt     2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx"> 
</span><span class="cx"> NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp
</span><span class="cx"> 
</span><ins>+NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp @no-unify
</ins><span class="cx"> NetworkProcess/ServiceWorker/WebSWOriginStore.cpp @no-unify
</span><span class="cx"> NetworkProcess/ServiceWorker/WebSWServerConnection.cpp @no-unify
</span><span class="cx"> NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp @no-unify
</span></span></pre></div>
<a id="trunkSourceWebKitSourcesCocoatxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/SourcesCocoa.txt (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/SourcesCocoa.txt     2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/SourcesCocoa.txt        2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -576,5 +576,5 @@
</span><span class="cx"> WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm
</span><span class="cx"> 
</span><span class="cx"> // Derived Sources
</span><del>-
</del><span class="cx"> EditableImageControllerMessageReceiver.cpp
</span><ins>+ServiceWorkerFetchTaskMessageReceiver.cpp
</ins></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj     2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -889,6 +889,7 @@
</span><span class="cx">          41DC45961E3D6E2200B11F51 /* NetworkRTCProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 41DC45941E3D6E1E00B11F51 /* NetworkRTCProvider.h */; };
</span><span class="cx">          41DC459C1E3DBB2800B11F51 /* LibWebRTCSocketClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 41DC459A1E3DBB2400B11F51 /* LibWebRTCSocketClient.h */; };
</span><span class="cx">          41DC459F1E3DBDA500B11F51 /* WebRTCSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 41FAF5F31E3BFE7F001AE678 /* WebRTCSocket.h */; };
</span><ins>+               41DE7C6C22278F1E00532B65 /* ServiceWorkerFetchTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41518536222704F6005430C6 /* ServiceWorkerFetchTask.cpp */; };
</ins><span class="cx">           41FABD2A1F4DE001006A6C97 /* CacheStorageEngineCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 41FABD281F4DDFDC006A6C97 /* CacheStorageEngineCache.h */; };
</span><span class="cx">          41FAF5F51E3C0649001AE678 /* WebRTCResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 41FAF5F41E3C0641001AE678 /* WebRTCResolver.h */; };
</span><span class="cx">          41FAF5F81E3C1021001AE678 /* LibWebRTCResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 41FAF5F61E3C0B47001AE678 /* LibWebRTCResolver.h */; };
</span><span class="lines">@@ -3039,6 +3040,9 @@
</span><span class="cx">          414DD37820BF43EA006959FB /* com.cisco.webex.plugin.gpc64.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.cisco.webex.plugin.gpc64.sb; sourceTree = "<group>"; };
</span><span class="cx">          414DEDD51F9EDDDF0047C40D /* ServiceWorkerProcessProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceWorkerProcessProxy.h; sourceTree = "<group>"; };
</span><span class="cx">          414DEDD61F9EDDE00047C40D /* ServiceWorkerProcessProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceWorkerProcessProxy.cpp; sourceTree = "<group>"; };
</span><ins>+               41518535222704F5005430C6 /* ServiceWorkerFetchTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceWorkerFetchTask.h; sourceTree = "<group>"; };
+               41518536222704F6005430C6 /* ServiceWorkerFetchTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceWorkerFetchTask.cpp; sourceTree = "<group>"; };
+               4151853822270F53005430C6 /* ServiceWorkerFetchTask.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ServiceWorkerFetchTask.messages.in; sourceTree = "<group>"; };
</ins><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><span class="lines">@@ -7032,6 +7036,9 @@
</span><span class="cx">          93BA04D92151ADCD007F455F /* ServiceWorker */ = {
</span><span class="cx">                  isa = PBXGroup;
</span><span class="cx">                  children = (
</span><ins>+                               41518536222704F6005430C6 /* ServiceWorkerFetchTask.cpp */,
+                               41518535222704F5005430C6 /* ServiceWorkerFetchTask.h */,
+                               4151853822270F53005430C6 /* ServiceWorkerFetchTask.messages.in */,
</ins><span class="cx">                           93BA04DF2151ADF4007F455F /* WebSWOriginStore.cpp */,
</span><span class="cx">                          93BA04DE2151ADF4007F455F /* WebSWOriginStore.h */,
</span><span class="cx">                          93BA04E12151ADF4007F455F /* WebSWServerConnection.cpp */,
</span><span class="lines">@@ -11045,6 +11052,7 @@
</span><span class="cx">                          2D8508C6212E33ED000EF46C /* UnifiedSource97.cpp in Sources */,
</span><span class="cx">                          2D8508D8212E33ED000EF46C /* UnifiedSource98.cpp in Sources */,
</span><span class="cx">                          2D8508C5212E33ED000EF46C /* UnifiedSource99.cpp in Sources */,
</span><ins>+                               41DE7C6C22278F1E00532B65 /* ServiceWorkerFetchTask.cpp in Sources */,
</ins><span class="cx">                           2D8508D2212E33ED000EF46C /* UnifiedSource100.cpp in Sources */,
</span><span class="cx">                          CD491B0D1E732E4D00009066 /* UserMediaCaptureManagerMessageReceiver.cpp in Sources */,
</span><span class="cx">                          CD491B171E73525500009066 /* UserMediaCaptureManagerProxyMessageReceiver.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessStorageWebSWContextManagerConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp 2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp    2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include "FormDataReference.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "NetworkProcessMessages.h"
</span><ins>+#include "ServiceWorkerFetchTaskMessages.h"
</ins><span class="cx"> #include "WebCacheStorageProvider.h"
</span><span class="cx"> #include "WebCoreArgumentCoders.h"
</span><span class="cx"> #include "WebDatabaseProvider.h"
</span><span class="lines">@@ -225,12 +226,12 @@
</span><span class="cx"> {
</span><span class="cx">     auto* serviceWorkerThreadProxy = SWContextManager::singleton().serviceWorkerThreadProxy(serviceWorkerIdentifier);
</span><span class="cx">     if (!serviceWorkerThreadProxy) {
</span><del>-        m_connectionToNetworkProcess->send(Messages::NetworkProcess::DidNotHandleFetch { serverConnectionIdentifier, fetchIdentifier }, 0);
</del><ins>+        m_connectionToNetworkProcess->send(Messages::ServiceWorkerFetchTask::DidNotHandle { }, fetchIdentifier.toUInt64());
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!isValidFetch(request, options, serviceWorkerThreadProxy->scriptURL(), referrer)) {
</span><del>-        m_connectionToNetworkProcess->send(Messages::NetworkProcess::DidNotHandleFetch { serverConnectionIdentifier, fetchIdentifier }, 0);
</del><ins>+        m_connectionToNetworkProcess->send(Messages::ServiceWorkerFetchTask::DidNotHandle { }, fetchIdentifier.toUInt64());
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessStorageWebServiceWorkerFetchTaskClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp (242502 => 242503)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp       2019-03-05 21:38:27 UTC (rev 242502)
+++ trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp  2019-03-05 21:49:28 UTC (rev 242503)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (!m_connection)
</span><span class="cx">         return;
</span><del>-    m_connection->send(Messages::NetworkProcess::DidReceiveFetchRedirectResponse { m_serverConnectionIdentifier, m_fetchIdentifier, response }, 0);
</del><ins>+    m_connection->send(Messages::ServiceWorkerFetchTask::DidReceiveRedirectResponse { response }, m_fetchIdentifier.toUInt64());
</ins><span class="cx"> 
</span><span class="cx">     cleanup();
</span><span class="cx"> }
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx">     if (m_needsContinueDidReceiveResponseMessage)
</span><span class="cx">         m_waitingForContinueDidReceiveResponseMessage = true;
</span><span class="cx"> 
</span><del>-    m_connection->send(Messages::NetworkProcess::DidReceiveFetchResponse { m_serverConnectionIdentifier, m_fetchIdentifier, response, m_needsContinueDidReceiveResponseMessage }, 0);
</del><ins>+    m_connection->send(Messages::ServiceWorkerFetchTask::DidReceiveResponse { response, m_needsContinueDidReceiveResponseMessage }, m_fetchIdentifier.toUInt64());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebServiceWorkerFetchTaskClient::didReceiveData(Ref<SharedBuffer>&& buffer)
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_connection->send(Messages::NetworkProcess::DidReceiveFetchData { m_serverConnectionIdentifier, m_fetchIdentifier, { buffer }, static_cast<int64_t>(buffer->size()) }, 0);
</del><ins>+    m_connection->send(Messages::ServiceWorkerFetchTask::DidReceiveData { { buffer }, static_cast<int64_t>(buffer->size()) }, m_fetchIdentifier.toUInt64());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish(Ref<FormData>&& formData)
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx">     // For now and for the case of blobs, we read it there and send the data through IPC.
</span><span class="cx">     URL blobURL = formData->asBlobURL();
</span><span class="cx">     if (blobURL.isNull()) {
</span><del>-        m_connection->send(Messages::NetworkProcess::DidReceiveFetchFormData { m_serverConnectionIdentifier, m_fetchIdentifier, IPC::FormDataReference { WTFMove(formData) } }, 0);
</del><ins>+        m_connection->send(Messages::ServiceWorkerFetchTask::DidReceiveFormData { IPC::FormDataReference { WTFMove(formData) } }, m_fetchIdentifier.toUInt64());
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx">     if (!m_connection)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_connection->send(Messages::NetworkProcess::DidReceiveFetchData { m_serverConnectionIdentifier, m_fetchIdentifier, { reinterpret_cast<const uint8_t*>(data), size }, static_cast<int64_t>(size) }, 0);
</del><ins>+    m_connection->send(Messages::ServiceWorkerFetchTask::DidReceiveData { { reinterpret_cast<const uint8_t*>(data), size }, static_cast<int64_t>(size) }, m_fetchIdentifier.toUInt64());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebServiceWorkerFetchTaskClient::didFinishBlobLoading()
</span><span class="lines">@@ -149,7 +149,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_connection->send(Messages::NetworkProcess::DidFailFetch { m_serverConnectionIdentifier, m_fetchIdentifier, error }, 0);
</del><ins>+    m_connection->send(Messages::ServiceWorkerFetchTask::DidFail { error }, m_fetchIdentifier.toUInt64());
</ins><span class="cx"> 
</span><span class="cx">     cleanup();
</span><span class="cx"> }
</span><span class="lines">@@ -164,7 +164,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_connection->send(Messages::NetworkProcess::DidFinishFetch { m_serverConnectionIdentifier, m_fetchIdentifier }, 0);
</del><ins>+    m_connection->send(Messages::ServiceWorkerFetchTask::DidFinish { }, m_fetchIdentifier.toUInt64());
</ins><span class="cx"> 
</span><span class="cx">     cleanup();
</span><span class="cx"> }
</span><span class="lines">@@ -174,7 +174,7 @@
</span><span class="cx">     if (!m_connection)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_connection->send(Messages::NetworkProcess::DidNotHandleFetch { m_serverConnectionIdentifier, m_fetchIdentifier }, 0);
</del><ins>+    m_connection->send(Messages::ServiceWorkerFetchTask::DidNotHandle { }, m_fetchIdentifier.toUInt64());
</ins><span class="cx"> 
</span><span class="cx">     cleanup();
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>