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

<h3>Log Message</h3>
<pre>[GTK] Use RunLoop::Timer instead of GMainLoopSource
https://bugs.webkit.org/show_bug.cgi?id=150592

Reviewed by Žan Doberšek.

Source/WebCore:

* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::cleanupSoupRequestOperation):
(WebCore::ResourceHandle::timeoutFired):
(WebCore::ResourceHandle::sendPendingRequest):
(WebCore::ResourceHandle::platformSetDefersLoading):

Source/WebKit2:

* Shared/Downloads/soup/DownloadSoup.cpp:
(WebKit::DownloadClient::DownloadClient):
(WebKit::DownloadClient::didReceiveData):
(WebKit::DownloadClient::handleResponseLater):
* UIProcess/gtk/GestureController.cpp:
(WebKit::GestureController::DragGesture::begin):
(WebKit::GestureController::DragGesture::update):
(WebKit::GestureController::DragGesture::end):
(WebKit::GestureController::DragGesture::longPressFired):
(WebKit::GestureController::DragGesture::DragGesture):
(WebKit::GestureController::ZoomGesture::scaleChanged):
(WebKit::GestureController::ZoomGesture::ZoomGesture):
* UIProcess/gtk/GestureController.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceHandleh">trunk/Source/WebCore/platform/network/ResourceHandle.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceHandleInternalh">trunk/Source/WebCore/platform/network/ResourceHandleInternal.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworksoupResourceHandleSoupcpp">trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedDownloadssoupDownloadSoupcpp">trunk/Source/WebKit2/Shared/Downloads/soup/DownloadSoup.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessgtkGestureControllercpp">trunk/Source/WebKit2/UIProcess/gtk/GestureController.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessgtkGestureControllerh">trunk/Source/WebKit2/UIProcess/gtk/GestureController.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191786 => 191787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-30 11:28:14 UTC (rev 191786)
+++ trunk/Source/WebCore/ChangeLog        2015-10-30 12:12:09 UTC (rev 191787)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-10-30  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Use RunLoop::Timer instead of GMainLoopSource
+        https://bugs.webkit.org/show_bug.cgi?id=150592
+
+        Reviewed by Žan Doberšek.
+
+        * platform/network/ResourceHandle.h:
+        * platform/network/ResourceHandleInternal.h:
+        (WebCore::ResourceHandleInternal::ResourceHandleInternal):
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::cleanupSoupRequestOperation):
+        (WebCore::ResourceHandle::timeoutFired):
+        (WebCore::ResourceHandle::sendPendingRequest):
+        (WebCore::ResourceHandle::platformSetDefersLoading):
+
</ins><span class="cx"> 2015-10-30  Hunseop Jeong  &lt;hs85.jeong@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r191776): EFL build broken.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceHandleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceHandle.h (191786 => 191787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceHandle.h        2015-10-30 11:28:14 UTC (rev 191786)
+++ trunk/Source/WebCore/platform/network/ResourceHandle.h        2015-10-30 12:12:09 UTC (rev 191787)
</span><span class="lines">@@ -289,6 +289,10 @@
</span><span class="cx"> static void getConnectionTimingData(NSDictionary *timingData, ResourceLoadTiming&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(SOUP)
+    void timeoutFired();
+#endif
+
</ins><span class="cx">     friend class ResourceHandleInternal;
</span><span class="cx">     std::unique_ptr&lt;ResourceHandleInternal&gt; d;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceHandleInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceHandleInternal.h (191786 => 191787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceHandleInternal.h        2015-10-30 11:28:14 UTC (rev 191786)
+++ trunk/Source/WebCore/platform/network/ResourceHandleInternal.h        2015-10-30 12:12:09 UTC (rev 191787)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> #if USE(SOUP)
</span><span class="cx"> #include &quot;GUniquePtrSoup.h&quot;
</span><span class="cx"> #include &lt;libsoup/soup.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/GRefPtr.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -91,6 +91,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> #if USE(SOUP)
</span><span class="cx">             , m_cancelled(false)
</span><ins>+            , m_timeoutSource(RunLoop::main(), loader, &amp;ResourceHandle::timeoutFired)
</ins><span class="cx">             , m_bodySize(0)
</span><span class="cx">             , m_bodyDataSent(0)
</span><span class="cx">             , m_redirectCount(0)
</span><span class="lines">@@ -169,7 +170,7 @@
</span><span class="cx">         GRefPtr&lt;SoupMultipartInputStream&gt; m_multipartInputStream;
</span><span class="cx">         GRefPtr&lt;GCancellable&gt; m_cancellable;
</span><span class="cx">         GRefPtr&lt;GAsyncResult&gt; m_deferredResult;
</span><del>-        GMainLoopSource m_timeoutSource;
</del><ins>+        RunLoop::Timer&lt;ResourceHandle&gt; m_timeoutSource;
</ins><span class="cx">         GUniquePtr&lt;SoupBuffer&gt; m_soupBuffer;
</span><span class="cx">         unsigned long m_bodySize;
</span><span class="cx">         unsigned long m_bodyDataSent;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworksoupResourceHandleSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp (191786 => 191787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp        2015-10-30 11:28:14 UTC (rev 191786)
+++ trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp        2015-10-30 12:12:09 UTC (rev 191787)
</span><span class="lines">@@ -601,7 +601,7 @@
</span><span class="cx">         d-&gt;m_soupMessage.clear();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    d-&gt;m_timeoutSource.cancel();
</del><ins>+    d-&gt;m_timeoutSource.stop();
</ins><span class="cx"> 
</span><span class="cx">     if (!isDestroying)
</span><span class="cx">         handle-&gt;deref();
</span><span class="lines">@@ -1049,19 +1049,20 @@
</span><span class="cx">     return newHandle;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ResourceHandle::timeoutFired()
+{
+    client()-&gt;didFail(this, ResourceError::timeoutError(firstRequest().url().string()));
+    cancel();
+}
+
</ins><span class="cx"> void ResourceHandle::sendPendingRequest()
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(WEB_TIMING)
</span><span class="cx">     m_requestTime = monotonicallyIncreasingTime();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (d-&gt;m_firstRequest.timeoutInterval() &gt; 0) {
-        d-&gt;m_timeoutSource.scheduleAfterDelay(&quot;[WebKit] ResourceHandle request timeout&quot;, [this] {
-            client()-&gt;didFail(this, ResourceError::timeoutError(firstRequest().url().string()));
-            cancel();
-        }, std::chrono::duration_cast&lt;std::chrono::microseconds&gt;(std::chrono::duration&lt;double&gt;(d-&gt;m_firstRequest.timeoutInterval())),
-        G_PRIORITY_DEFAULT, nullptr, g_main_context_get_thread_default());
-    }
</del><ins>+    if (d-&gt;m_firstRequest.timeoutInterval() &gt; 0)
+        d-&gt;m_timeoutSource.startOneShot(d-&gt;m_firstRequest.timeoutInterval());
</ins><span class="cx"> 
</span><span class="cx">     // Balanced by a deref() in cleanupSoupRequestOperation, which should always run.
</span><span class="cx">     ref();
</span><span class="lines">@@ -1265,7 +1266,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Except when canceling a possible timeout timer, we only need to take action here to UN-defer loading.
</span><span class="cx">     if (defersLoading) {
</span><del>-        d-&gt;m_timeoutSource.cancel();
</del><ins>+        d-&gt;m_timeoutSource.stop();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (191786 => 191787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-10-30 11:28:14 UTC (rev 191786)
+++ trunk/Source/WebKit2/ChangeLog        2015-10-30 12:12:09 UTC (rev 191787)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2015-10-30  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Use RunLoop::Timer instead of GMainLoopSource
+        https://bugs.webkit.org/show_bug.cgi?id=150592
+
+        Reviewed by Žan Doberšek.
+
+        * Shared/Downloads/soup/DownloadSoup.cpp:
+        (WebKit::DownloadClient::DownloadClient):
+        (WebKit::DownloadClient::didReceiveData):
+        (WebKit::DownloadClient::handleResponseLater):
+        * UIProcess/gtk/GestureController.cpp:
+        (WebKit::GestureController::DragGesture::begin):
+        (WebKit::GestureController::DragGesture::update):
+        (WebKit::GestureController::DragGesture::end):
+        (WebKit::GestureController::DragGesture::longPressFired):
+        (WebKit::GestureController::DragGesture::DragGesture):
+        (WebKit::GestureController::ZoomGesture::scaleChanged):
+        (WebKit::GestureController::ZoomGesture::ZoomGesture):
+        * UIProcess/gtk/GestureController.h:
+
</ins><span class="cx"> 2015-10-29  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Use a persistent main loop source in RunLoop glib implementation
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedDownloadssoupDownloadSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/Downloads/soup/DownloadSoup.cpp (191786 => 191787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Downloads/soup/DownloadSoup.cpp        2015-10-30 11:28:14 UTC (rev 191786)
+++ trunk/Source/WebKit2/Shared/Downloads/soup/DownloadSoup.cpp        2015-10-30 12:12:09 UTC (rev 191787)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> #include &lt;WebCore/NotImplemented.h&gt;
</span><span class="cx"> #include &lt;WebCore/ResourceHandleInternal.h&gt;
</span><span class="cx"> #include &lt;gio/gio.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/GRefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/glib/GUniquePtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx"> public:
</span><span class="cx">     DownloadClient(Download* download)
</span><span class="cx">         : m_download(download)
</span><ins>+        , m_handleResponseLater(RunLoop::main(), this, &amp;DownloadClient::handleResponse)
</ins><span class="cx">         , m_allowOverwrite(false)
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="lines">@@ -131,8 +132,8 @@
</span><span class="cx"> 
</span><span class="cx">     void didReceiveData(ResourceHandle*, const char* data, unsigned length, int /*encodedDataLength*/)
</span><span class="cx">     {
</span><del>-        if (m_handleResponseLater.isScheduled()) {
-            m_handleResponseLater.cancel();
</del><ins>+        if (m_handleResponseLater.isActive()) {
+            m_handleResponseLater.stop();
</ins><span class="cx">             handleResponse();
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -197,13 +198,13 @@
</span><span class="cx">     void handleResponseLater(const ResourceResponse&amp; response)
</span><span class="cx">     {
</span><span class="cx">         ASSERT(m_response.isNull());
</span><del>-        ASSERT(!m_handleResponseLater.isScheduled());
</del><ins>+        ASSERT(!m_handleResponseLater.isActive());
</ins><span class="cx"> 
</span><span class="cx">         m_delayedResponse = response;
</span><span class="cx"> 
</span><span class="cx">         // Call didReceiveResponse in an idle to make sure the download is added
</span><span class="cx">         // to the DownloadManager downloads map.
</span><del>-        m_handleResponseLater.schedule(&quot;[WebKit] DownloadHandleResponseLater&quot;, std::function&lt;void()&gt;(std::bind(&amp;DownloadClient::handleResponse, this)));
</del><ins>+        m_handleResponseLater.startOneShot(0);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Download* m_download;
</span><span class="lines">@@ -212,7 +213,7 @@
</span><span class="cx">     GRefPtr&lt;GFile&gt; m_destinationFile;
</span><span class="cx">     GRefPtr&lt;GFile&gt; m_intermediateFile;
</span><span class="cx">     ResourceResponse m_delayedResponse;
</span><del>-    GMainLoopSource m_handleResponseLater;
</del><ins>+    RunLoop::Timer&lt;DownloadClient&gt; m_handleResponseLater;
</ins><span class="cx">     bool m_allowOverwrite;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessgtkGestureControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/gtk/GestureController.cpp (191786 => 191787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/gtk/GestureController.cpp        2015-10-30 11:28:14 UTC (rev 191786)
+++ trunk/Source/WebKit2/UIProcess/gtk/GestureController.cpp        2015-10-30 12:12:09 UTC (rev 191787)
</span><span class="lines">@@ -127,9 +127,7 @@
</span><span class="cx">     GtkWidget* widget = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture));
</span><span class="cx">     unsigned delay;
</span><span class="cx">     g_object_get(gtk_widget_get_settings(widget), &quot;gtk-long-press-time&quot;, &amp;delay, nullptr);
</span><del>-    dragGesture-&gt;m_longPressTimeout.scheduleAfterDelay(&quot;[WebKit] DragGesture long press timeout&quot;, [dragGesture]() {
-        dragGesture-&gt;m_inDrag = true;
-    }, std::chrono::milliseconds(delay));
</del><ins>+    dragGesture-&gt;m_longPressTimeout.startOneShot(delay / 1000.0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GestureController::DragGesture::update(DragGesture* dragGesture, double x, double y, GtkGesture* gesture)
</span><span class="lines">@@ -140,7 +138,7 @@
</span><span class="cx">     GtkWidget* widget = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture));
</span><span class="cx">     if (!dragGesture-&gt;m_inDrag &amp;&amp; gtk_drag_check_threshold(widget, dragGesture-&gt;m_start.x(), dragGesture-&gt;m_start.y(), dragGesture-&gt;m_start.x() + x, dragGesture-&gt;m_start.y() + y)) {
</span><span class="cx">         dragGesture-&gt;m_inDrag = true;
</span><del>-        dragGesture-&gt;m_longPressTimeout.cancel();
</del><ins>+        dragGesture-&gt;m_longPressTimeout.stop();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (dragGesture-&gt;m_inDrag)
</span><span class="lines">@@ -150,7 +148,7 @@
</span><span class="cx"> 
</span><span class="cx"> void GestureController::DragGesture::end(DragGesture* dragGesture, GdkEventSequence* sequence, GtkGesture* gesture)
</span><span class="cx"> {
</span><del>-    dragGesture-&gt;m_longPressTimeout.cancel();
</del><ins>+    dragGesture-&gt;m_longPressTimeout.stop();
</ins><span class="cx">     if (!dragGesture-&gt;m_inDrag) {
</span><span class="cx">         dragGesture-&gt;handleTap(gtk_gesture_get_last_event(gesture, sequence));
</span><span class="cx">         gtk_gesture_set_state(gesture, GTK_EVENT_SEQUENCE_DENIED);
</span><span class="lines">@@ -158,8 +156,14 @@
</span><span class="cx">         gtk_gesture_set_state(gesture, GTK_EVENT_SEQUENCE_DENIED);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void GestureController::DragGesture::longPressFired()
+{
+    m_inDrag = true;
+}
+
</ins><span class="cx"> GestureController::DragGesture::DragGesture(WebPageProxy&amp; page)
</span><span class="cx">     : Gesture(gtk_gesture_drag_new(page.viewWidget()), page)
</span><ins>+    , m_longPressTimeout(RunLoop::main(), this, &amp;GestureController::DragGesture::longPressFired)
</ins><span class="cx">     , m_inDrag(false)
</span><span class="cx"> {
</span><span class="cx">     gtk_gesture_single_set_touch_only(GTK_GESTURE_SINGLE(m_gesture.get()), TRUE);
</span><span class="lines">@@ -199,16 +203,17 @@
</span><span class="cx"> {
</span><span class="cx">     zoomGesture-&gt;m_scale = zoomGesture-&gt;m_initialScale * scale;
</span><span class="cx">     zoomGesture-&gt;m_viewPoint = zoomGesture-&gt;center();
</span><del>-    if (zoomGesture-&gt;m_idle.isScheduled())
</del><ins>+    if (zoomGesture-&gt;m_idle.isActive())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    zoomGesture-&gt;m_idle.schedule(&quot;[WebKit] Zoom Gesture Idle&quot;, std::bind(&amp;GestureController::ZoomGesture::handleZoom, zoomGesture));
</del><ins>+    zoomGesture-&gt;m_idle.startOneShot(0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> GestureController::ZoomGesture::ZoomGesture(WebPageProxy&amp; page)
</span><span class="cx">     : Gesture(gtk_gesture_zoom_new(page.viewWidget()), page)
</span><span class="cx">     , m_initialScale(0)
</span><span class="cx">     , m_scale(0)
</span><ins>+    , m_idle(RunLoop::main(), this, &amp;GestureController::ZoomGesture::handleZoom)
</ins><span class="cx"> {
</span><span class="cx">     g_signal_connect_swapped(m_gesture.get(), &quot;begin&quot;, G_CALLBACK(begin), this);
</span><span class="cx">     g_signal_connect_swapped(m_gesture.get(), &quot;scale-changed&quot;, G_CALLBACK(scaleChanged), this);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessgtkGestureControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/gtk/GestureController.h (191786 => 191787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/gtk/GestureController.h        2015-10-30 11:28:14 UTC (rev 191786)
+++ trunk/Source/WebKit2/UIProcess/gtk/GestureController.h        2015-10-30 12:12:09 UTC (rev 191787)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;WebCore/FloatPoint.h&gt;
</span><span class="cx"> #include &lt;wtf/Noncopyable.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/GRefPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> typedef union _GdkEvent GdkEvent;
</span><span class="lines">@@ -69,6 +69,7 @@
</span><span class="cx">     private:
</span><span class="cx">         void handleDrag(const GdkEvent*, double x, double y);
</span><span class="cx">         void handleTap(const GdkEvent*);
</span><ins>+        void longPressFired();
</ins><span class="cx"> 
</span><span class="cx">         static void begin(DragGesture*, double x, double y, GtkGesture*);
</span><span class="cx">         static void update(DragGesture*, double x, double y, GtkGesture*);
</span><span class="lines">@@ -76,7 +77,7 @@
</span><span class="cx"> 
</span><span class="cx">         WebCore::FloatPoint m_start;
</span><span class="cx">         WebCore::FloatPoint m_offset;
</span><del>-        GMainLoopSource m_longPressTimeout;
</del><ins>+        RunLoop::Timer&lt;DragGesture&gt; m_longPressTimeout;
</ins><span class="cx">         GRefPtr&lt;GtkGesture&gt; m_longPress;
</span><span class="cx">         bool m_inDrag;
</span><span class="cx">     };
</span><span class="lines">@@ -96,7 +97,7 @@
</span><span class="cx">         gdouble m_scale;
</span><span class="cx">         WebCore::IntPoint m_initialPoint;
</span><span class="cx">         WebCore::IntPoint m_viewPoint;
</span><del>-        GMainLoopSource m_idle;
</del><ins>+        RunLoop::Timer&lt;ZoomGesture&gt; m_idle;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     DragGesture m_dragGesture;
</span></span></pre>
</div>
</div>

</body>
</html>