[GLIB] Remove support for GSocket main loop sources from GMainLoopSource
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Nov 2015 09:33:28 +0000 (09:33 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Nov 2015 09:33:28 +0000 (09:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150772

Reviewed by Žan Doberšek.

Source/WebKit2:

Add GSocketMonitor class to be used by Connection to monitor the
availability of the socket file descriptor instead of using a
GMainLoopSource.

* Platform/IPC/Connection.h:
* Platform/IPC/glib/GSocketMonitor.cpp: Added.
(IPC::GSocketMonitor::~GSocketMonitor):
(IPC::GSocketMonitor::socketSourceCallback):
(IPC::GSocketMonitor::start):
(IPC::GSocketMonitor::stop):
* Platform/IPC/glib/GSocketMonitor.h: Added.
* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::platformInvalidate):
(IPC::Connection::open):
* PlatformGTK.cmake:

Source/WTF:

It complicated the code just to make generic what is only used in
one place.

* wtf/glib/GMainLoopSource.cpp:
(WTF::GMainLoopSource::cancel): Deleted.
(WTF::GMainLoopSource::schedule): Deleted.
(WTF::GMainLoopSource::scheduleTimeoutSource): Deleted.
(WTF::GMainLoopSource::scheduleAfterDelay): Deleted.
(WTF::GMainLoopSource::finishVoidCallback): Deleted.
(WTF::GMainLoopSource::voidCallback): Deleted.
(WTF::GMainLoopSource::prepareBoolCallback): Deleted.
* wtf/glib/GMainLoopSource.h:
(WTF::GMainLoopSource::Context::operator=): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191881 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/glib/GMainLoopSource.cpp
Source/WTF/wtf/glib/GMainLoopSource.h
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/IPC/Connection.h
Source/WebKit2/Platform/IPC/glib/GSocketMonitor.cpp [new file with mode: 0644]
Source/WebKit2/Platform/IPC/glib/GSocketMonitor.h [new file with mode: 0644]
Source/WebKit2/Platform/IPC/unix/ConnectionUnix.cpp
Source/WebKit2/PlatformGTK.cmake
Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp

index c8645d3db28c75937fbfe323c2dc6ce664862b47..ca9d33515d2cfd3873e3631aa0597bf39089d0e0 100644 (file)
@@ -1,3 +1,24 @@
+2015-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GLIB] Remove support for GSocket main loop sources from GMainLoopSource
+        https://bugs.webkit.org/show_bug.cgi?id=150772
+
+        Reviewed by Žan Doberšek.
+
+        It complicated the code just to make generic what is only used in
+        one place.
+
+        * wtf/glib/GMainLoopSource.cpp:
+        (WTF::GMainLoopSource::cancel): Deleted.
+        (WTF::GMainLoopSource::schedule): Deleted.
+        (WTF::GMainLoopSource::scheduleTimeoutSource): Deleted.
+        (WTF::GMainLoopSource::scheduleAfterDelay): Deleted.
+        (WTF::GMainLoopSource::finishVoidCallback): Deleted.
+        (WTF::GMainLoopSource::voidCallback): Deleted.
+        (WTF::GMainLoopSource::prepareBoolCallback): Deleted.
+        * wtf/glib/GMainLoopSource.h:
+        (WTF::GMainLoopSource::Context::operator=): Deleted.
+
 2015-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GLIB] Remove delete on destroy GMainLoopSources
index 50608b794a06a3ba685e09367aea626c6719a405..b47932052498cf19e9f99a8f18039db20a6b0605 100644 (file)
@@ -54,8 +54,6 @@ void GMainLoopSource::cancel()
 
     m_status = Ready;
 
-    g_cancellable_cancel(m_context.socketCancellable.get());
-
     if (!m_context.source)
         return;
 
