<!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>[192791] trunk</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/192791">192791</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-11-30 00:05:51 -0800 (Mon, 30 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GLIB] Remove GMainLoopSource and GThreadSafeMainLoopSource
https://bugs.webkit.org/show_bug.cgi?id=151633

Reviewed by Csaba Osztrogonác.

Source/WTF:

* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* wtf/PlatformEfl.cmake:
* wtf/PlatformGTK.cmake:
* wtf/glib/GMainLoopSource.cpp: Removed.
* wtf/glib/GMainLoopSource.h: Removed.
* wtf/glib/GThreadSafeMainLoopSource.cpp: Removed.
* wtf/glib/GThreadSafeMainLoopSource.h: Removed.

Tools:

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/Tests/WTF/glib/GMainLoopSource.cpp: Removed.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFWTFvcxprojWTFvcxproj">trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj</a></li>
<li><a href="#trunkSourceWTFWTFvcxprojWTFvcxprojfilters">trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters</a></li>
<li><a href="#trunkSourceWTFwtfPlatformEflcmake">trunk/Source/WTF/wtf/PlatformEfl.cmake</a></li>
<li><a href="#trunkSourceWTFwtfPlatformGTKcmake">trunk/Source/WTF/wtf/PlatformGTK.cmake</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPIPlatformGTKcmake">trunk/Tools/TestWebKitAPI/PlatformGTK.cmake</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWTFwtfglibGMainLoopSourcecpp">trunk/Source/WTF/wtf/glib/GMainLoopSource.cpp</a></li>
<li><a href="#trunkSourceWTFwtfglibGMainLoopSourceh">trunk/Source/WTF/wtf/glib/GMainLoopSource.h</a></li>
<li><a href="#trunkSourceWTFwtfglibGThreadSafeMainLoopSourcecpp">trunk/Source/WTF/wtf/glib/GThreadSafeMainLoopSource.cpp</a></li>
<li><a href="#trunkSourceWTFwtfglibGThreadSafeMainLoopSourceh">trunk/Source/WTF/wtf/glib/GThreadSafeMainLoopSource.h</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWTFglibGMainLoopSourcecpp">trunk/Tools/TestWebKitAPI/Tests/WTF/glib/GMainLoopSource.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (192790 => 192791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2015-11-30 00:56:22 UTC (rev 192790)
+++ trunk/Source/WTF/ChangeLog        2015-11-30 08:05:51 UTC (rev 192791)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-11-30  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GLIB] Remove GMainLoopSource and GThreadSafeMainLoopSource
+        https://bugs.webkit.org/show_bug.cgi?id=151633
+
+        Reviewed by Csaba Osztrogonác.
+
+        * WTF.vcxproj/WTF.vcxproj:
+        * WTF.vcxproj/WTF.vcxproj.filters:
+        * wtf/PlatformEfl.cmake:
+        * wtf/PlatformGTK.cmake:
+        * wtf/glib/GMainLoopSource.cpp: Removed.
+        * wtf/glib/GMainLoopSource.h: Removed.
+        * wtf/glib/GThreadSafeMainLoopSource.cpp: Removed.
+        * wtf/glib/GThreadSafeMainLoopSource.h: Removed.
+
</ins><span class="cx"> 2015-11-27  Csaba Osztrogonác  &lt;ossy@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix build warning in bignum.cc
</span></span></pre></div>
<a id="trunkSourceWTFWTFvcxprojWTFvcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj (192790 => 192791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj        2015-11-30 00:56:22 UTC (rev 192790)
+++ trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj        2015-11-30 08:05:51 UTC (rev 192791)
</span><span class="lines">@@ -83,16 +83,6 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\wtf\glib\GMainLoopSource.cpp&quot;&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-    &lt;/ClCompile&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\wtf\glib\GRefPtr.cpp&quot;&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="lines">@@ -103,7 +93,6 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\wtf\glib\GThreadSafeMainLoopSource.cpp&quot; /&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\wtf\GregorianDateTime.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\wtf\HashTable.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\wtf\Lock.cpp&quot; /&gt;
</span><span class="lines">@@ -209,11 +198,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\wtf\Functional.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\wtf\GetPtr.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\wtf\glib\GLibUtilities.h&quot; /&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\wtf\glib\GMainLoopSource.h&quot; /&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\wtf\glib\GMutexLocker.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\wtf\glib\GTypedefs.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\wtf\glib\GRefPtr.h&quot; /&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\wtf\glib\GThreadSafeMainLoopSource.h&quot; /&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\wtf\glib\GUniquePtr.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\wtf\GregorianDateTime.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\wtf\HashCountedSet.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWTFWTFvcxprojWTFvcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters (192790 => 192791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters        2015-11-30 00:56:22 UTC (rev 192790)
+++ trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters        2015-11-30 08:05:51 UTC (rev 192791)
</span><span class="lines">@@ -240,15 +240,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\wtf\win\RunLoopWin.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;wtf\win&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\wtf\glib\GMainLoopSource.cpp&quot;&gt;
-      &lt;Filter&gt;wtf\glib&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\wtf\FastBitVector.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;wtf&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\wtf\glib\GThreadSafeMainLoopSource.cpp&quot;&gt;
-      &lt;Filter&gt;wtf\glib&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\wtf\RefCounter.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\wtf\win\WTFDLL.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;wtf\win&lt;/Filter&gt;
</span><span class="lines">@@ -707,18 +701,12 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\wtf\RunLoop.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;wtf&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\wtf\glib\GMainLoopSource.h&quot;&gt;
-      &lt;Filter&gt;wtf\glib&lt;/Filter&gt;
-    &lt;/ClInclude&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\wtf\glib\GUniquePtr.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;wtf\glib&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\wtf\HashMethod.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;wtf&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\wtf\glib\GThreadSafeMainLoopSource.h&quot;&gt;
-      &lt;Filter&gt;wtf\glib&lt;/Filter&gt;
-    &lt;/ClInclude&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\wtf\RefCounter.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\wtf\WorkQueue.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;wtf&lt;/Filter&gt;
</span></span></pre></div>
<a id="trunkSourceWTFwtfPlatformEflcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/PlatformEfl.cmake (192790 => 192791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/PlatformEfl.cmake        2015-11-30 00:56:22 UTC (rev 192790)
+++ trunk/Source/WTF/wtf/PlatformEfl.cmake        2015-11-30 08:05:51 UTC (rev 192791)
</span><span class="lines">@@ -4,9 +4,7 @@
</span><span class="cx">     efl/RunLoopEfl.cpp
</span><span class="cx">     efl/WorkQueueEfl.cpp
</span><span class="cx"> 
</span><del>-    glib/GMainLoopSource.cpp
</del><span class="cx">     glib/GRefPtr.cpp
</span><del>-    glib/GThreadSafeMainLoopSource.cpp
</del><span class="cx"> )
</span><span class="cx"> 
</span><span class="cx"> list(APPEND WTF_LIBRARIES
</span></span></pre></div>
<a id="trunkSourceWTFwtfPlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/PlatformGTK.cmake (192790 => 192791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/PlatformGTK.cmake        2015-11-30 00:56:22 UTC (rev 192790)
+++ trunk/Source/WTF/wtf/PlatformGTK.cmake        2015-11-30 08:05:51 UTC (rev 192791)
</span><span class="lines">@@ -3,9 +3,7 @@
</span><span class="cx"> 
</span><span class="cx"> list(APPEND WTF_SOURCES
</span><span class="cx">     glib/GLibUtilities.cpp
</span><del>-    glib/GMainLoopSource.cpp
</del><span class="cx">     glib/GRefPtr.cpp
</span><del>-    glib/GThreadSafeMainLoopSource.cpp
</del><span class="cx">     glib/MainThreadGLib.cpp
</span><span class="cx">     glib/RunLoopGLib.cpp
</span><span class="cx">     glib/WorkQueueGLib.cpp
</span></span></pre></div>
<a id="trunkSourceWTFwtfglibGMainLoopSourcecpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WTF/wtf/glib/GMainLoopSource.cpp (192790 => 192791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/glib/GMainLoopSource.cpp        2015-11-30 00:56:22 UTC (rev 192790)
+++ trunk/Source/WTF/wtf/glib/GMainLoopSource.cpp        2015-11-30 08:05:51 UTC (rev 192791)
</span><span class="lines">@@ -1,333 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 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 &quot;config.h&quot;
-#include &quot;GMainLoopSource.h&quot;
-
-#if USE(GLIB)
-
-#include &lt;gio/gio.h&gt;
-
-namespace WTF {
-
-GMainLoopSource::~GMainLoopSource()
-{
-    cancel();
-}
-
-bool GMainLoopSource::isScheduled() const
-{
-    return m_status == Scheduled;
-}
-
-bool GMainLoopSource::isActive() const
-{
-    return m_status != Ready;
-}
-
-void GMainLoopSource::cancel()
-{
-    // A valid context should only be present if GMainLoopSource is in the Scheduled or Dispatching state.
-    ASSERT(!m_context.source || m_status == Scheduled || m_status == Dispatching);
-
-    m_status = Ready;
-
-    if (!m_context.source)
-        return;
-
-    Context context;
-    context = WTF::move(m_context);
-    context.destroySource();
-}
-
-void GMainLoopSource::scheduleIdleSource(const char* name, GSourceFunc sourceFunction, int priority, GMainContext* context)
-{
-    ASSERT(m_status == Ready);
-    m_status = Scheduled;
-
-    g_source_set_name(m_context.source.get(), name);
-    if (priority != G_PRIORITY_DEFAULT_IDLE)
-        g_source_set_priority(m_context.source.get(), priority);
-    g_source_set_callback(m_context.source.get(), sourceFunction, this, nullptr);
-    g_source_attach(m_context.source.get(), context);
-}
-
-void GMainLoopSource::schedule(const char* name, std::function&lt;void ()&gt;&amp;&amp; function, int priority, std::function&lt;void ()&gt;&amp;&amp; destroyFunction, GMainContext* context)
-{
-    cancel();
-
-    ASSERT(!m_context.source);
-    m_context = {
-        adoptGRef(g_idle_source_new()),
-        nullptr, // cancellable
-        WTF::move(function),
-        nullptr, // boolCallback
-        WTF::move(destroyFunction)
-    };
-    scheduleIdleSource(name, reinterpret_cast&lt;GSourceFunc&gt;(voidSourceCallback), priority, context);
-}
-
-void GMainLoopSource::schedule(const char* name, std::function&lt;bool ()&gt;&amp;&amp; function, int priority, std::function&lt;void ()&gt;&amp;&amp; destroyFunction, GMainContext* context)
-{
-    cancel();
-
-    ASSERT(!m_context.source);
-    m_context = {
-        adoptGRef(g_idle_source_new()),
-        nullptr, // cancellable
-        nullptr, // voidCallback
-        WTF::move(function),
-        WTF::move(destroyFunction)
-    };
-    scheduleIdleSource(name, reinterpret_cast&lt;GSourceFunc&gt;(boolSourceCallback), priority, context);
-}
-
-void GMainLoopSource::scheduleTimeoutSource(const char* name, GSourceFunc sourceFunction, int priority, GMainContext* context)
-{
-    ASSERT(m_status == Ready);
-    m_status = Scheduled;
-
-    g_source_set_name(m_context.source.get(), name);
-    if (priority != G_PRIORITY_DEFAULT)
-        g_source_set_priority(m_context.source.get(), priority);
-    g_source_set_callback(m_context.source.get(), sourceFunction, this, nullptr);
-    g_source_attach(m_context.source.get(), context);
-}
-
-void GMainLoopSource::scheduleAfterDelay(const char* name, std::function&lt;void ()&gt;&amp;&amp; function, std::chrono::milliseconds delay, int priority, std::function&lt;void ()&gt;&amp;&amp; destroyFunction, GMainContext* context)
-{
-    cancel();
-
-    ASSERT(!m_context.source);
-    m_context = {
-        adoptGRef(g_timeout_source_new(delay.count())),
-        nullptr, // cancellable
-        WTF::move(function),
-        nullptr, // boolCallback
-        WTF::move(destroyFunction)
-    };
-    scheduleTimeoutSource(name, reinterpret_cast&lt;GSourceFunc&gt;(voidSourceCallback), priority, context);
-}
-
-void GMainLoopSource::scheduleAfterDelay(const char* name, std::function&lt;bool ()&gt;&amp;&amp; function, std::chrono::milliseconds delay, int priority, std::function&lt;void ()&gt;&amp;&amp; destroyFunction, GMainContext* context)
-{
-    cancel();
-
-    ASSERT(!m_context.source);
-    m_context = {
-        adoptGRef(g_timeout_source_new(delay.count())),
-        nullptr, // cancellable
-        nullptr, // voidCallback
-        WTF::move(function),
-        WTF::move(destroyFunction)
-    };
-    scheduleTimeoutSource(name, reinterpret_cast&lt;GSourceFunc&gt;(boolSourceCallback), priority, context);
-}
-
-void GMainLoopSource::scheduleAfterDelay(const char* name, std::function&lt;void ()&gt;&amp;&amp; function, std::chrono::seconds delay, int priority, std::function&lt;void ()&gt;&amp;&amp; destroyFunction, GMainContext* context)
-{
-    cancel();
-
-    ASSERT(!m_context.source);
-    m_context = {
-        adoptGRef(g_timeout_source_new_seconds(delay.count())),
-        nullptr, // cancellable
-        WTF::move(function),
-        nullptr, // boolCallback
-        WTF::move(destroyFunction)
-    };
-    scheduleTimeoutSource(name, reinterpret_cast&lt;GSourceFunc&gt;(voidSourceCallback), priority, context);
-}
-
-void GMainLoopSource::scheduleAfterDelay(const char* name, std::function&lt;bool ()&gt;&amp;&amp; function, std::chrono::seconds delay, int priority, std::function&lt;void ()&gt;&amp;&amp; destroyFunction, GMainContext* context)
-{
-    cancel();
-
-    ASSERT(!m_context.source);
-    m_context = {
-        adoptGRef(g_timeout_source_new_seconds(delay.count())),
-        nullptr, // cancellable
-        nullptr, // voidCallback
-        WTF::move(function),
-        WTF::move(destroyFunction)
-    };
-    scheduleTimeoutSource(name, reinterpret_cast&lt;GSourceFunc&gt;(boolSourceCallback), priority, context);
-}
-
-struct MicrosecondsTimeoutSource {
-    GSource source;
-    uint64_t delay;
-};
-
-static GSourceFuncs microsecondsTimeoutSourceFunctions = {
-    nullptr, // prepare
-    nullptr, // check
-    // dispatch
-    [](GSource* source, GSourceFunc callback, gpointer userData) -&gt; gboolean
-    {
-        bool repeat = callback(userData);
-        if (repeat)
-            g_source_set_ready_time(source, g_source_get_time(source) + reinterpret_cast&lt;MicrosecondsTimeoutSource*&gt;(source)-&gt;delay);
-        return repeat;
-    },
-    nullptr, // finalize
-    nullptr, // closure_callback
-    nullptr // closure_marshall
-};
-
-static GSource* createMicrosecondsTimeoutSource(uint64_t delay)
-{
-    GSource* source = g_source_new(&amp;microsecondsTimeoutSourceFunctions, sizeof(MicrosecondsTimeoutSource));
-    reinterpret_cast&lt;MicrosecondsTimeoutSource*&gt;(source)-&gt;delay = delay;
-    g_source_set_ready_time(source, g_get_monotonic_time() + delay);
-    return source;
-}
-
-void GMainLoopSource::scheduleAfterDelay(const char* name, std::function&lt;void ()&gt;&amp;&amp; function, std::chrono::microseconds delay, int priority, std::function&lt;void ()&gt;&amp;&amp; destroyFunction, GMainContext* context)
-{
-    cancel();
-
-    ASSERT(!m_context.source);
-    m_context = {
-        adoptGRef(createMicrosecondsTimeoutSource(delay.count())),
-        nullptr, // cancellable
-        WTF::move(function),
-        nullptr, // boolCallback
-        WTF::move(destroyFunction)
-    };
-    scheduleTimeoutSource(name, reinterpret_cast&lt;GSourceFunc&gt;(voidSourceCallback), priority, context);
-}
-
-void GMainLoopSource::scheduleAfterDelay(const char* name, std::function&lt;bool ()&gt;&amp;&amp; function, std::chrono::microseconds delay, int priority, std::function&lt;void ()&gt;&amp;&amp; destroyFunction, GMainContext* context)
-{
-    cancel();
-
-    ASSERT(!m_context.source);
-    m_context = {
-        adoptGRef(createMicrosecondsTimeoutSource(delay.count())),
-        nullptr, // cancellable
-        nullptr, // voidCallback
-        WTF::move(function),
-        WTF::move(destroyFunction)
-    };
-    scheduleTimeoutSource(name, reinterpret_cast&lt;GSourceFunc&gt;(boolSourceCallback), priority, context);
-}
-
-bool GMainLoopSource::prepareVoidCallback(Context&amp; context)
-{
-    if (!m_context.source)
-        return false;
-
-    context = WTF::move(m_context);
-
-    ASSERT(context.voidCallback);
-    ASSERT(m_status == Scheduled);
-    m_status = Dispatching;
-
-    return true;
-}
-
-void GMainLoopSource::finishVoidCallback()
-{
-    m_status = Ready;
-}
-
-void GMainLoopSource::voidCallback()
-{
-    Context context;
-    if (!prepareVoidCallback(context))
-        return;
-
-    context.voidCallback();
-    if (m_status != Ready &amp;&amp; !m_context.source) {
-        // Switch to Ready if it hasn't been re-scheduled or cancelled.
-        finishVoidCallback();
-    }
-
-    context.destroySource();
-}
-
-bool GMainLoopSource::prepareBoolCallback(Context&amp; context)
-{
-    if (!m_context.source)
-        return false;
-
-    context = WTF::move(m_context);
-
-    ASSERT(context.boolCallback);
-    ASSERT(m_status == Scheduled || m_status == Dispatching);
-    m_status = Dispatching;
-    return true;
-}
-
-void GMainLoopSource::finishBoolCallback(bool retval, Context&amp; context)
-{
-    // m_status should reflect whether the GMainLoopSource has been rescheduled during dispatch.
-    ASSERT((!m_context.source &amp;&amp; m_status == Dispatching) || m_status == Scheduled);
-    if (retval &amp;&amp; !m_context.source)
-        m_context = WTF::move(context);
-    else if (!retval)
-        m_status = Ready;
-}
-
-bool GMainLoopSource::boolCallback()
-{
-    Context context;
-    if (!prepareBoolCallback(context))
-        return Stop;
-
-    bool retval = context.boolCallback();
-    if (m_status != Ready &amp;&amp; !m_context.source) {
-        // Prepare for a new iteration or switch to Ready if it hasn't been re-scheduled or cancelled.
-        finishBoolCallback(retval, context);
-    }
-
-    if (context.source)
-        context.destroySource();
-
-    return retval;
-}
-
-gboolean GMainLoopSource::voidSourceCallback(GMainLoopSource* source)
-{
-    source-&gt;voidCallback();
-    return G_SOURCE_REMOVE;
-}
-
-gboolean GMainLoopSource::boolSourceCallback(GMainLoopSource* source)
-{
-    return source-&gt;boolCallback() == Continue;
-}
-
-void GMainLoopSource::Context::destroySource()
-{
-    g_source_destroy(source.get());
-    if (destroyCallback)
-        destroyCallback();
-}
-
-} // namespace WTF
-
-#endif // USE(GLIB)
</del></span></pre></div>
<a id="trunkSourceWTFwtfglibGMainLoopSourceh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WTF/wtf/glib/GMainLoopSource.h (192790 => 192791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/glib/GMainLoopSource.h        2015-11-30 00:56:22 UTC (rev 192790)
+++ trunk/Source/WTF/wtf/glib/GMainLoopSource.h        2015-11-30 08:05:51 UTC (rev 192791)
</span><span class="lines">@@ -1,111 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 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 GMainLoopSource_h
-#define GMainLoopSource_h
-
-#if USE(GLIB)
-
-#include &lt;functional&gt;
-#include &lt;glib.h&gt;
-#include &lt;wtf/Noncopyable.h&gt;
-#include &lt;wtf/glib/GRefPtr.h&gt;
-
-namespace WTF {
-
-class GMainLoopSource {
-    WTF_MAKE_NONCOPYABLE(GMainLoopSource);
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    WTF_EXPORT_PRIVATE GMainLoopSource() = default;
-    WTF_EXPORT_PRIVATE virtual ~GMainLoopSource();
-
-    static const bool Stop = false;
-    static const bool Continue = true;
-
-    WTF_EXPORT_PRIVATE bool isScheduled() const;
-    WTF_EXPORT_PRIVATE bool isActive() const;
-
-    WTF_EXPORT_PRIVATE virtual void schedule(const char* name, std::function&lt;void()&gt;&amp;&amp;, int priority = G_PRIORITY_DEFAULT, std::function&lt;void()&gt;&amp;&amp; destroyFunction = nullptr, GMainContext* = nullptr);
-    WTF_EXPORT_PRIVATE virtual void schedule(const char* name, std::function&lt;bool()&gt;&amp;&amp;, int priority = G_PRIORITY_DEFAULT, std::function&lt;void()&gt;&amp;&amp; destroyFunction = nullptr, GMainContext* = nullptr);
-    WTF_EXPORT_PRIVATE virtual void scheduleAfterDelay(const char* name, std::function&lt;void()&gt;&amp;&amp;, std::chrono::milliseconds, int priority = G_PRIORITY_DEFAULT, std::function&lt;void()&gt;&amp;&amp; destroyFunction = nullptr, GMainContext* = nullptr);
-    WTF_EXPORT_PRIVATE virtual void scheduleAfterDelay(const char* name, std::function&lt;bool()&gt;&amp;&amp;, std::chrono::milliseconds, int priority = G_PRIORITY_DEFAULT, std::function&lt;void()&gt;&amp;&amp; destroyFunction = nullptr, GMainContext* = nullptr);
-    WTF_EXPORT_PRIVATE virtual void scheduleAfterDelay(const char* name, std::function&lt;void()&gt;&amp;&amp;, std::chrono::seconds, int priority = G_PRIORITY_DEFAULT, std::function&lt;void()&gt;&amp;&amp; destroyFunction = nullptr, GMainContext* = nullptr);
-    WTF_EXPORT_PRIVATE virtual void scheduleAfterDelay(const char* name, std::function&lt;bool()&gt;&amp;&amp;, std::chrono::seconds, int priority = G_PRIORITY_DEFAULT, std::function&lt;void()&gt;&amp;&amp; destroyFunction = nullptr, GMainContext* = nullptr);
-    WTF_EXPORT_PRIVATE virtual void scheduleAfterDelay(const char* name, std::function&lt;void()&gt;&amp;&amp;, std::chrono::microseconds, int priority = G_PRIORITY_DEFAULT, std::function&lt;void()&gt;&amp;&amp; destroyFunction = nullptr, GMainContext* = nullptr);
-    WTF_EXPORT_PRIVATE virtual void scheduleAfterDelay(const char* name, std::function&lt;bool()&gt;&amp;&amp;, std::chrono::microseconds, int priority = G_PRIORITY_DEFAULT, std::function&lt;void()&gt;&amp;&amp; destroyFunction = nullptr, GMainContext* = nullptr);
-    WTF_EXPORT_PRIVATE virtual void cancel();
-
-protected:
-    enum Status { Ready, Scheduled, Dispatching };
-
-    struct Context {
-        Context() = default;
-        Context&amp; operator=(Context&amp;&amp; c)
-        {
-            source = WTF::move(c.source);
-            cancellable = WTF::move(c.cancellable);
-            voidCallback = WTF::move(c.voidCallback);
-            boolCallback = WTF::move(c.boolCallback);
-            destroyCallback = WTF::move(c.destroyCallback);
-            return *this;
-        }
-
-        void destroySource();
-
-        GRefPtr&lt;GSource&gt; source;
-        GRefPtr&lt;GCancellable&gt; cancellable;
-        std::function&lt;void ()&gt; voidCallback;
-        std::function&lt;bool ()&gt; boolCallback;
-        std::function&lt;void ()&gt; destroyCallback;
-    };
-
-    virtual void voidCallback();
-    virtual bool boolCallback();
-
-    virtual bool prepareVoidCallback(Context&amp;);
-    virtual void finishVoidCallback();
-    virtual bool prepareBoolCallback(Context&amp;);
-    virtual void finishBoolCallback(bool retval, Context&amp;);
-
-private:
-    void scheduleIdleSource(const char* name, GSourceFunc, int priority, GMainContext*);
-    void scheduleTimeoutSource(const char* name, GSourceFunc, int priority, GMainContext*);
-
-    static gboolean voidSourceCallback(GMainLoopSource*);
-    static gboolean boolSourceCallback(GMainLoopSource*);
-
-protected:
-    Context m_context;
-    Status m_status { Ready };
-};
-
-} // namespace WTF
-
-using WTF::GMainLoopSource;
-
-#endif // USE(GLIB)
-
-#endif // GMainLoopSource_h
</del></span></pre></div>
<a id="trunkSourceWTFwtfglibGThreadSafeMainLoopSourcecpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WTF/wtf/glib/GThreadSafeMainLoopSource.cpp (192790 => 192791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/glib/GThreadSafeMainLoopSource.cpp        2015-11-30 00:56:22 UTC (rev 192790)
+++ trunk/Source/WTF/wtf/glib/GThreadSafeMainLoopSource.cpp        2015-11-30 08:05:51 UTC (rev 192791)
</span><span class="lines">@@ -1,173 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 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 &quot;config.h&quot;
-#include &quot;GThreadSafeMainLoopSource.h&quot;
-
-#if USE(GLIB)
-
-#include &lt;gio/gio.h&gt;
-#include &lt;wtf/glib/GMutexLocker.h&gt;
-
-namespace WTF {
-
-GThreadSafeMainLoopSource::GThreadSafeMainLoopSource()
-{
-    g_rec_mutex_init(&amp;m_mutex);
-}
-
-GThreadSafeMainLoopSource::~GThreadSafeMainLoopSource()
-{
-    cancel();
-    g_rec_mutex_clear(&amp;m_mutex);
-}
-
-void GThreadSafeMainLoopSource::cancel()
-{
-    GMutexLocker&lt;GRecMutex&gt; locker(m_mutex);
-
-    // The general cancellable object should only be present if we're currently dispatching this GMainLoopSource.
-    ASSERT(!m_cancellable || m_status == Dispatching);
-
-    // The source is perhaps being cancelled in the middle of a callback dispatch.
-    // Cancelling this GCancellable object will convey this information to the
-    // current execution context when the callback dispatch is finished.
-    g_cancellable_cancel(m_cancellable.get());
-    m_cancellable = nullptr;
-
-    GMainLoopSource::cancel();
-}
-
-void GThreadSafeMainLoopSource::schedule(const char* name, std::function&lt;void ()&gt;&amp;&amp; function, int priority, std::function&lt;void ()&gt;&amp;&amp; destroyFunction, GMainContext* context)
-{
-    GMutexLocker&lt;GRecMutex&gt; locker(m_mutex);
-    GMainLoopSource::schedule(name, WTF::move(function), priority, WTF::move(destroyFunction), context);
-    m_context.cancellable = adoptGRef(g_cancellable_new());
-}
-
-void GThreadSafeMainLoopSource::schedule(const char* name, std::function&lt;bool ()&gt;&amp;&amp; function, int priority, std::function&lt;void ()&gt;&amp;&amp; destroyFunction, GMainContext* context)
-{
-    GMutexLocker&lt;GRecMutex&gt; locker(m_mutex);
-    GMainLoopSource::schedule(name, WTF::move(function), priority, WTF::move(destroyFunction), context);
-    m_context.cancellable = adoptGRef(g_cancellable_new());
-}
-
-void GThreadSafeMainLoopSource::scheduleAfterDelay(const char* name, std::function&lt;void ()&gt;&amp;&amp; function, std::chrono::milliseconds delay, int priority, std::function&lt;void ()&gt;&amp;&amp; destroyFunction, GMainContext* context)
-{
-    GMutexLocker&lt;GRecMutex&gt; locker(m_mutex);
-    GMainLoopSource::scheduleAfterDelay(name, WTF::move(function), delay, priority, WTF::move(destroyFunction), context);
-    m_context.cancellable = adoptGRef(g_cancellable_new());
-}
-
-void GThreadSafeMainLoopSource::scheduleAfterDelay(const char* name, std::function&lt;bool ()&gt;&amp;&amp; function, std::chrono::milliseconds delay, int priority, std::function&lt;void ()&gt;&amp;&amp; destroyFunction, GMainContext* context)
-{
-    GMutexLocker&lt;GRecMutex&gt; locker(m_mutex);
-    GMainLoopSource::scheduleAfterDelay(name, WTF::move(function), delay, priority, WTF::move(destroyFunction), context);
-    m_context.cancellable = adoptGRef(g_cancellable_new());
-}
-
-void GThreadSafeMainLoopSource::scheduleAfterDelay(const char* name, std::function&lt;void ()&gt;&amp;&amp; function, std::chrono::seconds delay, int priority, std::function&lt;void ()&gt;&amp;&amp; destroyFunction, GMainContext* context)
-{
-    GMutexLocker&lt;GRecMutex&gt; locker(m_mutex);
-    GMainLoopSource::scheduleAfterDelay(name, WTF::move(function), delay, priority, WTF::move(destroyFunction), context);
-    m_context.cancellable = adoptGRef(g_cancellable_new());
-}
-
-void GThreadSafeMainLoopSource::scheduleAfterDelay(const char* name, std::function&lt;bool ()&gt;&amp;&amp; function, std::chrono::seconds delay, int priority, std::function&lt;void ()&gt;&amp;&amp; destroyFunction, GMainContext* context)
-{
-    GMutexLocker&lt;GRecMutex&gt; locker(m_mutex);
-    GMainLoopSource::scheduleAfterDelay(name, WTF::move(function), delay, priority, WTF::move(destroyFunction), context);
-    m_context.cancellable = adoptGRef(g_cancellable_new());
-}
-
-bool GThreadSafeMainLoopSource::prepareVoidCallback(Context&amp; context)
-{
-    GMutexLocker&lt;GRecMutex&gt; locker(m_mutex);
-    bool retval = GMainLoopSource::prepareVoidCallback(context);
-    m_cancellable = context.cancellable;
-    return retval;
-}
-
-void GThreadSafeMainLoopSource::finishVoidCallback()
-{
-    GMutexLocker&lt;GRecMutex&gt; locker(m_mutex);
-    GMainLoopSource::finishVoidCallback();
-    m_cancellable = nullptr;
-}
-
-void GThreadSafeMainLoopSource::voidCallback()
-{
-    Context context;
-    if (!prepareVoidCallback(context))
-        return;
-
-    context.voidCallback();
-
-    if (g_cancellable_is_cancelled(context.cancellable.get())) {
-        context.destroySource();
-        return;
-    }
-
-    finishVoidCallback();
-    context.destroySource();
-}
-
-bool GThreadSafeMainLoopSource::prepareBoolCallback(Context&amp; context)
-{
-    GMutexLocker&lt;GRecMutex&gt; locker(m_mutex);
-    bool retval = GMainLoopSource::prepareBoolCallback(context);
-    m_cancellable = context.cancellable;
-    return retval;
-}
-
-void GThreadSafeMainLoopSource::finishBoolCallback(bool retval, Context&amp; context)
-{
-    GMutexLocker&lt;GRecMutex&gt; locker(m_mutex);
-    GMainLoopSource::finishBoolCallback(retval, context);
-    m_cancellable = nullptr;
-}
-
-bool GThreadSafeMainLoopSource::boolCallback()
-{
-    Context context;
-    if (!prepareBoolCallback(context))
-        return Stop;
-
-    bool retval = context.boolCallback();
-
-    if (g_cancellable_is_cancelled(context.cancellable.get())) {
-        context.destroySource();
-        return Stop;
-    }
-
-    finishBoolCallback(retval, context);
-    if (context.source)
-        context.destroySource();
-    return retval;
-}
-
-} // namespace WTF
-
-#endif // USE(GLIB)
</del></span></pre></div>
<a id="trunkSourceWTFwtfglibGThreadSafeMainLoopSourceh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WTF/wtf/glib/GThreadSafeMainLoopSource.h (192790 => 192791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/glib/GThreadSafeMainLoopSource.h        2015-11-30 00:56:22 UTC (rev 192790)
+++ trunk/Source/WTF/wtf/glib/GThreadSafeMainLoopSource.h        2015-11-30 08:05:51 UTC (rev 192791)
</span><span class="lines">@@ -1,71 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 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 GThreadSafeMainLoopSource_h
-#define GThreadSafeMainLoopSource_h
-
-#if USE(GLIB)
-
-#include &lt;wtf/glib/GMainLoopSource.h&gt;
-
-typedef struct _GRecMutex GRecMutex;
-
-namespace WTF {
-
-class GThreadSafeMainLoopSource final : public GMainLoopSource {
-    WTF_MAKE_NONCOPYABLE(GThreadSafeMainLoopSource);
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    WTF_EXPORT_PRIVATE GThreadSafeMainLoopSource();
-    WTF_EXPORT_PRIVATE virtual ~GThreadSafeMainLoopSource();
-
-    WTF_EXPORT_PRIVATE virtual void schedule(const char* name, std::function&lt;void()&gt;&amp;&amp;, int priority = G_PRIORITY_DEFAULT, std::function&lt;void()&gt;&amp;&amp; destroyFunction = nullptr, GMainContext* = nullptr) override;
-    WTF_EXPORT_PRIVATE virtual void schedule(const char* name, std::function&lt;bool()&gt;&amp;&amp;, int priority = G_PRIORITY_DEFAULT, std::function&lt;void()&gt;&amp;&amp; destroyFunction = nullptr, GMainContext* = nullptr) override;
-    WTF_EXPORT_PRIVATE virtual void scheduleAfterDelay(const char* name, std::function&lt;void()&gt;&amp;&amp;, std::chrono::milliseconds, int priority = G_PRIORITY_DEFAULT, std::function&lt;void()&gt;&amp;&amp; destroyFunction = nullptr, GMainContext* = nullptr) override;
-    WTF_EXPORT_PRIVATE virtual void scheduleAfterDelay(const char* name, std::function&lt;bool()&gt;&amp;&amp;, std::chrono::milliseconds, int priority = G_PRIORITY_DEFAULT, std::function&lt;void()&gt;&amp;&amp; destroyFunction = nullptr, GMainContext* = nullptr) override;
-    WTF_EXPORT_PRIVATE virtual void scheduleAfterDelay(const char* name, std::function&lt;void()&gt;&amp;&amp;, std::chrono::seconds, int priority = G_PRIORITY_DEFAULT, std::function&lt;void()&gt;&amp;&amp; destroyFunction = nullptr, GMainContext* = nullptr) override;
-    WTF_EXPORT_PRIVATE virtual void scheduleAfterDelay(const char* name, std::function&lt;bool()&gt;&amp;&amp;, std::chrono::seconds, int priority = G_PRIORITY_DEFAULT, std::function&lt;void()&gt;&amp;&amp; destroyFunction = nullptr, GMainContext* = nullptr) override;
-    WTF_EXPORT_PRIVATE virtual void cancel() override;
-
-private:
-    virtual void voidCallback() override;
-    virtual bool boolCallback() override;
-
-    virtual bool prepareVoidCallback(Context&amp;) override;
-    virtual void finishVoidCallback() override;
-    virtual bool prepareBoolCallback(Context&amp;) override;
-    virtual void finishBoolCallback(bool retval, Context&amp;) override;
-
-    GRecMutex m_mutex;
-    GRefPtr&lt;GCancellable&gt; m_cancellable;
-};
-
-} // namespace WTF
-
-using WTF::GThreadSafeMainLoopSource;
-
-#endif // USE(GLIB)
-
-#endif // GThreadSafeMainLoopSource_h
</del></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (192790 => 192791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-11-30 00:56:22 UTC (rev 192790)
+++ trunk/Tools/ChangeLog        2015-11-30 08:05:51 UTC (rev 192791)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-11-30  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GLIB] Remove GMainLoopSource and GThreadSafeMainLoopSource
+        https://bugs.webkit.org/show_bug.cgi?id=151633
+
+        Reviewed by Csaba Osztrogonác.
+
+        * TestWebKitAPI/PlatformGTK.cmake:
+        * TestWebKitAPI/Tests/WTF/glib/GMainLoopSource.cpp: Removed.
+
</ins><span class="cx"> 2015-11-27  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Remove the remaining uses of GMainLoopSource
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIPlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/PlatformGTK.cmake (192790 => 192791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/PlatformGTK.cmake        2015-11-30 00:56:22 UTC (rev 192790)
+++ trunk/Tools/TestWebKitAPI/PlatformGTK.cmake        2015-11-30 08:05:51 UTC (rev 192791)
</span><span class="lines">@@ -160,7 +160,6 @@
</span><span class="cx"> set_target_properties(TestWebCore PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore)
</span><span class="cx"> 
</span><span class="cx"> list(APPEND TestWTF_SOURCES
</span><del>-    ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/GMainLoopSource.cpp
</del><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/GUniquePtr.cpp
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/WorkQueueGLib.cpp
</span><span class="cx"> )
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWTFglibGMainLoopSourcecpp"></a>
<div class="delfile"><h4>Deleted: trunk/Tools/TestWebKitAPI/Tests/WTF/glib/GMainLoopSource.cpp (192790 => 192791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WTF/glib/GMainLoopSource.cpp        2015-11-30 00:56:22 UTC (rev 192790)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/glib/GMainLoopSource.cpp        2015-11-30 08:05:51 UTC (rev 192791)
</span><span class="lines">@@ -1,497 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 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 &quot;config.h&quot;
-
-#include &lt;wtf/glib/GThreadSafeMainLoopSource.h&gt;
-#include &lt;stdio.h&gt;
-
-namespace TestWebKitAPI {
-
-template &lt;typename T&gt;
-class GMainLoopSourceTest {
-public:
-    GMainLoopSourceTest()
-        : m_mainLoop(g_main_loop_new(nullptr, TRUE))
-    {
-    }
-
-    ~GMainLoopSourceTest()
-    {
-        g_main_loop_unref(m_mainLoop);
-    }
-
-    void runLoop()
-    {
-        g_main_loop_run(m_mainLoop);
-    }
-
-    void delayedFinish()
-    {
-        g_timeout_add(250,
-            [](gpointer data) {
-                GMainLoopSourceTest&amp; test = *static_cast&lt;GMainLoopSourceTest*&gt;(data);
-                test.finish();
-                return G_SOURCE_REMOVE;
-            }, this);
-    }
-
-    void finish()
-    {
-        g_main_loop_quit(m_mainLoop);
-    }
-
-    T&amp; source() { return m_source; }
-
-private:
-    GMainLoop* m_mainLoop;
-    T m_source;
-};
-
-template &lt;typename T&gt;
-static void basicRescheduling(T&amp; context)
-{
-    EXPECT_TRUE(!context.test.source().isActive());
-
-    context.test.source().schedule(&quot;[Test] FirstTask&quot;, [&amp;] {
-        // This should never be called. That's why we assert
-        // that the variable is false a few lines later.
-        context.finishedFirstTask = true;
-    });
-    EXPECT_TRUE(context.test.source().isScheduled());
-
-    context.test.source().schedule(&quot;[Test] SecondTask&quot;, [&amp;] {
-        EXPECT_TRUE(context.test.source().isActive() &amp;&amp; !context.test.source().isScheduled());
-        context.finishedSecondTask = true;
-        context.test.finish();
-    });
-    EXPECT_TRUE(context.test.source().isScheduled());
-
-    context.test.runLoop();
-
-    EXPECT_TRUE(!context.test.source().isActive());
-    EXPECT_FALSE(context.finishedFirstTask);
-    EXPECT_TRUE(context.finishedSecondTask);
-}
-
-TEST(WTF_GMainLoopSource, BasicRescheduling)
-{
-    struct TestingContext {
-        GMainLoopSourceTest&lt;GMainLoopSource&gt; test;
-        bool finishedFirstTask = false;
-        bool finishedSecondTask = false;
-    } context;
-    basicRescheduling&lt;TestingContext&gt;(context);
-
-    struct ThreadSafeTestingContext {
-        GMainLoopSourceTest&lt;GThreadSafeMainLoopSource&gt; test;
-        bool finishedFirstTask = false;
-        bool finishedSecondTask = false;
-    } threadSafeContext;
-    basicRescheduling&lt;ThreadSafeTestingContext&gt;(threadSafeContext);
-}
-
-template &lt;typename T&gt;
-static void reentrantRescheduling(T&amp; context)
-{
-    EXPECT_TRUE(!context.test.source().isActive());
-
-    context.test.source().schedule(&quot;[Test] FirstTask&quot;, [&amp;] {
-        EXPECT_TRUE(context.test.source().isActive() &amp;&amp; !context.test.source().isScheduled());
-
-        context.test.source().schedule(&quot;[Test] SecondTask&quot;, [&amp;] {
-            EXPECT_TRUE(context.test.source().isActive() &amp;&amp; !context.test.source().isScheduled());
-            EXPECT_TRUE(context.finishedFirstTask);
-
-            context.finishedSecondTask = true;
-            context.test.finish();
-        });
-        EXPECT_TRUE(context.test.source().isScheduled());
-
-        context.finishedFirstTask = true;
-    });
-    EXPECT_TRUE(context.test.source().isScheduled());
-
-    context.test.runLoop();
-
-    EXPECT_TRUE(!context.test.source().isActive());
-    EXPECT_TRUE(context.finishedFirstTask);
-    EXPECT_TRUE(context.finishedSecondTask);
-}
-
-TEST(WTF_GMainLoopSource, ReentrantRescheduling)
-{
-    struct TestingContext {
-        GMainLoopSourceTest&lt;GMainLoopSource&gt; test;
-        bool finishedFirstTask = false;
-        bool finishedSecondTask = false;
-    } context;
-    reentrantRescheduling&lt;TestingContext&gt;(context);
-
-    struct ThreadSafeTestingContext {
-        GMainLoopSourceTest&lt;GThreadSafeMainLoopSource&gt; test;
-        bool finishedFirstTask = false;
-        bool finishedSecondTask = false;
-    } threadSafeContext;
-    reentrantRescheduling&lt;ThreadSafeTestingContext&gt;(threadSafeContext);
-}
-
-TEST(WTF_GMainLoopSource, ReschedulingFromDifferentThread)
-{
-    struct TestingContext {
-        GMainLoopSourceTest&lt;GThreadSafeMainLoopSource&gt; test;
-        bool finishedFirstTask;
-        bool finishedSecondTask;
-    } context;
-
-    EXPECT_TRUE(!context.test.source().isActive());
-
-    context.test.source().schedule(&quot;[Test] FirstTask&quot;, [&amp;] {
-        EXPECT_TRUE(context.test.source().isActive() &amp;&amp; !context.test.source().isScheduled());
-
-        g_usleep(1 * G_USEC_PER_SEC);
-        context.finishedFirstTask = true;
-    });
-    EXPECT_TRUE(context.test.source().isScheduled());
-
-    GThread* helperThread = g_thread_new(nullptr, [](gpointer data) -&gt; gpointer {
-        g_usleep(0.25 * G_USEC_PER_SEC);
-
-        TestingContext&amp; context = *static_cast&lt;TestingContext*&gt;(data);
-        EXPECT_TRUE(context.test.source().isActive() &amp;&amp; !context.test.source().isScheduled());
-        EXPECT_FALSE(context.finishedFirstTask);
-
-        context.test.source().schedule(&quot;[Test] SecondTask&quot;, [&amp;] {
-            EXPECT_TRUE(context.finishedFirstTask);
-
-            context.finishedSecondTask = true;
-            context.test.finish();
-        });
-        EXPECT_TRUE(context.test.source().isScheduled());
-
-        g_thread_exit(nullptr);
-        return nullptr;
-    }, &amp;context);
-
-    context.test.runLoop();
-    g_thread_unref(helperThread);
-
-    EXPECT_TRUE(!context.test.source().isActive());
-    EXPECT_TRUE(context.finishedFirstTask);
-    EXPECT_TRUE(context.finishedSecondTask);
-}
-
-TEST(WTF_GMainLoopSource, DestructionDuringDispatch)
-{
-    // This is just a raw test that ensures deleting the GMainLoopSource object during
-    // dispatch does not cause problems. This test succeeds if it doesn't crash.
-
-    GMainLoopSource* source;
-    GMainLoop* loop = g_main_loop_new(nullptr, TRUE);
-
-    source = new GMainLoopSource;
-    source-&gt;schedule(&quot;[Test] DestroySourceTask&quot;, [&amp;] {
-        delete source;
-        g_main_loop_quit(loop);
-    });
-    g_main_loop_run(loop);
-
-    source = new GMainLoopSource;
-    source-&gt;schedule(&quot;[Test] DestroySourceTask&quot;, std::function&lt;bool ()&gt;([&amp;] {
-        delete source;
-        g_main_loop_quit(loop);
-        return false;
-    }));
-    g_main_loop_run(loop);
-
-    g_main_loop_unref(loop);
-}
-
-template &lt;typename T&gt;
-static void cancelRepeatingSourceDuringDispatch(T&amp; context)
-{
-    EXPECT_TRUE(!context.test.source().isActive());
-
-    context.test.source().schedule(&quot;[Test] RepeatingTask&quot;,
-        std::function&lt;bool ()&gt;([&amp;] {
-            EXPECT_TRUE(context.test.source().isActive() &amp;&amp; !context.test.source().isScheduled());
-
-            context.callCount++;
-            if (context.callCount == 3)
-                context.test.source().cancel();
-            return true;
-        }));
-    EXPECT_TRUE(context.test.source().isScheduled());
-
-    context.test.delayedFinish();
-    context.test.runLoop();
-
-    EXPECT_TRUE(!context.test.source().isActive());
-    EXPECT_EQ(3, context.callCount);
-}
-
-TEST(WTF_GMainLoopSource, CancelRepeatingSourceDuringDispatch)
-{
-    struct TestingContext {
-        GMainLoopSourceTest&lt;GMainLoopSource&gt; test;
-        unsigned callCount = 0;
-    } context;
-    cancelRepeatingSourceDuringDispatch&lt;TestingContext&gt;(context);
-
-    struct ThreadSafeTestingContext {
-        GMainLoopSourceTest&lt;GThreadSafeMainLoopSource&gt; test;
-        unsigned callCount = 0;
-    } threadSafeContext;
-    cancelRepeatingSourceDuringDispatch&lt;ThreadSafeTestingContext&gt;(threadSafeContext);
-}
-
-template &lt;typename T&gt;
-static void basicDestroyCallbacks()
-{
-    {
-        T context;
-        EXPECT_TRUE(!context.test.source().isActive());
-        context.test.source().schedule(&quot;[Test] DestroyCallback&quot;,
-            [&amp;] {
-                EXPECT_TRUE(context.test.source().isActive() &amp;&amp; !context.test.source().isScheduled());
-                context.callbackCalled = true;
-            }, G_PRIORITY_DEFAULT,
-            [&amp;] {
-                EXPECT_TRUE(!context.test.source().isActive());
-                context.destroyCallbackCalled = true;
-                context.test.finish();
-            });
-        EXPECT_TRUE(context.test.source().isScheduled());
-
-        context.test.runLoop();
-
-        EXPECT_TRUE(!context.test.source().isActive());
-        EXPECT_TRUE(context.callbackCalled);
-        EXPECT_TRUE(context.destroyCallbackCalled);
-    }
-
-    {
-        T context;
-        EXPECT_TRUE(!context.test.source().isActive());
-        context.test.source().schedule(&quot;[Test] DestroyCallback&quot;,
-            std::function&lt;bool ()&gt;([&amp;] {
-                EXPECT_TRUE(context.test.source().isActive() &amp;&amp; !context.test.source().isScheduled());
-                context.callbackCalled = true;
-                return false;
-            }), G_PRIORITY_DEFAULT,
-            [&amp;] {
-                EXPECT_TRUE(!context.test.source().isActive());
-                context.destroyCallbackCalled = true;
-                context.test.finish();
-            });
-        EXPECT_TRUE(context.test.source().isScheduled());
-
-        context.test.runLoop();
-
-        EXPECT_TRUE(!context.test.source().isActive());
-        EXPECT_TRUE(context.callbackCalled);
-        EXPECT_TRUE(context.destroyCallbackCalled);
-    }
-}
-
-TEST(WTF_GMainLoopSource, BasicDestroyCallbacks)
-{
-    struct TestingContext {
-        GMainLoopSourceTest&lt;GMainLoopSource&gt; test;
-        bool callbackCalled = false;
-        bool destroyCallbackCalled = false;
-    };
-    basicDestroyCallbacks&lt;TestingContext&gt;();
-
-    struct ThreadSafeTestingContext {
-        GMainLoopSourceTest&lt;GThreadSafeMainLoopSource&gt; test;
-        bool callbackCalled = false;
-        bool destroyCallbackCalled = false;
-    };
-    basicDestroyCallbacks&lt;ThreadSafeTestingContext&gt;();
-}
-
-template &lt;typename T&gt;
-static void destroyCallbacksAfterCancellingDuringDispatch()
-{
-    {
-        T context;
-        EXPECT_TRUE(!context.test.source().isActive());
-        context.test.source().schedule(&quot;[Test] DestroyCallback&quot;,
-            [&amp;] {
-                EXPECT_TRUE(context.test.source().isActive() &amp;&amp; !context.test.source().isScheduled());
-                context.callbackCallCount++;
-                context.test.source().cancel();
-            }, G_PRIORITY_DEFAULT,
-            [&amp;] {
-                EXPECT_TRUE(!context.test.source().isActive());
-                context.destroyCallbackCalled = true;
-                context.test.finish();
-            });
-        EXPECT_TRUE(context.test.source().isScheduled());
-
-        context.test.delayedFinish();
-        context.test.runLoop();
-
-        EXPECT_TRUE(!context.test.source().isActive());
-        EXPECT_EQ(1, context.callbackCallCount);
-        EXPECT_TRUE(context.destroyCallbackCalled);
-    }
-
-    {
-        T context;
-        EXPECT_TRUE(!context.test.source().isActive());
-        context.test.source().schedule(&quot;[Test] DestroyCallback&quot;,
-            std::function&lt;bool ()&gt;([&amp;] {
-                EXPECT_TRUE(context.test.source().isActive() &amp;&amp; !context.test.source().isScheduled());
-                context.callbackCallCount++;
-                if (context.callbackCallCount == 3)
-                    context.test.source().cancel();
-                return true;
-            }), G_PRIORITY_DEFAULT,
-            [&amp;] {
-                EXPECT_TRUE(!context.test.source().isActive());
-                context.destroyCallbackCalled = true;
-            });
-        EXPECT_TRUE(context.test.source().isScheduled());
-
-        context.test.delayedFinish();
-        context.test.runLoop();
-
-        EXPECT_TRUE(!context.test.source().isActive());
-        EXPECT_EQ(3, context.callbackCallCount);
-        EXPECT_TRUE(context.destroyCallbackCalled);
-    }
-}
-
-TEST(WTF_GMainLoopSource, DestroyCallbacksAfterCancellingDuringDispatch)
-{
-    struct TestingContext {
-        GMainLoopSourceTest&lt;GMainLoopSource&gt; test;
-        unsigned callbackCallCount= 0;
-        bool destroyCallbackCalled = false;
-    };
-    destroyCallbacksAfterCancellingDuringDispatch&lt;TestingContext&gt;();
-
-    struct ThreadSafeTestingContext {
-        GMainLoopSourceTest&lt;GThreadSafeMainLoopSource&gt; test;
-        unsigned callbackCallCount= 0;
-        bool destroyCallbackCalled = false;
-    };
-    destroyCallbacksAfterCancellingDuringDispatch&lt;ThreadSafeTestingContext&gt;();
-}
-
-template &lt;typename T&gt;
-static void destroyCallbacksAfterReschedulingDuringDispatch()
-{
-    {
-        T context;
-        EXPECT_TRUE(!context.test.source().isActive());
-        context.test.source().schedule(&quot;[Test] BaseCallback&quot;,
-            [&amp;] {
-                EXPECT_TRUE(context.test.source().isActive() &amp;&amp; !context.test.source().isScheduled());
-                context.firstCallbackCallCount++;
-                context.test.source().schedule(&quot;[Test] ReschedulingCallback&quot;,
-                    [&amp;] {
-                        EXPECT_TRUE(context.test.source().isActive() &amp;&amp; !context.test.source().isScheduled());
-                        context.secondCallbackCallCount++;
-                    }, G_PRIORITY_DEFAULT,
-                    [&amp;] {
-                        EXPECT_TRUE(!context.test.source().isActive());
-                        context.secondDestroyCallbackCalled = true;
-                    });
-                EXPECT_TRUE(context.test.source().isScheduled());
-            }, G_PRIORITY_DEFAULT,
-            [&amp;] {
-                // At this point the GMainLoopSource has been rescheduled, ergo the Scheduled status.
-                EXPECT_TRUE(context.test.source().isScheduled());
-                context.firstDestroyCallbackCalled = true;
-            });
-        EXPECT_TRUE(context.test.source().isScheduled());
-
-        context.test.delayedFinish();
-        context.test.runLoop();
-
-        EXPECT_TRUE(!context.test.source().isActive());
-        EXPECT_EQ(1, context.firstCallbackCallCount);
-        EXPECT_TRUE(context.firstDestroyCallbackCalled);
-        EXPECT_EQ(1, context.secondCallbackCallCount);
-        EXPECT_TRUE(context.secondDestroyCallbackCalled);
-    }
-
-    {
-        T context;
-        EXPECT_TRUE(!context.test.source().isActive());
-        context.test.source().schedule(&quot;[Test] BaseCallback&quot;,
-            std::function&lt;bool ()&gt;([&amp;] {
-                EXPECT_TRUE(context.test.source().isActive() &amp;&amp; !context.test.source().isScheduled());
-                context.firstCallbackCallCount++;
-                context.test.source().schedule(&quot;[Test] ReschedulingCallback&quot;,
-                    std::function&lt;bool ()&gt;([&amp;] {
-                        EXPECT_TRUE(context.test.source().isActive() &amp;&amp; !context.test.source().isScheduled());
-                        context.secondCallbackCallCount++;
-                        return context.secondCallbackCallCount != 3;
-                    }), G_PRIORITY_DEFAULT,
-                    [&amp;] {
-                        EXPECT_TRUE(!context.test.source().isActive());
-                        context.secondDestroyCallbackCalled = true;
-                    });
-                EXPECT_TRUE(context.test.source().isScheduled());
-                return true;
-            }), G_PRIORITY_DEFAULT,
-            [&amp;] {
-                // At this point the GMainLoopSource has been rescheduled, ergo the Scheduled status.
-                EXPECT_TRUE(context.test.source().isScheduled());
-                context.firstDestroyCallbackCalled = true;
-            });
-        EXPECT_TRUE(context.test.source().isScheduled());
-
-        context.test.delayedFinish();
-        context.test.runLoop();
-
-        EXPECT_TRUE(!context.test.source().isActive());
-        EXPECT_EQ(1, context.firstCallbackCallCount);
-        EXPECT_TRUE(context.firstDestroyCallbackCalled);
-        EXPECT_EQ(3, context.secondCallbackCallCount);
-        EXPECT_TRUE(context.secondDestroyCallbackCalled);
-    }
-}
-
-TEST(WTF_GMainLoopSource, DestroyCallbacksAfterReschedulingDuringDispatch)
-{
-    struct TestingContext {
-        GMainLoopSourceTest&lt;GMainLoopSource&gt; test;
-        unsigned firstCallbackCallCount = 0;
-        bool firstDestroyCallbackCalled = false;
-        unsigned secondCallbackCallCount = 0;
-        bool secondDestroyCallbackCalled = false;
-    };
-    destroyCallbacksAfterReschedulingDuringDispatch&lt;TestingContext&gt;();
-
-    struct ThreadSafeTestingContext {
-        GMainLoopSourceTest&lt;GThreadSafeMainLoopSource&gt; test;
-        unsigned firstCallbackCallCount = 0;
-        bool firstDestroyCallbackCalled = false;
-        unsigned secondCallbackCallCount = 0;
-        bool secondDestroyCallbackCalled = false;
-    };
-    destroyCallbacksAfterReschedulingDuringDispatch&lt;ThreadSafeTestingContext&gt;();
-}
-
-} // namespace TestWebKitAPI
</del></span></pre>
</div>
</div>

</body>
</html>