WebKit Bugzilla
Attachment 359855 Details for
Bug 193710
: [SOUP] Remove libsoup cruft from WebProcess
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193710-20190123000534.patch (text/plain), 34.06 KB, created by
Michael Catanzaro
on 2019-01-22 22:05:35 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Michael Catanzaro
Created:
2019-01-22 22:05:35 PST
Size:
34.06 KB
patch
obsolete
>Subversion Revision: 240317 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index ad3bd102453dfda6b6c59b2e4e2ab76c16b4aff2..7791ad0239e7a3a8aaadcd2b4bd5b40a6deb7e2b 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,43 @@ >+2019-01-22 Michael Catanzaro <mcatanzaro@igalia.com> >+ >+ [SOUP] Remove libsoup cruft from WebProcess >+ https://bugs.webkit.org/show_bug.cgi?id=193710 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ SoupNetworkSession is no longer accessible from the web process because it's owned >+ (indirectly) by NetworkProcess after r240292. It doesn't make sense to have any libsoup >+ code under WebProcess anymore. The current libsoup code consists of (a) unused stuff to be >+ removed, (b) stuff unrelated to libsoup, which should move to a WebProcessGLib.cpp, and (c) >+ WebKitSoupRequestInputStream, which is only used by NetworkProcess and should move there >+ >+ * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.cpp. >+ (AsyncReadData::AsyncReadData): >+ (webkitSoupRequestInputStreamReadAsyncResultComplete): >+ (webkitSoupRequestInputStreamPendingReadAsyncComplete): >+ (webkitSoupRequestInputStreamHasDataToRead): >+ (webkitSoupRequestInputStreamIsWaitingForData): >+ (webkitSoupRequestInputStreamReadAsync): >+ (webkitSoupRequestInputStreamReadFinish): >+ (webkitSoupRequestInputStreamFinalize): >+ (webkit_soup_request_input_stream_init): >+ (webkit_soup_request_input_stream_class_init): >+ (webkitSoupRequestInputStreamNew): >+ (webkitSoupRequestInputStreamAddData): >+ (webkitSoupRequestInputStreamDidFailWithError): >+ (webkitSoupRequestInputStreamFinished): >+ * NetworkProcess/soup/WebKitSoupRequestInputStream.h: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.h. >+ * SourcesGTK.txt: >+ * SourcesWPE.txt: >+ * UIProcess/soup/WebProcessPoolSoup.cpp: >+ (WebKit::WebProcessPool::setNetworkProxySettings): Don't send message to web processes. >+ * WebProcess/WebProcess.h: >+ * WebProcess/WebProcess.messages.in: >+ * WebProcess/glib/WebProcessGLib.cpp: Renamed from Source/WebKit/WebProcess/soup/WebProcessSoup.cpp. >+ (WebKit::WebProcess::platformSetCacheModel): >+ (WebKit::WebProcess::platformInitializeWebProcess): >+ (WebKit::WebProcess::platformTerminate): >+ > 2019-01-22 Michael Catanzaro <mcatanzaro@igalia.com> > > Unreviewed attempt to fix GTK/WPE bots >diff --git a/Source/WebKit/NetworkProcess/soup/WebKitSoupRequestInputStream.cpp b/Source/WebKit/NetworkProcess/soup/WebKitSoupRequestInputStream.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..6ddc81a36d849cbc283793b617067a27e29d91f0 >--- /dev/null >+++ b/Source/WebKit/NetworkProcess/soup/WebKitSoupRequestInputStream.cpp >@@ -0,0 +1,182 @@ >+/* >+ * Copyright (C) 2012 Igalia S.L. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#include "config.h" >+#include "WebKitSoupRequestInputStream.h" >+ >+#include <wtf/MainThread.h> >+#include <wtf/RunLoop.h> >+#include <wtf/glib/GRefPtr.h> >+#include <wtf/glib/GUniquePtr.h> >+ >+struct AsyncReadData { >+ AsyncReadData(GRefPtr<GTask>&& task, void* buffer, gsize count) >+ : task(WTFMove(task)) >+ , buffer(buffer) >+ , count(count) >+ { >+ } >+ >+ GRefPtr<GTask> task; >+ void* buffer; >+ size_t count; >+}; >+ >+struct _WebKitSoupRequestInputStreamPrivate { >+ uint64_t contentLength; >+ uint64_t bytesReceived; >+ uint64_t bytesRead; >+ >+ GUniquePtr<GError> error; >+ >+ std::unique_ptr<AsyncReadData> pendingAsyncRead; >+}; >+ >+G_DEFINE_TYPE(WebKitSoupRequestInputStream, webkit_soup_request_input_stream, G_TYPE_MEMORY_INPUT_STREAM) >+ >+static void webkitSoupRequestInputStreamReadAsyncResultComplete(GTask* task, void* buffer, gsize count) >+{ >+ WebKitSoupRequestInputStream* stream = WEBKIT_SOUP_REQUEST_INPUT_STREAM(g_task_get_source_object(task)); >+ GError* error = nullptr; >+ gssize bytesRead = G_INPUT_STREAM_GET_CLASS(stream)->read_fn(G_INPUT_STREAM(stream), buffer, count, g_task_get_cancellable(task), &error); >+ if (!error) { >+ stream->priv->bytesRead += bytesRead; >+ g_task_return_int(task, bytesRead); >+ } else >+ g_task_return_error(task, error); >+} >+ >+static void webkitSoupRequestInputStreamPendingReadAsyncComplete(WebKitSoupRequestInputStream* stream) >+{ >+ if (auto data = WTFMove(stream->priv->pendingAsyncRead)) >+ webkitSoupRequestInputStreamReadAsyncResultComplete(data->task.get(), data->buffer, data->count); >+} >+ >+static bool webkitSoupRequestInputStreamHasDataToRead(WebKitSoupRequestInputStream* stream) >+{ >+ return stream->priv->bytesRead < stream->priv->bytesReceived; >+} >+ >+static bool webkitSoupRequestInputStreamIsWaitingForData(WebKitSoupRequestInputStream* stream) >+{ >+ return !stream->priv->contentLength || stream->priv->bytesReceived < stream->priv->contentLength; >+} >+ >+static void webkitSoupRequestInputStreamReadAsync(GInputStream* inputStream, void* buffer, gsize count, int /*priority*/, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer userData) >+{ >+ ASSERT(RunLoop::isMain()); >+ WebKitSoupRequestInputStream* stream = WEBKIT_SOUP_REQUEST_INPUT_STREAM(inputStream); >+ GRefPtr<GTask> task = adoptGRef(g_task_new(stream, cancellable, callback, userData)); >+ >+ if (!webkitSoupRequestInputStreamHasDataToRead(stream) && !webkitSoupRequestInputStreamIsWaitingForData(stream)) { >+ g_task_return_int(task.get(), 0); >+ return; >+ } >+ >+ if (stream->priv->error.get()) { >+ g_task_return_error(task.get(), stream->priv->error.release()); >+ return; >+ } >+ >+ if (webkitSoupRequestInputStreamHasDataToRead(stream)) { >+ webkitSoupRequestInputStreamReadAsyncResultComplete(task.get(), buffer, count); >+ return; >+ } >+ >+ stream->priv->pendingAsyncRead = std::make_unique<AsyncReadData>(WTFMove(task), buffer, count); >+} >+ >+static gssize webkitSoupRequestInputStreamReadFinish(GInputStream* inputStream, GAsyncResult* result, GError** error) >+{ >+ g_return_val_if_fail(g_task_is_valid(result, inputStream), 0); >+ >+ return g_task_propagate_int(G_TASK(result), error); >+} >+ >+static void webkitSoupRequestInputStreamFinalize(GObject* object) >+{ >+ WEBKIT_SOUP_REQUEST_INPUT_STREAM(object)->priv->~WebKitSoupRequestInputStreamPrivate(); >+ G_OBJECT_CLASS(webkit_soup_request_input_stream_parent_class)->finalize(object); >+} >+ >+static void webkit_soup_request_input_stream_init(WebKitSoupRequestInputStream* stream) >+{ >+ WebKitSoupRequestInputStreamPrivate* priv = G_TYPE_INSTANCE_GET_PRIVATE(stream, WEBKIT_TYPE_SOUP_REQUEST_INPUT_STREAM, WebKitSoupRequestInputStreamPrivate); >+ stream->priv = priv; >+ new (priv) WebKitSoupRequestInputStreamPrivate(); >+} >+ >+static void webkit_soup_request_input_stream_class_init(WebKitSoupRequestInputStreamClass* requestStreamClass) >+{ >+ GObjectClass* gObjectClass = G_OBJECT_CLASS(requestStreamClass); >+ gObjectClass->finalize = webkitSoupRequestInputStreamFinalize; >+ >+ GInputStreamClass* inputStreamClass = G_INPUT_STREAM_CLASS(requestStreamClass); >+ inputStreamClass->read_async = webkitSoupRequestInputStreamReadAsync; >+ inputStreamClass->read_finish = webkitSoupRequestInputStreamReadFinish; >+ >+ g_type_class_add_private(requestStreamClass, sizeof(WebKitSoupRequestInputStreamPrivate)); >+} >+ >+GInputStream* webkitSoupRequestInputStreamNew(uint64_t contentLength) >+{ >+ WebKitSoupRequestInputStream* stream = WEBKIT_SOUP_REQUEST_INPUT_STREAM(g_object_new(WEBKIT_TYPE_SOUP_REQUEST_INPUT_STREAM, NULL)); >+ stream->priv->contentLength = contentLength; >+ return G_INPUT_STREAM(stream); >+} >+ >+void webkitSoupRequestInputStreamAddData(WebKitSoupRequestInputStream* stream, const void* data, size_t dataLength) >+{ >+ ASSERT(RunLoop::isMain()); >+ >+ if (webkitSoupRequestInputStreamFinished(stream)) >+ return; >+ >+ if (dataLength) { >+ // Truncate the dataLength to the contentLength if it's known. >+ if (stream->priv->contentLength && stream->priv->bytesReceived + dataLength > stream->priv->contentLength) >+ dataLength = stream->priv->contentLength - stream->priv->bytesReceived; >+ stream->priv->bytesReceived += dataLength; >+ g_memory_input_stream_add_data(G_MEMORY_INPUT_STREAM(stream), g_memdup(data, dataLength), dataLength, g_free); >+ } else { >+ // We have received all the data, set contentLength to bytesReceived to indicate we have finished. >+ stream->priv->contentLength = stream->priv->bytesReceived; >+ // If there's a pending read to complete, read_fn will return 0 because we haven't added more data to the >+ // memory input stream. And if there isn't a pending read, the next call to read_async will return 0 too, because >+ // webkitSoupRequestInputStreamFinished() is now TRUE. >+ } >+ >+ webkitSoupRequestInputStreamPendingReadAsyncComplete(stream); >+} >+ >+void webkitSoupRequestInputStreamDidFailWithError(WebKitSoupRequestInputStream* stream, const WebCore::ResourceError& resourceError) >+{ >+ GUniquePtr<GError> error(g_error_new(g_quark_from_string(resourceError.domain().utf8().data()), resourceError.errorCode(), "%s", resourceError.localizedDescription().utf8().data())); >+ if (auto data = WTFMove(stream->priv->pendingAsyncRead)) >+ g_task_return_error(data->task.get(), error.release()); >+ else { >+ stream->priv->contentLength = stream->priv->bytesReceived; >+ stream->priv->error = WTFMove(error); >+ } >+} >+ >+bool webkitSoupRequestInputStreamFinished(WebKitSoupRequestInputStream* stream) >+{ >+ return !webkitSoupRequestInputStreamIsWaitingForData(stream); >+} >diff --git a/Source/WebKit/NetworkProcess/soup/WebKitSoupRequestInputStream.h b/Source/WebKit/NetworkProcess/soup/WebKitSoupRequestInputStream.h >new file mode 100644 >index 0000000000000000000000000000000000000000..399b0b45d6f5a3e1ed8ed257909936c7d62267c4 >--- /dev/null >+++ b/Source/WebKit/NetworkProcess/soup/WebKitSoupRequestInputStream.h >@@ -0,0 +1,54 @@ >+/* >+ * Copyright (C) 2012 Igalia S.L. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#pragma once >+ >+#include <WebCore/ResourceError.h> >+#include <gio/gio.h> >+ >+G_BEGIN_DECLS >+ >+#define WEBKIT_TYPE_SOUP_REQUEST_INPUT_STREAM (webkit_soup_request_input_stream_get_type()) >+#define WEBKIT_SOUP_REQUEST_INPUT_STREAM(object) (G_TYPE_CHECK_INSTANCE_CAST((object), WEBKIT_TYPE_SOUP_REQUEST_INPUT_STREAM, WebKitSoupRequestInputStream)) >+#define WEBKIT_IS_SOUP_REQUEST_INPUT_STREAM(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), WEBKIT_TYPE_SOUP_REQUEST_INPUT_STREAM)) >+#define WEBKIT_SOUP_REQUEST_INPUT_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_SOUP_REQUEST_INPUT_STREAM, WebKitSoupRequestInputStreamClass)) >+#define WEBKIT_IS_SOUP_REQUEST_INPUT_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_SOUP_REQUEST_INPUT_STREAM)) >+#define WEBKIT_SOUP_REQUEST_INPUT_STREAM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_SOUP_REQUEST_INPUT_STREAM, WebKitSoupRequestInputStreamClass)) >+ >+typedef struct _WebKitSoupRequestInputStream WebKitSoupRequestInputStream; >+typedef struct _WebKitSoupRequestInputStreamClass WebKitSoupRequestInputStreamClass; >+typedef struct _WebKitSoupRequestInputStreamPrivate WebKitSoupRequestInputStreamPrivate; >+ >+struct _WebKitSoupRequestInputStream { >+ GMemoryInputStream parent; >+ >+ WebKitSoupRequestInputStreamPrivate* priv; >+}; >+ >+struct _WebKitSoupRequestInputStreamClass { >+ GMemoryInputStreamClass parent; >+}; >+ >+GType webkit_soup_request_input_stream_get_type(); >+GInputStream* webkitSoupRequestInputStreamNew(uint64_t contentLength); >+void webkitSoupRequestInputStreamAddData(WebKitSoupRequestInputStream*, const void* data, size_t dataLength); >+void webkitSoupRequestInputStreamDidFailWithError(WebKitSoupRequestInputStream*, const WebCore::ResourceError&); >+bool webkitSoupRequestInputStreamFinished(WebKitSoupRequestInputStream*); >+ >+G_END_DECLS >diff --git a/Source/WebKit/SourcesGTK.txt b/Source/WebKit/SourcesGTK.txt >index b08d723b4aee60b419e7b93e21d88644295d17f3..a7188051594fec735130c6ef68cf402688624336 100644 >--- a/Source/WebKit/SourcesGTK.txt >+++ b/Source/WebKit/SourcesGTK.txt >@@ -42,6 +42,7 @@ NetworkProcess/soup/NetworkProcessMainSoup.cpp > NetworkProcess/soup/NetworkProcessSoup.cpp > NetworkProcess/soup/NetworkSessionSoup.cpp > NetworkProcess/soup/RemoteNetworkingContextSoup.cpp >+NetworkProcess/soup/WebKitSoupRequestInputStream.cpp > > NetworkProcess/webrtc/LibWebRTCSocketClient.cpp > NetworkProcess/webrtc/NetworkRTCMonitor.cpp >@@ -412,10 +413,9 @@ WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp > WebProcess/WebPage/gtk/WebPageGtk.cpp > WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp > >+WebProcess/glib/WebProcessGLib.cpp >+ > WebProcess/gtk/WaylandCompositorDisplay.cpp > WebProcess/gtk/WebProcessMainGtk.cpp > >-WebProcess/soup/WebKitSoupRequestInputStream.cpp >-WebProcess/soup/WebProcessSoup.cpp >- > WebProcess/Plugins/Netscape/NetscapePluginNone.cpp >diff --git a/Source/WebKit/SourcesWPE.txt b/Source/WebKit/SourcesWPE.txt >index 5119cae56bc06f22973f6733c08437ab2e3e3e12..16b899308ffea7ab01a169c697c6e777ae4350b0 100644 >--- a/Source/WebKit/SourcesWPE.txt >+++ b/Source/WebKit/SourcesWPE.txt >@@ -38,6 +38,7 @@ NetworkProcess/soup/NetworkProcessMainSoup.cpp > NetworkProcess/soup/NetworkProcessSoup.cpp > NetworkProcess/soup/NetworkSessionSoup.cpp > NetworkProcess/soup/RemoteNetworkingContextSoup.cpp >+NetworkProcess/soup/WebKitSoupRequestInputStream.cpp > > NetworkProcess/webrtc/LibWebRTCSocketClient.cpp > NetworkProcess/webrtc/NetworkRTCMonitor.cpp >@@ -250,7 +251,6 @@ WebProcess/WebPage/wpe/CompositingManager.cpp > WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp > WebProcess/WebPage/wpe/WebPageWPE.cpp > >-WebProcess/soup/WebKitSoupRequestInputStream.cpp >-WebProcess/soup/WebProcessSoup.cpp >+WebProcess/glib/WebProcessGLib.cpp > > WebProcess/wpe/WebProcessMainWPE.cpp >diff --git a/Source/WebKit/UIProcess/soup/WebProcessPoolSoup.cpp b/Source/WebKit/UIProcess/soup/WebProcessPoolSoup.cpp >index 471ee16622103b47f940de75f74fe6eef012441b..3586bc3ff0368d5d097e487c2458e465341f5a80 100644 >--- a/Source/WebKit/UIProcess/soup/WebProcessPoolSoup.cpp >+++ b/Source/WebKit/UIProcess/soup/WebProcessPoolSoup.cpp >@@ -56,7 +56,6 @@ void WebProcessPool::setIgnoreTLSErrors(bool ignoreTLSErrors) > void WebProcessPool::setNetworkProxySettings(const WebCore::SoupNetworkProxySettings& settings) > { > m_networkProxySettings = settings; >- sendToAllProcesses(Messages::WebProcess::SetNetworkProxySettings(m_networkProxySettings)); > if (m_networkProcess) > m_networkProcess->send(Messages::NetworkProcess::SetNetworkProxySettings(m_networkProxySettings), 0); > } >diff --git a/Source/WebKit/WebProcess/WebProcess.h b/Source/WebKit/WebProcess/WebProcess.h >index 1977845b90690234f46970aebf0caf354bd58a6a..8d0213394818150b50e22444f9ec2b3ec7c5675a 100644 >--- a/Source/WebKit/WebProcess/WebProcess.h >+++ b/Source/WebKit/WebProcess/WebProcess.h >@@ -73,7 +73,6 @@ struct MockMediaDevice; > struct PluginInfo; > struct PrewarmInformation; > struct SecurityOriginData; >-struct SoupNetworkProxySettings; > > #if ENABLE(SERVICE_WORKER) > struct ServiceWorkerContextData; >@@ -319,9 +318,7 @@ private: > void gamepadConnected(const GamepadData&); > void gamepadDisconnected(unsigned index); > #endif >-#if USE(SOUP) >- void setNetworkProxySettings(const WebCore::SoupNetworkProxySettings&); >-#endif >+ > #if ENABLE(SERVICE_WORKER) > void establishWorkerContextConnectionToNetworkProcess(uint64_t pageGroupID, uint64_t pageID, const WebPreferencesStore&, PAL::SessionID); > void registerServiceWorkerClients(); >diff --git a/Source/WebKit/WebProcess/WebProcess.messages.in b/Source/WebKit/WebProcess/WebProcess.messages.in >index c9e30c1e657160ad19bd3644c6416fd3db0626a7..6f6ca362efc6286e89ff46dce802dbcbefe87723 100644 >--- a/Source/WebKit/WebProcess/WebProcess.messages.in >+++ b/Source/WebKit/WebProcess/WebProcess.messages.in >@@ -109,10 +109,6 @@ messages -> WebProcess LegacyReceiver { > GamepadDisconnected(unsigned index) > #endif > >-#if USE(SOUP) >- SetNetworkProxySettings(struct WebCore::SoupNetworkProxySettings settings) >-#endif >- > #if ENABLE(SERVICE_WORKER) > EstablishWorkerContextConnectionToNetworkProcess(uint64_t pageGroupID, uint64_t pageID, struct WebKit::WebPreferencesStore store, PAL::SessionID initialSessionID) > RegisterServiceWorkerClients() >diff --git a/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp b/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..17da52de5ed05bea67d9f54a4dcaedf8ea813240 >--- /dev/null >+++ b/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp >@@ -0,0 +1,59 @@ >+/* >+ * Copyright (C) 2010 Apple Inc. All rights reserved. >+ * Portions Copyright (c) 2011 Motorola Mobility, 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 MOTOROLA 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 MOTOROLA 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 "WebProcess.h" >+ >+#include "WebProcessCreationParameters.h" >+#include <WebCore/GStreamerCommon.h> >+#include <WebCore/MemoryCache.h> >+ >+#if PLATFORM(WAYLAND) >+#include "WaylandCompositorDisplay.h" >+#endif >+ >+namespace WebKit { >+ >+void WebProcess::platformSetCacheModel(CacheModel cacheModel) >+{ >+ WebCore::MemoryCache::singleton().setDisabled(cacheModel == CacheModel::DocumentViewer); >+} >+ >+void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters&& parameters) >+{ >+#if PLATFORM(WAYLAND) >+ m_waylandCompositorDisplay = WaylandCompositorDisplay::create(parameters.waylandCompositorDisplayName); >+#endif >+#if USE(GSTREAMER) >+ WebCore::initializeGStreamer(WTFMove(parameters.gstreamerOptions)); >+#endif >+} >+ >+void WebProcess::platformTerminate() >+{ >+} >+ >+} // namespace WebKit >diff --git a/Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.cpp b/Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.cpp >deleted file mode 100644 >index 6ddc81a36d849cbc283793b617067a27e29d91f0..0000000000000000000000000000000000000000 >--- a/Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.cpp >+++ /dev/null >@@ -1,182 +0,0 @@ >-/* >- * Copyright (C) 2012 Igalia S.L. >- * >- * This library is free software; you can redistribute it and/or >- * modify it under the terms of the GNU Library General Public >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >- */ >- >-#include "config.h" >-#include "WebKitSoupRequestInputStream.h" >- >-#include <wtf/MainThread.h> >-#include <wtf/RunLoop.h> >-#include <wtf/glib/GRefPtr.h> >-#include <wtf/glib/GUniquePtr.h> >- >-struct AsyncReadData { >- AsyncReadData(GRefPtr<GTask>&& task, void* buffer, gsize count) >- : task(WTFMove(task)) >- , buffer(buffer) >- , count(count) >- { >- } >- >- GRefPtr<GTask> task; >- void* buffer; >- size_t count; >-}; >- >-struct _WebKitSoupRequestInputStreamPrivate { >- uint64_t contentLength; >- uint64_t bytesReceived; >- uint64_t bytesRead; >- >- GUniquePtr<GError> error; >- >- std::unique_ptr<AsyncReadData> pendingAsyncRead; >-}; >- >-G_DEFINE_TYPE(WebKitSoupRequestInputStream, webkit_soup_request_input_stream, G_TYPE_MEMORY_INPUT_STREAM) >- >-static void webkitSoupRequestInputStreamReadAsyncResultComplete(GTask* task, void* buffer, gsize count) >-{ >- WebKitSoupRequestInputStream* stream = WEBKIT_SOUP_REQUEST_INPUT_STREAM(g_task_get_source_object(task)); >- GError* error = nullptr; >- gssize bytesRead = G_INPUT_STREAM_GET_CLASS(stream)->read_fn(G_INPUT_STREAM(stream), buffer, count, g_task_get_cancellable(task), &error); >- if (!error) { >- stream->priv->bytesRead += bytesRead; >- g_task_return_int(task, bytesRead); >- } else >- g_task_return_error(task, error); >-} >- >-static void webkitSoupRequestInputStreamPendingReadAsyncComplete(WebKitSoupRequestInputStream* stream) >-{ >- if (auto data = WTFMove(stream->priv->pendingAsyncRead)) >- webkitSoupRequestInputStreamReadAsyncResultComplete(data->task.get(), data->buffer, data->count); >-} >- >-static bool webkitSoupRequestInputStreamHasDataToRead(WebKitSoupRequestInputStream* stream) >-{ >- return stream->priv->bytesRead < stream->priv->bytesReceived; >-} >- >-static bool webkitSoupRequestInputStreamIsWaitingForData(WebKitSoupRequestInputStream* stream) >-{ >- return !stream->priv->contentLength || stream->priv->bytesReceived < stream->priv->contentLength; >-} >- >-static void webkitSoupRequestInputStreamReadAsync(GInputStream* inputStream, void* buffer, gsize count, int /*priority*/, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer userData) >-{ >- ASSERT(RunLoop::isMain()); >- WebKitSoupRequestInputStream* stream = WEBKIT_SOUP_REQUEST_INPUT_STREAM(inputStream); >- GRefPtr<GTask> task = adoptGRef(g_task_new(stream, cancellable, callback, userData)); >- >- if (!webkitSoupRequestInputStreamHasDataToRead(stream) && !webkitSoupRequestInputStreamIsWaitingForData(stream)) { >- g_task_return_int(task.get(), 0); >- return; >- } >- >- if (stream->priv->error.get()) { >- g_task_return_error(task.get(), stream->priv->error.release()); >- return; >- } >- >- if (webkitSoupRequestInputStreamHasDataToRead(stream)) { >- webkitSoupRequestInputStreamReadAsyncResultComplete(task.get(), buffer, count); >- return; >- } >- >- stream->priv->pendingAsyncRead = std::make_unique<AsyncReadData>(WTFMove(task), buffer, count); >-} >- >-static gssize webkitSoupRequestInputStreamReadFinish(GInputStream* inputStream, GAsyncResult* result, GError** error) >-{ >- g_return_val_if_fail(g_task_is_valid(result, inputStream), 0); >- >- return g_task_propagate_int(G_TASK(result), error); >-} >- >-static void webkitSoupRequestInputStreamFinalize(GObject* object) >-{ >- WEBKIT_SOUP_REQUEST_INPUT_STREAM(object)->priv->~WebKitSoupRequestInputStreamPrivate(); >- G_OBJECT_CLASS(webkit_soup_request_input_stream_parent_class)->finalize(object); >-} >- >-static void webkit_soup_request_input_stream_init(WebKitSoupRequestInputStream* stream) >-{ >- WebKitSoupRequestInputStreamPrivate* priv = G_TYPE_INSTANCE_GET_PRIVATE(stream, WEBKIT_TYPE_SOUP_REQUEST_INPUT_STREAM, WebKitSoupRequestInputStreamPrivate); >- stream->priv = priv; >- new (priv) WebKitSoupRequestInputStreamPrivate(); >-} >- >-static void webkit_soup_request_input_stream_class_init(WebKitSoupRequestInputStreamClass* requestStreamClass) >-{ >- GObjectClass* gObjectClass = G_OBJECT_CLASS(requestStreamClass); >- gObjectClass->finalize = webkitSoupRequestInputStreamFinalize; >- >- GInputStreamClass* inputStreamClass = G_INPUT_STREAM_CLASS(requestStreamClass); >- inputStreamClass->read_async = webkitSoupRequestInputStreamReadAsync; >- inputStreamClass->read_finish = webkitSoupRequestInputStreamReadFinish; >- >- g_type_class_add_private(requestStreamClass, sizeof(WebKitSoupRequestInputStreamPrivate)); >-} >- >-GInputStream* webkitSoupRequestInputStreamNew(uint64_t contentLength) >-{ >- WebKitSoupRequestInputStream* stream = WEBKIT_SOUP_REQUEST_INPUT_STREAM(g_object_new(WEBKIT_TYPE_SOUP_REQUEST_INPUT_STREAM, NULL)); >- stream->priv->contentLength = contentLength; >- return G_INPUT_STREAM(stream); >-} >- >-void webkitSoupRequestInputStreamAddData(WebKitSoupRequestInputStream* stream, const void* data, size_t dataLength) >-{ >- ASSERT(RunLoop::isMain()); >- >- if (webkitSoupRequestInputStreamFinished(stream)) >- return; >- >- if (dataLength) { >- // Truncate the dataLength to the contentLength if it's known. >- if (stream->priv->contentLength && stream->priv->bytesReceived + dataLength > stream->priv->contentLength) >- dataLength = stream->priv->contentLength - stream->priv->bytesReceived; >- stream->priv->bytesReceived += dataLength; >- g_memory_input_stream_add_data(G_MEMORY_INPUT_STREAM(stream), g_memdup(data, dataLength), dataLength, g_free); >- } else { >- // We have received all the data, set contentLength to bytesReceived to indicate we have finished. >- stream->priv->contentLength = stream->priv->bytesReceived; >- // If there's a pending read to complete, read_fn will return 0 because we haven't added more data to the >- // memory input stream. And if there isn't a pending read, the next call to read_async will return 0 too, because >- // webkitSoupRequestInputStreamFinished() is now TRUE. >- } >- >- webkitSoupRequestInputStreamPendingReadAsyncComplete(stream); >-} >- >-void webkitSoupRequestInputStreamDidFailWithError(WebKitSoupRequestInputStream* stream, const WebCore::ResourceError& resourceError) >-{ >- GUniquePtr<GError> error(g_error_new(g_quark_from_string(resourceError.domain().utf8().data()), resourceError.errorCode(), "%s", resourceError.localizedDescription().utf8().data())); >- if (auto data = WTFMove(stream->priv->pendingAsyncRead)) >- g_task_return_error(data->task.get(), error.release()); >- else { >- stream->priv->contentLength = stream->priv->bytesReceived; >- stream->priv->error = WTFMove(error); >- } >-} >- >-bool webkitSoupRequestInputStreamFinished(WebKitSoupRequestInputStream* stream) >-{ >- return !webkitSoupRequestInputStreamIsWaitingForData(stream); >-} >diff --git a/Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.h b/Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.h >deleted file mode 100644 >index d7e264d57e442111d61c4cfcfcfeb281da1e878d..0000000000000000000000000000000000000000 >--- a/Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.h >+++ /dev/null >@@ -1,57 +0,0 @@ >-/* >- * Copyright (C) 2012 Igalia S.L. >- * >- * This library is free software; you can redistribute it and/or >- * modify it under the terms of the GNU Library General Public >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >- */ >- >-#ifndef WebKitSoupRequestInputStream_h >-#define WebKitSoupRequestInputStream_h >- >-#include <WebCore/ResourceError.h> >-#include <gio/gio.h> >- >-G_BEGIN_DECLS >- >-#define WEBKIT_TYPE_SOUP_REQUEST_INPUT_STREAM (webkit_soup_request_input_stream_get_type()) >-#define WEBKIT_SOUP_REQUEST_INPUT_STREAM(object) (G_TYPE_CHECK_INSTANCE_CAST((object), WEBKIT_TYPE_SOUP_REQUEST_INPUT_STREAM, WebKitSoupRequestInputStream)) >-#define WEBKIT_IS_SOUP_REQUEST_INPUT_STREAM(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), WEBKIT_TYPE_SOUP_REQUEST_INPUT_STREAM)) >-#define WEBKIT_SOUP_REQUEST_INPUT_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_SOUP_REQUEST_INPUT_STREAM, WebKitSoupRequestInputStreamClass)) >-#define WEBKIT_IS_SOUP_REQUEST_INPUT_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_SOUP_REQUEST_INPUT_STREAM)) >-#define WEBKIT_SOUP_REQUEST_INPUT_STREAM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_SOUP_REQUEST_INPUT_STREAM, WebKitSoupRequestInputStreamClass)) >- >-typedef struct _WebKitSoupRequestInputStream WebKitSoupRequestInputStream; >-typedef struct _WebKitSoupRequestInputStreamClass WebKitSoupRequestInputStreamClass; >-typedef struct _WebKitSoupRequestInputStreamPrivate WebKitSoupRequestInputStreamPrivate; >- >-struct _WebKitSoupRequestInputStream { >- GMemoryInputStream parent; >- >- WebKitSoupRequestInputStreamPrivate* priv; >-}; >- >-struct _WebKitSoupRequestInputStreamClass { >- GMemoryInputStreamClass parent; >-}; >- >-GType webkit_soup_request_input_stream_get_type(); >-GInputStream* webkitSoupRequestInputStreamNew(uint64_t contentLength); >-void webkitSoupRequestInputStreamAddData(WebKitSoupRequestInputStream*, const void* data, size_t dataLength); >-void webkitSoupRequestInputStreamDidFailWithError(WebKitSoupRequestInputStream*, const WebCore::ResourceError&); >-bool webkitSoupRequestInputStreamFinished(WebKitSoupRequestInputStream*); >- >-G_END_DECLS >- >-#endif // WebKitSoupRequestInputStream_h >diff --git a/Source/WebKit/WebProcess/soup/WebProcessSoup.cpp b/Source/WebKit/WebProcess/soup/WebProcessSoup.cpp >deleted file mode 100644 >index 705887677319add3e1ddb5d9b853987e4b7ed92d..0000000000000000000000000000000000000000 >--- a/Source/WebKit/WebProcess/soup/WebProcessSoup.cpp >+++ /dev/null >@@ -1,69 +0,0 @@ >-/* >- * Copyright (C) 2010 Apple Inc. All rights reserved. >- * Portions Copyright (c) 2011 Motorola Mobility, 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 MOTOROLA 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 MOTOROLA 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 "WebProcess.h" >- >-#include "WebProcessCreationParameters.h" >-#include <WebCore/GStreamerCommon.h> >-#include <WebCore/MemoryCache.h> >-#include <WebCore/NetworkStorageSession.h> >-#include <WebCore/SoupNetworkSession.h> >- >-#if PLATFORM(WAYLAND) >-#include "WaylandCompositorDisplay.h" >-#endif >- >-namespace WebKit { >- >-void WebProcess::platformSetCacheModel(CacheModel cacheModel) >-{ >- WebCore::MemoryCache::singleton().setDisabled(cacheModel == CacheModel::DocumentViewer); >-} >- >-void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters&& parameters) >-{ >- if (parameters.proxySettings.mode != WebCore::SoupNetworkProxySettings::Mode::Default) >- setNetworkProxySettings(parameters.proxySettings); >- >-#if PLATFORM(WAYLAND) >- m_waylandCompositorDisplay = WaylandCompositorDisplay::create(parameters.waylandCompositorDisplayName); >-#endif >-#if USE(GSTREAMER) >- WebCore::initializeGStreamer(WTFMove(parameters.gstreamerOptions)); >-#endif >-} >- >-void WebProcess::platformTerminate() >-{ >-} >- >-void WebProcess::setNetworkProxySettings(const WebCore::SoupNetworkProxySettings& settings) >-{ >- WebCore::SoupNetworkSession::setProxySettings(settings); >-} >- >-} // namespace WebKit
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193710
: 359855