@@ -84,10 +82,8 @@ void GMainLoopSource::schedule(const char* name, std::function<void ()>&& functi
     m_context = {
         adoptGRef(g_idle_source_new()),
         nullptr, // cancellable
-        nullptr, // socketCancellable
         WTF::move(function),
         nullptr, // boolCallback
-        nullptr, // socketCallback
         WTF::move(destroyFunction)
     };
     scheduleIdleSource(name, reinterpret_cast<GSourceFunc>(voidSourceCallback), priority, context);
@@ -101,38 +97,13 @@ void GMainLoopSource::schedule(const char* name, std::function<bool ()>&& functi
     m_context = {
         adoptGRef(g_idle_source_new()),
         nullptr, // cancellable
-        nullptr, // socketCancellable
         nullptr, // voidCallback
         WTF::move(function),
-        nullptr, // socketCallback
         WTF::move(destroyFunction)
     };
     scheduleIdleSource(name, reinterpret_cast<GSourceFunc>(boolSourceCallback), priority, context);
 }
 
-void GMainLoopSource::schedule(const char* name, std::function<bool (GIOCondition)>&& function, GSocket* socket, GIOCondition condition, std::function<void ()>&& destroyFunction, GMainContext* context)
-{
-    cancel();
-
-    ASSERT(!m_context.source);
-    GCancellable* socketCancellable = g_cancellable_new();
-    m_context = {
-        adoptGRef(g_socket_create_source(socket, condition, socketCancellable)),
-        nullptr, // cancellable
-        adoptGRef(socketCancellable),
-        nullptr, // voidCallback
-        nullptr, // boolCallback
-        WTF::move(function),
-        WTF::move(destroyFunction)
-    };
-
-    ASSERT(m_status == Ready);
-    m_status = Scheduled;
-    g_source_set_name(m_context.source.get(), name);
-    g_source_set_callback(m_context.source.get(), reinterpret_cast<GSourceFunc>(socketSourceCallback), this, nullptr);
-    g_source_attach(m_context.source.get(), context);
-}
-
 void GMainLoopSource::scheduleTimeoutSource(const char* name, GSourceFunc sourceFunction, int priority, GMainContext* context)
 {
     ASSERT(m_status == Ready);
@@ -153,10 +124,8 @@ void GMainLoopSource::scheduleAfterDelay(const char* name, std::function<void ()
     m_context = {
         adoptGRef(g_timeout_source_new(delay.count())),
         nullptr, // cancellable
-        nullptr, // socketCancellable
         WTF::move(function),
         nullptr, // boolCallback
-        nullptr, // socketCallback
         WTF::move(destroyFunction)
     };
     scheduleTimeoutSource(name, reinterpret_cast<GSourceFunc>(voidSourceCallback), priority, context);
@@ -170,10 +139,8 @@ void GMainLoopSource::scheduleAfterDelay(const char* name, std::function<bool ()
     m_context = {
         adoptGRef(g_timeout_source_new(delay.count())),
         nullptr, // cancellable
-        nullptr, // socketCancellable
         nullptr, // voidCallback
         WTF::move(function),
-        nullptr, // socketCallback
         WTF::move(destroyFunction)
     };
     scheduleTimeoutSource(name, reinterpret_cast<GSourceFunc>(boolSourceCallback), priority, context);
@@ -187,10 +154,8 @@ void GMainLoopSource::scheduleAfterDelay(const char* name, std::function<void ()
     m_context = {
         adoptGRef(g_timeout_source_new_seconds(delay.count())),
         nullptr, // cancellable
-        nullptr, // socketCancellable
         WTF::move(function),
         nullptr, // boolCallback
-        nullptr, // socketCallback
         WTF::move(destroyFunction)
     };
     scheduleTimeoutSource(name, reinterpret_cast<GSourceFunc>(voidSourceCallback), priority, context);
@@ -204,10 +169,8 @@ void GMainLoopSource::scheduleAfterDelay(const char* name, std::function<bool ()
     m_context = {
         adoptGRef(g_timeout_source_new_seconds(delay.count())),
         nullptr, // cancellable
-        nullptr, // socketCancellable
         nullptr, // voidCallback
         WTF::move(function),
-        nullptr, // socketCallback
         WTF::move(destroyFunction)
     };
     scheduleTimeoutSource(name, reinterpret_cast<GSourceFunc>(boolSourceCallback), priority, context);
@@ -250,10 +213,8 @@ void GMainLoopSource::scheduleAfterDelay(const char* name, std::function<void ()
     m_context = {
         adoptGRef(createMicrosecondsTimeoutSource(delay.count())),
         nullptr, // cancellable
-        nullptr, // socketCancellable
         WTF::move(function),
         nullptr, // boolCallback
-        nullptr, // socketCallback
         WTF::move(destroyFunction)
     };
     scheduleTimeoutSource(name, reinterpret_cast<GSourceFunc>(voidSourceCallback), priority, context);
@@ -267,10 +228,8 @@ void GMainLoopSource::scheduleAfterDelay(const char* name, std::function<bool ()
     m_context = {
         adoptGRef(createMicrosecondsTimeoutSource(delay.count())),
         nullptr, // cancellable
-        nullptr, // socketCancellable
         nullptr, // voidCallback
         WTF::move(function),
-        nullptr, // socketCallback
         WTF::move(destroyFunction)
     };
     scheduleTimeoutSource(name, reinterpret_cast<GSourceFunc>(boolSourceCallback), priority, context);
@@ -351,40 +310,6 @@ bool GMainLoopSource::boolCallback()
     return retval;
 }
 
-bool GMainLoopSource::socketCallback(GIOCondition condition)
-{
-    if (!m_context.source)
-        return Stop;
-
-    Context context;
-    context = WTF::move(m_context);
-
-    ASSERT(context.socketCallback);
-    ASSERT(m_status == Scheduled || m_status == Dispatching);
-    m_status = Dispatching;
-
-    if (g_cancellable_is_cancelled(context.socketCancellable.get())) {
-        context.destroySource();
-        return Stop;
-    }
-
-    bool retval = context.socketCallback(condition);
-
-    if (m_status != Ready && !m_context.source) {
-        // m_status should reflect whether the GMainLoopSource has been rescheduled during dispatch.
-        ASSERT((!m_context.source && m_status == Dispatching) || m_status == Scheduled);
-        if (retval && !m_context.source)
-            m_context = WTF::move(context);
-        else if (!retval)
-            m_status = Ready;
-    }
-
-    if (context.source)
-        context.destroySource();
-
-    return retval;
-}
-
 gboolean GMainLoopSource::voidSourceCallback(GMainLoopSource* source)
 {
     source->voidCallback();
@@ -396,11 +321,6 @@ gboolean GMainLoopSource::boolSourceCallback(GMainLoopSource* source)
     return source->boolCallback() == Continue;
 }
 
-gboolean GMainLoopSource::socketSourceCallback(GSocket*, GIOCondition condition, GMainLoopSource* source)
-{
-    return source->socketCallback(condition) == Continue;
-}
-
 void GMainLoopSource::Context::destroySource()
 {
     g_source_destroy(source.get());
index 99642ee88939050b8a58d9b61a67a9b6b79c4fec..d34b6e8f9d208db321459cba68474f0b2a9833f2 100644 (file)
@@ -33,8 +33,6 @@
 #include <wtf/Noncopyable.h>
 #include <wtf/glib/GRefPtr.h>
 
-typedef struct _GSocket GSocket;
-
 namespace WTF {
 
 class GMainLoopSource {
@@ -60,8 +58,6 @@ public:
     WTF_EXPORT_PRIVATE virtual void scheduleAfterDelay(const char* name, std::function<bool()>&&, std::chrono::microseconds, int priority = G_PRIORITY_DEFAULT, std::function<void()>&& destroyFunction = nullptr, GMainContext* = nullptr);
     WTF_EXPORT_PRIVATE virtual void cancel();
 
-    WTF_EXPORT_PRIVATE void schedule(const char* name, std::function<bool(GIOCondition)>&&, GSocket*, GIOCondition, std::function<void()>&& destroyFunction = nullptr, GMainContext* = nullptr);
-
 protected:
     enum Status { Ready, Scheduled, Dispatching };
 
@@ -71,10 +67,8 @@ protected:
         {
             source = WTF::move(c.source);
             cancellable = WTF::move(c.cancellable);
-            socketCancellable = WTF::move(c.socketCancellable);
             voidCallback = WTF::move(c.voidCallback);
             boolCallback = WTF::move(c.boolCallback);
-            socketCallback = WTF::move(c.socketCallback);
             destroyCallback = WTF::move(c.destroyCallback);
             return *this;
         }
@@ -83,10 +77,8 @@ protected:
 
         GRefPtr<GSource> source;
         GRefPtr<GCancellable> cancellable;
-        GRefPtr<GCancellable> socketCancellable;
         std::function<void ()> voidCallback;
         std::function<bool ()> boolCallback;
-        std::function<bool (GIOCondition)> socketCallback;
         std::function<void ()> destroyCallback;
     };
 
@@ -101,11 +93,9 @@ protected:
 private:
     void scheduleIdleSource(const char* name, GSourceFunc, int priority, GMainContext*);
     void scheduleTimeoutSource(const char* name, GSourceFunc, int priority, GMainContext*);
-    bool socketCallback(GIOCondition);
 
     static gboolean voidSourceCallback(GMainLoopSource*);
     static gboolean boolSourceCallback(GMainLoopSource*);
-    static gboolean socketSourceCallback(GSocket*, GIOCondition, GMainLoopSource*);
 
 protected:
     Context m_context;
index 5914e3a068421c965479cf71ca431064523a5684..8ba5ebc52360869fee13f6822a1850f0b03e023e 100644 (file)
@@ -1,3 +1,26 @@
+2015-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GLIB] Remove support for GSocket main loop sources from GMainLoopSource
+        https://bugs.webkit.org/show_bug.cgi?id=150772
+
+        Reviewed by Žan Doberšek.
+
+        Add GSocketMonitor class to be used by Connection to monitor the
+        availability of the socket file descriptor instead of using a
+        GMainLoopSource.
+
+        * Platform/IPC/Connection.h:
+        * Platform/IPC/glib/GSocketMonitor.cpp: Added.
+        (IPC::GSocketMonitor::~GSocketMonitor):
+        (IPC::GSocketMonitor::socketSourceCallback):
+        (IPC::GSocketMonitor::start):
+        (IPC::GSocketMonitor::stop):
+        * Platform/IPC/glib/GSocketMonitor.h: Added.
+        * Platform/IPC/unix/ConnectionUnix.cpp:
+        (IPC::Connection::platformInvalidate):
+        (IPC::Connection::open):
+        * PlatformGTK.cmake:
+
 2015-11-01  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Use RunLoop in WorkQueue implementation
index 8c9cc91ed5612014e0d162c841fd00f998b325c3..10f27b38bcce57302250ec901f1e81472312875d 100644 (file)
@@ -53,7 +53,7 @@
 #endif
 
 #if PLATFORM(GTK)
-#include <wtf/glib/GMainLoopSource.h>
+#include "GSocketMonitor.h"
 #endif
 
 namespace IPC {
@@ -337,7 +337,7 @@ private:
     size_t m_fileDescriptorsSize;
     int m_socketDescriptor;
 #if PLATFORM(GTK)
-    GMainLoopSource m_socketEventSource;
+    GSocketMonitor m_socketMonitor;
 #endif
 #elif OS(DARWIN)
     // Called on the connection queue.
diff --git a/Source/WebKit2/Platform/IPC/glib/GSocketMonitor.cpp b/Source/WebKit2/Platform/IPC/glib/GSocketMonitor.cpp
new file mode 100644 (file)
index 0000000..2229058
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * 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 "GSocketMonitor.h"
+
+#include <gio/gio.h>
+
+namespace IPC {
+
+GSocketMonitor::~GSocketMonitor()
+{
+    stop();
+}
+
+gboolean GSocketMonitor::socketSourceCallback(GSocket*, GIOCondition condition, GSocketMonitor* monitor)
+{
+    if (g_cancellable_is_cancelled(monitor->m_cancellable.get()))
+        return G_SOURCE_REMOVE;
+    return monitor->m_callback(condition);
+}
+
+void GSocketMonitor::start(GSocket* socket, GIOCondition condition, RunLoop& runLoop, std::function<gboolean (GIOCondition)>&& callback)
+{
+    stop();
+
+    m_cancellable = adoptGRef(g_cancellable_new());
+    m_source = adoptGRef(g_socket_create_source(socket, condition, m_cancellable.get()));
+    g_source_set_name(m_source.get(), "[WebKit] Socket monitor");
+    m_callback = WTF::move(callback);
+    g_source_set_callback(m_source.get(), reinterpret_cast<GSourceFunc>(socketSourceCallback), this, nullptr);
+    g_source_attach(m_source.get(), runLoop.mainContext());
+}
+
+void GSocketMonitor::stop()
+{
+    if (!m_source)
+        return;
+
+    g_cancellable_cancel(m_cancellable.get());
+    m_cancellable = nullptr;
+    g_source_destroy(m_source.get());
+    m_source = nullptr;
+    m_callback = nullptr;
+}
+
+} // namespace IPC
diff --git a/Source/WebKit2/Platform/IPC/glib/GSocketMonitor.h b/Source/WebKit2/Platform/IPC/glib/GSocketMonitor.h
new file mode 100644 (file)
index 0000000..11e528a
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * 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.
+ */
+
+#ifndef GSocketMonitor_h
+#define GSocketMonitor_h
+
+#include <functional>
+#include <glib.h>
+#include <wtf/Forward.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/RunLoop.h>
+#include <wtf/glib/GRefPtr.h>
+
+typedef struct _GSocket GSocket;
+
+namespace IPC {
+
+class GSocketMonitor {
+    WTF_MAKE_NONCOPYABLE(GSocketMonitor);
+public:
+    GSocketMonitor() = default;
+    ~GSocketMonitor();
+
+    void start(GSocket*, GIOCondition, RunLoop&, std::function<gboolean (GIOCondition)>&&);
+    void stop();
+
+private:
+    static gboolean socketSourceCallback(GSocket*, GIOCondition, GSocketMonitor*);
+
+    GRefPtr<GSource> m_source;
+    GRefPtr<GCancellable> m_cancellable;
+    std::function<gboolean (GIOCondition)> m_callback;
+};
+
+} // namespace IPC
+
+#endif // GSocketMonitor_h
index 12ba1ffc41841b0e7d1053393e41b4271be296f3..fbc9def12262f450ba3e922d4d37dd0147f0b68e 100644 (file)
@@ -148,7 +148,7 @@ void Connection::platformInvalidate()
         return;
 
 #if PLATFORM(GTK)
-    m_socketEventSource.cancel();
+    m_socketMonitor.stop();
 #elif PLATFORM(EFL)
     m_connectionQueue->unregisterSocketEventHandler(m_socketDescriptor);
 #endif
@@ -377,20 +377,20 @@ bool Connection::open()
     m_isConnected = true;
 #if PLATFORM(GTK)
     GRefPtr<GSocket> socket = adoptGRef(g_socket_new_from_fd(m_socketDescriptor, nullptr));
-    m_socketEventSource.schedule("[WebKit] Connection::SocketEventHandler", [protectedThis] (GIOCondition condition) {
+    m_socketMonitor.start(socket.get(), G_IO_IN, m_connectionQueue->runLoop(), [protectedThis] (GIOCondition condition) -> gboolean {
         if (condition & G_IO_HUP || condition & G_IO_ERR || condition & G_IO_NVAL) {
             protectedThis->connectionDidClose();
-            return GMainLoopSource::Stop;
+            return G_SOURCE_REMOVE;
         }
 
         if (condition & G_IO_IN) {
             protectedThis->readyReadHandler();
-            return GMainLoopSource::Continue;
+            return G_SOURCE_CONTINUE;
         }
 
         ASSERT_NOT_REACHED();
-        return GMainLoopSource::Stop;
-    }, socket.get(), G_IO_IN, nullptr, m_connectionQueue->runLoop().mainContext());
+        return G_SOURCE_REMOVE;
+    });
 #elif PLATFORM(EFL)
     m_connectionQueue->registerSocketEventHandler(m_socketDescriptor,
         [protectedThis] {
index 2201e889005d1fad4be6e55630ce98c0f7841593..d5f5ec96ec926655b7d8a550059cc772d437cc6b 100644 (file)
@@ -35,6 +35,7 @@ list(APPEND WebKit2_SOURCES
     NetworkProcess/soup/NetworkProcessSoup.cpp
     NetworkProcess/soup/RemoteNetworkingContextSoup.cpp
 
+    Platform/IPC/glib/GSocketMonitor.cpp
     Platform/IPC/unix/AttachmentUnix.cpp
     Platform/IPC/unix/ConnectionUnix.cpp
 
@@ -492,6 +493,7 @@ list(APPEND WebKit2_INCLUDE_DIRECTORIES
     "${WEBKIT2_DIR}/DatabaseProcess/unix"
     "${WEBKIT2_DIR}/NetworkProcess/gtk"
     "${WEBKIT2_DIR}/NetworkProcess/unix"
+    "${WEBKIT2_DIR}/Platform/IPC/glib"
     "${WEBKIT2_DIR}/Shared/API/c/gtk"
     "${WEBKIT2_DIR}/Shared/Network/CustomProtocols/soup"
     "${WEBKIT2_DIR}/Shared/Downloads/soup"
@@ -710,6 +712,7 @@ if (ENABLE_PLUGIN_PROCESS_GTK2)
         Platform/IPC/MessageSender.cpp
         Platform/IPC/StringReference.cpp
 
+        Platform/IPC/glib/GSocketMonitor.cpp
         Platform/IPC/unix/AttachmentUnix.cpp
         Platform/IPC/unix/ConnectionUnix.cpp
 
index 5dec26a8cd6a6850327bb095f78df126437326eb..1194a97f82b79627e82e58b36daf8a1fbcfb60b1 100644 (file)
@@ -65,6 +65,7 @@
 #include <glib/gi18n-lib.h>
 #include <memory>
 #include <wtf/HashMap.h>
+#include <wtf/glib/GMainLoopSource.h>
 #include <wtf/glib/GRefPtr.h>
 #include <wtf/text/CString.h>