Title: [240341] trunk/Source/WebKit
Revision
240341
Author
[email protected]
Date
2019-01-23 09:26:50 -0800 (Wed, 23 Jan 2019)

Log Message

[SOUP] Remove libsoup cruft from WebProcess
https://bugs.webkit.org/show_bug.cgi?id=193710

Reviewed by Carlos Garcia Campos.

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):

Modified Paths

Added Paths

Removed Paths

  • trunk/Source/WebKit/WebProcess/soup/

Diff

Modified: trunk/Source/WebKit/ChangeLog (240340 => 240341)


--- trunk/Source/WebKit/ChangeLog	2019-01-23 17:24:19 UTC (rev 240340)
+++ trunk/Source/WebKit/ChangeLog	2019-01-23 17:26:50 UTC (rev 240341)
@@ -1,5 +1,45 @@
 2019-01-23  Michael Catanzaro  <[email protected]>
 
+        [SOUP] Remove libsoup cruft from WebProcess
+        https://bugs.webkit.org/show_bug.cgi?id=193710
+
+        Reviewed by Carlos Garcia Campos.
+
+        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-23  Michael Catanzaro  <[email protected]>
+
         [SOUP] Clean up NetworkStorageSession
         https://bugs.webkit.org/show_bug.cgi?id=193707
 

Copied: trunk/Source/WebKit/NetworkProcess/soup/WebKitSoupRequestInputStream.cpp (from rev 240340, trunk/Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.cpp) (0 => 240341)


--- trunk/Source/WebKit/NetworkProcess/soup/WebKitSoupRequestInputStream.cpp	                        (rev 0)
+++ trunk/Source/WebKit/NetworkProcess/soup/WebKitSoupRequestInputStream.cpp	2019-01-23 17:26:50 UTC (rev 240341)
@@ -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 = ""
+        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 = ""
+        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);
+}

Copied: trunk/Source/WebKit/NetworkProcess/soup/WebKitSoupRequestInputStream.h (from rev 240340, trunk/Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.h) (0 => 240341)


--- trunk/Source/WebKit/NetworkProcess/soup/WebKitSoupRequestInputStream.h	                        (rev 0)
+++ trunk/Source/WebKit/NetworkProcess/soup/WebKitSoupRequestInputStream.h	2019-01-23 17:26:50 UTC (rev 240341)
@@ -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

Modified: trunk/Source/WebKit/SourcesGTK.txt (240340 => 240341)


--- trunk/Source/WebKit/SourcesGTK.txt	2019-01-23 17:24:19 UTC (rev 240340)
+++ trunk/Source/WebKit/SourcesGTK.txt	2019-01-23 17:26:50 UTC (rev 240341)
@@ -42,6 +42,7 @@
 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/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

Modified: trunk/Source/WebKit/SourcesWPE.txt (240340 => 240341)


--- trunk/Source/WebKit/SourcesWPE.txt	2019-01-23 17:24:19 UTC (rev 240340)
+++ trunk/Source/WebKit/SourcesWPE.txt	2019-01-23 17:26:50 UTC (rev 240341)
@@ -38,6 +38,7 @@
 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/WebInspectorUIWPE.cpp
 WebProcess/WebPage/wpe/WebPageWPE.cpp
 
-WebProcess/soup/WebKitSoupRequestInputStream.cpp
-WebProcess/soup/WebProcessSoup.cpp
+WebProcess/glib/WebProcessGLib.cpp
 
 WebProcess/wpe/WebProcessMainWPE.cpp

Modified: trunk/Source/WebKit/UIProcess/soup/WebProcessPoolSoup.cpp (240340 => 240341)


--- trunk/Source/WebKit/UIProcess/soup/WebProcessPoolSoup.cpp	2019-01-23 17:24:19 UTC (rev 240340)
+++ trunk/Source/WebKit/UIProcess/soup/WebProcessPoolSoup.cpp	2019-01-23 17:26:50 UTC (rev 240341)
@@ -56,7 +56,6 @@
 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);
 }

Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (240340 => 240341)


--- trunk/Source/WebKit/WebProcess/WebProcess.h	2019-01-23 17:24:19 UTC (rev 240340)
+++ trunk/Source/WebKit/WebProcess/WebProcess.h	2019-01-23 17:26:50 UTC (rev 240341)
@@ -73,7 +73,6 @@
 struct PluginInfo;
 struct PrewarmInformation;
 struct SecurityOriginData;
-struct SoupNetworkProxySettings;
 
 #if ENABLE(SERVICE_WORKER)
 struct ServiceWorkerContextData;
@@ -319,9 +318,7 @@
     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();

Modified: trunk/Source/WebKit/WebProcess/WebProcess.messages.in (240340 => 240341)


--- trunk/Source/WebKit/WebProcess/WebProcess.messages.in	2019-01-23 17:24:19 UTC (rev 240340)
+++ trunk/Source/WebKit/WebProcess/WebProcess.messages.in	2019-01-23 17:26:50 UTC (rev 240341)
@@ -109,10 +109,6 @@
     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()

Copied: trunk/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp (from rev 240340, trunk/Source/WebKit/WebProcess/soup/WebProcessSoup.cpp) (0 => 240341)


--- trunk/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp	                        (rev 0)
+++ trunk/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp	2019-01-23 17:26:50 UTC (rev 240341)
@@ -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
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to