<!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>[191786] 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/191786">191786</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-10-30 04:28:14 -0700 (Fri, 30 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Use a persistent main loop source in RunLoop glib implementation
https://bugs.webkit.org/show_bug.cgi?id=150590

Reviewed by Žan Doberšek.

Source/WebKit2:

Use RunLoop::dispatch() instead of
GMainLoopSource::scheduleAndDeleteOnDestroy in a couple of simple
cases.

* NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
(WebKit::NetworkCache::runTaskInQueue):
* UIProcess/gtk/DragAndDropHandler.cpp:
(WebKit::DragAndDropHandler::dragLeave):

Source/WTF:

It's more efficient than creating and destroying a new source for
every dispatch and it simplifies the code.

* wtf/RunLoop.h:
* wtf/glib/MainThreadGLib.cpp:
(WTF::scheduleDispatchFunctionsOnMainThread): Use
RunLoop::dispatch() instead of GMainLoopSource::scheduleAndDeleteOnDestroy().
* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::RunLoop): Create and setup the persistent source.
(WTF::RunLoop::~RunLoop): Destroy the persistent source.
(WTF::RunLoop::stop): Stop the persistent source before stopping
the main loop.
(WTF::RunLoop::wakeUp): Make the persistent source active. We
no longer need to explicitly wakeup the context.
(WTF::RunLoop::TimerBase::TimerBase): Create and setup the
persistent source.
(WTF::RunLoop::TimerBase::~TimerBase): Destroy the persistent source.
(WTF::RunLoop::TimerBase::updateReadyTime): Set the ready time
according to the fire interval.
(WTF::RunLoop::TimerBase::start): Make the persistent source active.
(WTF::RunLoop::TimerBase::stop): Stop the persistent source.
(WTF::RunLoop::TimerBase::isActive): Return whether the
persistent source is active.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfRunLooph">trunk/Source/WTF/wtf/RunLoop.h</a></li>
<li><a href="#trunkSourceWTFwtfglibMainThreadGLibcpp">trunk/Source/WTF/wtf/glib/MainThreadGLib.cpp</a></li>
<li><a href="#trunkSourceWTFwtfglibRunLoopGLibcpp">trunk/Source/WTF/wtf/glib/RunLoopGLib.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheIOChannelSoupcpp">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessgtkDragAndDropHandlercpp">trunk/Source/WebKit2/UIProcess/gtk/DragAndDropHandler.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (191785 => 191786)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2015-10-30 10:51:05 UTC (rev 191785)
+++ trunk/Source/WTF/ChangeLog        2015-10-30 11:28:14 UTC (rev 191786)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2015-10-29  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Use a persistent main loop source in RunLoop glib implementation
+        https://bugs.webkit.org/show_bug.cgi?id=150590
+
+        Reviewed by Žan Doberšek.
+
+        It's more efficient than creating and destroying a new source for
+        every dispatch and it simplifies the code.
+
+        * wtf/RunLoop.h:
+        * wtf/glib/MainThreadGLib.cpp:
+        (WTF::scheduleDispatchFunctionsOnMainThread): Use
+        RunLoop::dispatch() instead of GMainLoopSource::scheduleAndDeleteOnDestroy().
+        * wtf/glib/RunLoopGLib.cpp:
+        (WTF::RunLoop::RunLoop): Create and setup the persistent source.
+        (WTF::RunLoop::~RunLoop): Destroy the persistent source.
+        (WTF::RunLoop::stop): Stop the persistent source before stopping
+        the main loop.
+        (WTF::RunLoop::wakeUp): Make the persistent source active. We
+        no longer need to explicitly wakeup the context.
+        (WTF::RunLoop::TimerBase::TimerBase): Create and setup the
+        persistent source.
+        (WTF::RunLoop::TimerBase::~TimerBase): Destroy the persistent source.
+        (WTF::RunLoop::TimerBase::updateReadyTime): Set the ready time
+        according to the fire interval.
+        (WTF::RunLoop::TimerBase::start): Make the persistent source active.
+        (WTF::RunLoop::TimerBase::stop): Stop the persistent source.
+        (WTF::RunLoop::TimerBase::isActive): Return whether the
+        persistent source is active.
+
</ins><span class="cx"> 2015-10-30  Philippe Normand  &lt;pnormand@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK][Mac] fix WTF build
</span></span></pre></div>
<a id="trunkSourceWTFwtfRunLooph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/RunLoop.h (191785 => 191786)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/RunLoop.h        2015-10-30 10:51:05 UTC (rev 191785)
+++ trunk/Source/WTF/wtf/RunLoop.h        2015-10-30 11:28:14 UTC (rev 191786)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> #include &lt;wtf/Threading.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if USE(GLIB)
</span><del>-#include &lt;wtf/glib/GMainLoopSource.h&gt;
</del><ins>+#include &lt;wtf/glib/GRefPtr.h&gt;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(EFL)
</span><span class="lines">@@ -100,7 +100,10 @@
</span><span class="cx">         Ecore_Timer* m_timer;
</span><span class="cx">         bool m_isRepeating;
</span><span class="cx"> #elif USE(GLIB)
</span><del>-        GMainLoopSource m_timerSource;
</del><ins>+        void updateReadyTime();
+        GRefPtr&lt;GSource&gt; m_source;
+        bool m_isRepeating { false };
+        std::chrono::microseconds m_fireInterval { 0 };
</ins><span class="cx"> #endif
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="lines">@@ -155,11 +158,9 @@
</span><span class="cx"> 
</span><span class="cx">     static void wakeUpEvent(void* data, void*, unsigned);
</span><span class="cx"> #elif USE(GLIB)
</span><del>-public:
-    static gboolean queueWork(RunLoop*);
-private:
</del><span class="cx">     GRefPtr&lt;GMainContext&gt; m_mainContext;
</span><span class="cx">     Vector&lt;GRefPtr&lt;GMainLoop&gt;&gt; m_mainLoops;
</span><ins>+    GRefPtr&lt;GSource&gt; m_source;
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWTFwtfglibMainThreadGLibcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/glib/MainThreadGLib.cpp (191785 => 191786)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/glib/MainThreadGLib.cpp        2015-10-30 10:51:05 UTC (rev 191785)
+++ trunk/Source/WTF/wtf/glib/MainThreadGLib.cpp        2015-10-30 11:28:14 UTC (rev 191786)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;MainThread.h&quot;
</span><span class="cx"> 
</span><del>-#include &lt;wtf/glib/GMainLoopSource.h&gt;
</del><ins>+#include &lt;wtf/RunLoop.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span><span class="cx"> 
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> 
</span><span class="cx"> void scheduleDispatchFunctionsOnMainThread()
</span><span class="cx"> {
</span><del>-    GMainLoopSource::scheduleAndDeleteOnDestroy(&quot;[WebKit] dispatchFunctionsFromMainThread&quot;, std::function&lt;void()&gt;(dispatchFunctionsFromMainThread));
</del><ins>+    RunLoop::main().dispatch(std::function&lt;void()&gt;(dispatchFunctionsFromMainThread));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WTF
</span></span></pre></div>
<a id="trunkSourceWTFwtfglibRunLoopGLibcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/glib/RunLoopGLib.cpp (191785 => 191786)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/glib/RunLoopGLib.cpp        2015-10-30 10:51:05 UTC (rev 191785)
+++ trunk/Source/WTF/wtf/glib/RunLoopGLib.cpp        2015-10-30 11:28:14 UTC (rev 191786)
</span><span class="lines">@@ -32,6 +32,22 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span><span class="cx"> 
</span><ins>+static GSourceFuncs runLoopSourceFunctions = {
+    nullptr, // prepare
+    nullptr, // check
+    // dispatch
+    [](GSource* source, GSourceFunc callback, gpointer userData) -&gt; gboolean
+    {
+        if (g_source_get_ready_time(source) == -1)
+            return G_SOURCE_CONTINUE;
+        g_source_set_ready_time(source, -1);
+        return callback(userData);
+    },
+    nullptr, // finalize
+    nullptr, // closure_callback
+    nullptr, // closure_marshall
+};
+
</ins><span class="cx"> RunLoop::RunLoop()
</span><span class="cx"> {
</span><span class="cx">     m_mainContext = g_main_context_get_thread_default();
</span><span class="lines">@@ -42,10 +58,21 @@
</span><span class="cx">     GRefPtr&lt;GMainLoop&gt; innermostLoop = adoptGRef(g_main_loop_new(m_mainContext.get(), FALSE));
</span><span class="cx">     ASSERT(innermostLoop);
</span><span class="cx">     m_mainLoops.append(innermostLoop);
</span><ins>+
+    m_source = adoptGRef(g_source_new(&amp;runLoopSourceFunctions, sizeof(GSource)));
+    g_source_set_name(m_source.get(), &quot;[WebKit] RunLoop work&quot;);
+    g_source_set_can_recurse(m_source.get(), TRUE);
+    g_source_set_callback(m_source.get(), [](gpointer userData) -&gt; gboolean {
+        static_cast&lt;RunLoop*&gt;(userData)-&gt;performWork();
+        return G_SOURCE_CONTINUE;
+    }, this, nullptr);
+    g_source_attach(m_source.get(), m_mainContext.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RunLoop::~RunLoop()
</span><span class="cx"> {
</span><ins>+    g_source_destroy(m_source.get());
+
</ins><span class="cx">     for (int i = m_mainLoops.size() - 1; i &gt;= 0; --i) {
</span><span class="cx">         if (!g_main_loop_is_running(m_mainLoops[i].get()))
</span><span class="cx">             continue;
</span><span class="lines">@@ -91,37 +118,49 @@
</span><span class="cx"> 
</span><span class="cx"> void RunLoop::wakeUp()
</span><span class="cx"> {
</span><del>-    RefPtr&lt;RunLoop&gt; runLoop(this);
-    GMainLoopSource::scheduleAndDeleteOnDestroy(&quot;[WebKit] RunLoop work&quot;, std::function&lt;void()&gt;([runLoop] {
-        runLoop-&gt;performWork();
-    }), G_PRIORITY_DEFAULT, nullptr, m_mainContext.get());
-    g_main_context_wakeup(m_mainContext.get());
</del><ins>+    g_source_set_ready_time(m_source.get(), g_get_monotonic_time());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RunLoop::TimerBase::TimerBase(RunLoop&amp; runLoop)
</span><span class="cx">     : m_runLoop(runLoop)
</span><ins>+    , m_source(adoptGRef(g_source_new(&amp;runLoopSourceFunctions, sizeof(GSource))))
</ins><span class="cx"> {
</span><ins>+    g_source_set_name(m_source.get(), &quot;[WebKit] RunLoop::Timer work&quot;);
+    g_source_set_callback(m_source.get(), [](gpointer userData) -&gt; gboolean {
+        RunLoop::TimerBase* timer = static_cast&lt;RunLoop::TimerBase*&gt;(userData);
+        timer-&gt;fired();
+        if (timer-&gt;m_isRepeating)
+            timer-&gt;updateReadyTime();
+        return G_SOURCE_CONTINUE;
+    }, this, nullptr);
+    g_source_attach(m_source.get(), m_runLoop.m_mainContext.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RunLoop::TimerBase::~TimerBase()
</span><span class="cx"> {
</span><del>-    stop();
</del><ins>+    g_source_destroy(m_source.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RunLoop::TimerBase::updateReadyTime()
+{
+    g_source_set_ready_time(m_source.get(), m_fireInterval.count() ? g_get_monotonic_time() + m_fireInterval.count() : 0);
+}
+
</ins><span class="cx"> void RunLoop::TimerBase::start(double fireInterval, bool repeat)
</span><span class="cx"> {
</span><del>-    m_timerSource.scheduleAfterDelay(&quot;[WebKit] RunLoop::Timer&quot;, std::function&lt;bool ()&gt;([this, repeat] { fired(); return repeat; }),
-        std::chrono::duration_cast&lt;std::chrono::milliseconds&gt;(std::chrono::duration&lt;double&gt;(fireInterval)), G_PRIORITY_DEFAULT, nullptr, m_runLoop.m_mainContext.get());
</del><ins>+    m_fireInterval = std::chrono::duration_cast&lt;std::chrono::microseconds&gt;(std::chrono::duration&lt;double&gt;(fireInterval));
+    m_isRepeating = repeat;
+    updateReadyTime();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RunLoop::TimerBase::stop()
</span><span class="cx"> {
</span><del>-    m_timerSource.cancel();
</del><ins>+    g_source_set_ready_time(m_source.get(), -1);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RunLoop::TimerBase::isActive() const
</span><span class="cx"> {
</span><del>-    return m_timerSource.isScheduled();
</del><ins>+    return g_source_get_ready_time(m_source.get()) != -1;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WTF
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (191785 => 191786)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-10-30 10:51:05 UTC (rev 191785)
+++ trunk/Source/WebKit2/ChangeLog        2015-10-30 11:28:14 UTC (rev 191786)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-10-29  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Use a persistent main loop source in RunLoop glib implementation
+        https://bugs.webkit.org/show_bug.cgi?id=150590
+
+        Reviewed by Žan Doberšek.
+
+        Use RunLoop::dispatch() instead of
+        GMainLoopSource::scheduleAndDeleteOnDestroy in a couple of simple
+        cases.
+
+        * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
+        (WebKit::NetworkCache::runTaskInQueue):
+        * UIProcess/gtk/DragAndDropHandler.cpp:
+        (WebKit::DragAndDropHandler::dragLeave):
+
</ins><span class="cx"> 2015-10-29  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Make WebCore a framework in Mac CMake build
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheIOChannelSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp (191785 => 191786)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp        2015-10-30 10:51:05 UTC (rev 191785)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp        2015-10-30 11:28:14 UTC (rev 191786)
</span><span class="lines">@@ -30,8 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;NetworkCacheFileSystem.h&quot;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><del>-#include &lt;wtf/glib/GMainLoopSource.h&gt;
-#include &lt;wtf/glib/GMutexLocker.h&gt;
</del><ins>+#include &lt;wtf/RunLoop.h&gt;
</ins><span class="cx"> #include &lt;wtf/glib/GUniquePtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -78,7 +77,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Using nullptr as queue submits the result to the main context.
</span><del>-    GMainLoopSource::scheduleAndDeleteOnDestroy(&quot;[WebKit] IOChannel task&quot;, WTF::move(task));
</del><ins>+    RunLoop::main().dispatch(WTF::move(task));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void fillDataFromReadBuffer(SoupBuffer* readBuffer, size_t size, Data&amp; data)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessgtkDragAndDropHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/gtk/DragAndDropHandler.cpp (191785 => 191786)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/gtk/DragAndDropHandler.cpp        2015-10-30 10:51:05 UTC (rev 191785)
+++ trunk/Source/WebKit2/UIProcess/gtk/DragAndDropHandler.cpp        2015-10-30 11:28:14 UTC (rev 191786)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> #include &lt;WebCore/GtkUtilities.h&gt;
</span><span class="cx"> #include &lt;WebCore/PasteboardHelper.h&gt;
</span><span class="cx"> #include &lt;gtk/gtk.h&gt;
</span><del>-#include &lt;wtf/glib/GMainLoopSource.h&gt;
</del><ins>+#include &lt;wtf/RunLoop.h&gt;
</ins><span class="cx"> #include &lt;wtf/glib/GUniquePtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -221,7 +221,7 @@
</span><span class="cx">     // During a drop GTK+ will fire a drag-leave signal right before firing
</span><span class="cx">     // the drag-drop signal. We want the actions for drag-leave to happen after
</span><span class="cx">     // those for drag-drop, so schedule them to happen asynchronously here.
</span><del>-    GMainLoopSource::scheduleAndDeleteOnDestroy(&quot;[WebKit] handleDragLeaveLater&quot;, [this, droppingContext]() {
</del><ins>+    RunLoop::main().dispatch([this, droppingContext]() {
</ins><span class="cx">         auto it = m_droppingContexts.find(droppingContext-&gt;gdkContext);
</span><span class="cx">         if (it == m_droppingContexts.end())
</span><span class="cx">             return;
</span></span></pre>
</div>
</div>

</body>
</html>