<!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>[224889] trunk/Source</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/224889">224889</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2017-11-15 11:28:03 -0800 (Wed, 15 Nov 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add ServiceWorker to WebProcess plumbery for FormData fetch responses
https://bugs.webkit.org/show_bug.cgi?id=179694

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-15
Reviewed by Alex Christensen.

Source/WebCore:

No observable changes since we are not actually loading FormData right now.

* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):
* workers/service/context/ServiceWorkerFetch.h:

Source/WebKit:

Added plumbery from Service Worker up to Web Process to pass form data response bodies.
A follow-up patch should read the data from Network Process and send it to the ResourceLoader.

* Platform/IPC/FormDataReference.h: Added.
(IPC::FormDataReference::FormDataReference):
(IPC::FormDataReference::takeData):
(IPC::FormDataReference::encode const):
(IPC::FormDataReference::decode):
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::didReceiveFetchFormData):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didReceiveFetchFormData):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::didReceiveFormData):
* WebProcess/Storage/ServiceWorkerClientFetch.h:
* WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormData):
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreworkersservicecontextServiceWorkerFetchcpp">trunk/Source/WebCore/workers/service/context/ServiceWorkerFetch.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersservicecontextServiceWorkerFetchh">trunk/Source/WebCore/workers/service/context/ServiceWorkerFetch.h</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitStorageProcessServiceWorkerWebSWServerConnectioncpp">trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp</a></li>
<li><a href="#trunkSourceWebKitStorageProcessServiceWorkerWebSWServerConnectionh">trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h</a></li>
<li><a href="#trunkSourceWebKitStorageProcessStorageProcesscpp">trunk/Source/WebKit/StorageProcess/StorageProcess.cpp</a></li>
<li><a href="#trunkSourceWebKitStorageProcessStorageProcessh">trunk/Source/WebKit/StorageProcess/StorageProcess.h</a></li>
<li><a href="#trunkSourceWebKitStorageProcessStorageProcessmessagesin">trunk/Source/WebKit/StorageProcess/StorageProcess.messages.in</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKitWebProcessStorageServiceWorkerClientFetchcpp">trunk/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessStorageServiceWorkerClientFetchh">trunk/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessStorageServiceWorkerClientFetchmessagesin">trunk/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.messages.in</a></li>
<li><a href="#trunkSourceWebKitWebProcessStorageWebServiceWorkerFetchTaskClientcpp">trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessStorageWebServiceWorkerFetchTaskClienth">trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitPlatformIPCFormDataReferenceh">trunk/Source/WebKit/Platform/IPC/FormDataReference.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (224888 => 224889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2017-11-15 19:22:44 UTC (rev 224888)
+++ trunk/Source/WebCore/ChangeLog      2017-11-15 19:28:03 UTC (rev 224889)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2017-11-15  Youenn Fablet  <youenn@apple.com>
+
+        Add ServiceWorker to WebProcess plumbery for FormData fetch responses
+        https://bugs.webkit.org/show_bug.cgi?id=179694
+
+        Reviewed by Alex Christensen.
+
+        No observable changes since we are not actually loading FormData right now.
+
+        * workers/service/context/ServiceWorkerFetch.cpp:
+        (WebCore::ServiceWorkerFetch::processResponse):
+        * workers/service/context/ServiceWorkerFetch.h:
+
</ins><span class="cx"> 2017-11-15  Jer Noble  <jer.noble@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Add a compile-time-checked string literal initializer for FourCC.
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersservicecontextServiceWorkerFetchcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/service/context/ServiceWorkerFetch.cpp (224888 => 224889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/service/context/ServiceWorkerFetch.cpp      2017-11-15 19:22:44 UTC (rev 224888)
+++ trunk/Source/WebCore/workers/service/context/ServiceWorkerFetch.cpp 2017-11-15 19:28:03 UTC (rev 224889)
</span><span class="lines">@@ -75,8 +75,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto body = response->consumeBody();
</span><del>-    WTF::switchOn(body, [] (Ref<FormData>&) {
-        // FIXME: Support FormData response bodies.
</del><ins>+    WTF::switchOn(body, [&] (Ref<FormData>& formData) {
+        client->didReceiveFormData(WTFMove(formData));
</ins><span class="cx">     }, [&] (Ref<SharedBuffer>& buffer) {
</span><span class="cx">         client->didReceiveData(WTFMove(buffer));
</span><span class="cx">     }, [] (std::nullptr_t&) {
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersservicecontextServiceWorkerFetchh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/service/context/ServiceWorkerFetch.h (224888 => 224889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/service/context/ServiceWorkerFetch.h        2017-11-15 19:22:44 UTC (rev 224888)
+++ trunk/Source/WebCore/workers/service/context/ServiceWorkerFetch.h   2017-11-15 19:28:03 UTC (rev 224889)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> class FetchEvent;
</span><span class="cx"> struct FetchOptions;
</span><span class="cx"> class FetchResponse;
</span><ins>+class FormData;
</ins><span class="cx"> class ResourceRequest;
</span><span class="cx"> class ResourceResponse;
</span><span class="cx"> class SharedBuffer;
</span><span class="lines">@@ -46,6 +47,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void didReceiveResponse(const ResourceResponse&) = 0;
</span><span class="cx">     virtual void didReceiveData(Ref<SharedBuffer>&&) = 0;
</span><ins>+    virtual void didReceiveFormData(Ref<FormData>&&) = 0;
</ins><span class="cx">     virtual void didFail() = 0;
</span><span class="cx">     virtual void didFinish() = 0;
</span><span class="cx">     virtual void didNotHandle() = 0;
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (224888 => 224889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2017-11-15 19:22:44 UTC (rev 224888)
+++ trunk/Source/WebKit/ChangeLog       2017-11-15 19:28:03 UTC (rev 224889)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2017-11-15  Youenn Fablet  <youenn@apple.com>
+
+        Add ServiceWorker to WebProcess plumbery for FormData fetch responses
+        https://bugs.webkit.org/show_bug.cgi?id=179694
+
+        Reviewed by Alex Christensen.
+
+        Added plumbery from Service Worker up to Web Process to pass form data response bodies.
+        A follow-up patch should read the data from Network Process and send it to the ResourceLoader.
+
+        * Platform/IPC/FormDataReference.h: Added.
+        (IPC::FormDataReference::FormDataReference):
+        (IPC::FormDataReference::takeData):
+        (IPC::FormDataReference::encode const):
+        (IPC::FormDataReference::decode):
+        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
+        (WebKit::WebSWServerConnection::didReceiveFetchFormData):
+        * StorageProcess/ServiceWorker/WebSWServerConnection.h:
+        * StorageProcess/StorageProcess.cpp:
+        (WebKit::StorageProcess::didReceiveFetchFormData):
+        * StorageProcess/StorageProcess.h:
+        * StorageProcess/StorageProcess.messages.in:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
+        (WebKit::ServiceWorkerClientFetch::didReceiveFormData):
+        * WebProcess/Storage/ServiceWorkerClientFetch.h:
+        * WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
+        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
+        (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormData):
+        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
+
</ins><span class="cx"> 2017-11-15  Alex Christensen  <achristensen@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Move a compiled WKContentRuleList to its destination before calling mmap
</span></span></pre></div>
<a id="trunkSourceWebKitPlatformIPCFormDataReferencehfromrev224888trunkSourceWebCoreworkersservicecontextServiceWorkerFetchh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/Platform/IPC/FormDataReference.h (from rev 224888, trunk/Source/WebCore/workers/service/context/ServiceWorkerFetch.h) (0 => 224889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Platform/IPC/FormDataReference.h                             (rev 0)
+++ trunk/Source/WebKit/Platform/IPC/FormDataReference.h        2017-11-15 19:28:03 UTC (rev 224889)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * 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.
+ */
+
+#pragma once
+
+#include "Decoder.h"
+#include "Encoder.h"
+#include <WebCore/FormData.h>
+#include <wtf/Vector.h>
+
+namespace IPC {
+
+class FormDataReference {
+public:
+    FormDataReference() = default;
+
+    explicit FormDataReference(Ref<WebCore::FormData>&& data)
+        : m_data(WTFMove(data))
+    {
+    }
+
+    Ref<WebCore::FormData> takeData() { return m_data.releaseNonNull(); }
+
+    void encode(Encoder& encoder) const { encoder << *m_data; }
+    static std::optional<FormDataReference> decode(Decoder& decoder)
+    {
+        auto formData = WebCore::FormData::decode(decoder);
+        if (!formData)
+            return std::nullopt;
+        return FormDataReference { formData.releaseNonNull() };
+    }
+
+private:
+    RefPtr<WebCore::FormData> m_data;
+};
+
+} // namespace IPC
</ins></span></pre></div>
<a id="trunkSourceWebKitStorageProcessServiceWorkerWebSWServerConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp (224888 => 224889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp       2017-11-15 19:22:44 UTC (rev 224888)
+++ trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp  2017-11-15 19:28:03 UTC (rev 224889)
</span><span class="lines">@@ -128,6 +128,11 @@
</span><span class="cx">     m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidReceiveData { data, encodedDataLength }, fetchIdentifier);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebSWServerConnection::didReceiveFetchFormData(uint64_t fetchIdentifier, const IPC::FormDataReference& formData)
+{
+    m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidReceiveFormData { formData }, fetchIdentifier);
+}
+
</ins><span class="cx"> void WebSWServerConnection::didFinishFetch(uint64_t fetchIdentifier)
</span><span class="cx"> {
</span><span class="cx">     m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidFinish { }, fetchIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebKitStorageProcessServiceWorkerWebSWServerConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h (224888 => 224889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h 2017-11-15 19:22:44 UTC (rev 224888)
+++ trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h    2017-11-15 19:28:03 UTC (rev 224889)
</span><span class="lines">@@ -32,6 +32,10 @@
</span><span class="cx"> #include <WebCore/SWServer.h>
</span><span class="cx"> #include <pal/SessionID.h>
</span><span class="cx"> 
</span><ins>+namespace IPC {
+class FormDataReference;
+}
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> struct ExceptionData;
</span><span class="cx"> struct ServiceWorkerClientData;
</span><span class="lines">@@ -53,6 +57,7 @@
</span><span class="cx"> 
</span><span class="cx">     void didReceiveFetchResponse(uint64_t fetchIdentifier, const WebCore::ResourceResponse&);
</span><span class="cx">     void didReceiveFetchData(uint64_t fetchIdentifier, const IPC::DataReference&, int64_t encodedDataLength);
</span><ins>+    void didReceiveFetchFormData(uint64_t fetchIdentifier, const IPC::FormDataReference&);
</ins><span class="cx">     void didFinishFetch(uint64_t fetchIdentifier);
</span><span class="cx">     void didFailFetch(uint64_t fetchIdentifier);
</span><span class="cx">     void didNotHandleFetch(uint64_t fetchIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebKitStorageProcessStorageProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/StorageProcess/StorageProcess.cpp (224888 => 224889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/StorageProcess/StorageProcess.cpp    2017-11-15 19:22:44 UTC (rev 224888)
+++ trunk/Source/WebKit/StorageProcess/StorageProcess.cpp       2017-11-15 19:28:03 UTC (rev 224889)
</span><span class="lines">@@ -434,6 +434,12 @@
</span><span class="cx">         connection->didReceiveFetchData(fetchIdentifier, data, encodedDataLength);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void StorageProcess::didReceiveFetchFormData(uint64_t serverConnectionIdentifier, uint64_t fetchIdentifier, const IPC::FormDataReference& formData)
+{
+    if (auto* connection = m_swServerConnections.get(serverConnectionIdentifier))
+        connection->didReceiveFetchFormData(fetchIdentifier, formData);
+}
+
</ins><span class="cx"> void StorageProcess::didFinishFetch(uint64_t serverConnectionIdentifier, uint64_t fetchIdentifier)
</span><span class="cx"> {
</span><span class="cx">     if (auto* connection = m_swServerConnections.get(serverConnectionIdentifier))
</span></span></pre></div>
<a id="trunkSourceWebKitStorageProcessStorageProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/StorageProcess/StorageProcess.h (224888 => 224889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/StorageProcess/StorageProcess.h      2017-11-15 19:22:44 UTC (rev 224888)
+++ trunk/Source/WebKit/StorageProcess/StorageProcess.h 2017-11-15 19:28:03 UTC (rev 224889)
</span><span class="lines">@@ -35,6 +35,10 @@
</span><span class="cx"> #include <wtf/CrossThreadTask.h>
</span><span class="cx"> #include <wtf/Function.h>
</span><span class="cx"> 
</span><ins>+namespace IPC {
+class FormDataReference;
+}
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> class SWServer;
</span><span class="cx"> struct SecurityOriginData;
</span><span class="lines">@@ -122,6 +126,7 @@
</span><span class="cx"> 
</span><span class="cx">     void didReceiveFetchResponse(uint64_t serverConnectionIdentifier, uint64_t fetchIdentifier, const WebCore::ResourceResponse&);
</span><span class="cx">     void didReceiveFetchData(uint64_t serverConnectionIdentifier, uint64_t fetchIdentifier, const IPC::DataReference&, int64_t encodedDataLength);
</span><ins>+    void didReceiveFetchFormData(uint64_t serverConnectionIdentifier, uint64_t fetchIdentifier, const IPC::FormDataReference&);
</ins><span class="cx">     void didFinishFetch(uint64_t serverConnectionIdentifier, uint64_t fetchIdentifier);
</span><span class="cx">     void didFailFetch(uint64_t serverConnectionIdentifier, uint64_t fetchIdentifier);
</span><span class="cx">     void didNotHandleFetch(uint64_t serverConnectionIdentifier, uint64_t fetchIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebKitStorageProcessStorageProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/StorageProcess/StorageProcess.messages.in (224888 => 224889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/StorageProcess/StorageProcess.messages.in    2017-11-15 19:22:44 UTC (rev 224888)
+++ trunk/Source/WebKit/StorageProcess/StorageProcess.messages.in       2017-11-15 19:28:03 UTC (rev 224889)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx">     DidFailFetch(uint64_t serverConnectionIdentifier, uint64_t fetchIdentifier)
</span><span class="cx">     DidReceiveFetchResponse(uint64_t serverConnectionIdentifier, uint64_t fetchIdentifier, WebCore::ResourceResponse response)
</span><span class="cx">     DidReceiveFetchData(uint64_t serverConnectionIdentifier, uint64_t fetchIdentifier, IPC::DataReference data, int64_t encodedDataLength)
</span><ins>+    DidReceiveFetchFormData(uint64_t serverConnectionIdentifier, uint64_t fetchIdentifier, IPC::FormDataReference data)
</ins><span class="cx">     DidFinishFetch(uint64_t serverConnectionIdentifier, uint64_t fetchIdentifier)
</span><span class="cx">     PostMessageToServiceWorkerClient(struct WebCore::ServiceWorkerClientIdentifier destinationIdentifier, IPC::DataReference message, WebCore::ServiceWorkerIdentifier sourceIdentifier, String sourceOrigin)
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (224888 => 224889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj     2017-11-15 19:22:44 UTC (rev 224888)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2017-11-15 19:28:03 UTC (rev 224889)
</span><span class="lines">@@ -3222,6 +3222,7 @@
</span><span class="cx">          414DEDC51F9E4BEC0047C40D /* ServiceWorkerFrameLoaderClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceWorkerFrameLoaderClient.cpp; 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>+               4151E5C31FBB90A900E47E2D /* FormDataReference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormDataReference.h; sourceTree = "<group>"; };
</ins><span class="cx">           41897ECB1F415D5C0016FA42 /* WebCacheStorageConnection.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebCacheStorageConnection.messages.in; sourceTree = "<group>"; };
</span><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="lines">@@ -5404,6 +5405,7 @@
</span><span class="cx">                          BC032D9E10F437D10058C15A /* Decoder.h */,
</span><span class="cx">                          BC032D9F10F437D10058C15A /* Encoder.cpp */,
</span><span class="cx">                          BC032DA010F437D10058C15A /* Encoder.h */,
</span><ins>+                               4151E5C31FBB90A900E47E2D /* FormDataReference.h */,
</ins><span class="cx">                           C0CE72AC1247E78D00BC0EC4 /* HandleMessage.h */,
</span><span class="cx">                          1AC4C82816B876A90069DCCD /* MessageFlags.h */,
</span><span class="cx">                          1A3EED11161A53D600AEB4F5 /* MessageReceiver.h */,
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessStorageServiceWorkerClientFetchcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp (224888 => 224889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp      2017-11-15 19:22:44 UTC (rev 224888)
+++ trunk/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp 2017-11-15 19:28:03 UTC (rev 224889)
</span><span class="lines">@@ -85,6 +85,11 @@
</span><span class="cx">     m_loader->didReceiveData(reinterpret_cast<const char*>(data.data()), data.size(), encodedDataLength, DataPayloadBytes);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ServiceWorkerClientFetch::didReceiveFormData(const IPC::FormDataReference&)
+{
+    // FIXME: Implement form data reading.
+}
+
</ins><span class="cx"> void ServiceWorkerClientFetch::didFinish()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!m_callback);
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessStorageServiceWorkerClientFetchh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.h (224888 => 224889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.h        2017-11-15 19:22:44 UTC (rev 224888)
+++ trunk/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.h   2017-11-15 19:28:03 UTC (rev 224889)
</span><span class="lines">@@ -27,6 +27,7 @@
</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 "MessageReceiver.h"
</span><span class="cx"> #include "MessageSender.h"
</span><span class="cx"> #include <WebCore/ResourceLoader.h>
</span><span class="lines">@@ -56,6 +57,7 @@
</span><span class="cx"> 
</span><span class="cx">     void didReceiveResponse(WebCore::ResourceResponse&&);
</span><span class="cx">     void didReceiveData(const IPC::DataReference&, int64_t encodedDataLength);
</span><ins>+    void didReceiveFormData(const IPC::FormDataReference&);
</ins><span class="cx">     void didFinish();
</span><span class="cx">     void didFail();
</span><span class="cx">     void didNotHandle();
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessStorageServiceWorkerClientFetchmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.messages.in (224888 => 224889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.messages.in      2017-11-15 19:22:44 UTC (rev 224888)
+++ trunk/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.messages.in 2017-11-15 19:28:03 UTC (rev 224889)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> messages -> ServiceWorkerClientFetch {
</span><span class="cx">     DidReceiveResponse(WebCore::ResourceResponse response)
</span><span class="cx">     DidReceiveData(IPC::DataReference data, int64_t encodedDataLength)
</span><ins>+    DidReceiveFormData(IPC::FormDataReference data)
</ins><span class="cx">     DidFinish()
</span><span class="cx">     DidFail()
</span><span class="cx">     DidNotHandle()
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessStorageWebServiceWorkerFetchTaskClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp (224888 => 224889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp       2017-11-15 19:22:44 UTC (rev 224888)
+++ trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp  2017-11-15 19:28:03 UTC (rev 224889)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx"> 
</span><span class="cx"> #include "DataReference.h"
</span><ins>+#include "FormDataReference.h"
</ins><span class="cx"> #include "StorageProcessMessages.h"
</span><span class="cx"> #include "WebCoreArgumentCoders.h"
</span><span class="cx"> #include <WebCore/ResourceResponse.h>
</span><span class="lines">@@ -66,6 +67,14 @@
</span><span class="cx">     m_connection->send(Messages::StorageProcess::DidReceiveFetchData { m_serverConnectionIdentifier, m_fetchTaskIdentifier, dataReference, static_cast<int64_t>(buffer->size()) }, 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebServiceWorkerFetchTaskClient::didReceiveFormData(Ref<FormData>&& formData)
+{
+    if (!m_connection)
+        return;
+
+    m_connection->send(Messages::StorageProcess::DidReceiveFetchFormData { m_serverConnectionIdentifier, m_fetchTaskIdentifier, IPC::FormDataReference { WTFMove(formData) } }, 0);
+}
+
</ins><span class="cx"> void WebServiceWorkerFetchTaskClient::didFail()
</span><span class="cx"> {
</span><span class="cx">     if (!m_connection)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessStorageWebServiceWorkerFetchTaskClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h (224888 => 224889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h 2017-11-15 19:22:44 UTC (rev 224888)
+++ trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h    2017-11-15 19:28:03 UTC (rev 224889)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> 
</span><span class="cx">     void didReceiveResponse(const WebCore::ResourceResponse&) final;
</span><span class="cx">     void didReceiveData(Ref<WebCore::SharedBuffer>&&) final;
</span><ins>+    void didReceiveFormData(Ref<WebCore::FormData>&&) final;
</ins><span class="cx">     void didFail() final;
</span><span class="cx">     void didFinish() final;
</span><span class="cx">     void didNotHandle() final;
</span></span></pre>
</div>
</div>

</body>
</html>