Title: [158103] trunk
Revision
158103
Author
[email protected]
Date
2013-10-28 02:29:14 -0700 (Mon, 28 Oct 2013)

Log Message

Replace 0 timeouts g_timeout_add() by g_idle_add()
https://bugs.webkit.org/show_bug.cgi?id=123260

Patch by Bastien Nocera <[email protected]> on 2013-10-28
Reviewed by Carlos Garcia Campos.

A zero timeout should be equivalent to using g_idle_add_full(G_PRIORITY_DEFAULT, ...)
without the nagging feeling that the wrong API was used.

Source/WebCore:

No new tests, no change in functionality.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Use g_idle_add() instead
of 0-timer.
(WebCore::MediaPlayerPrivateGStreamer::videoChanged):
(WebCore::MediaPlayerPrivateGStreamer::audioChanged):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: Ditto.
(WebCore::MediaPlayerPrivateGStreamerBase::volumeChanged):
(WebCore::MediaPlayerPrivateGStreamerBase::muteChanged):
* platform/gtk/GtkDragAndDropHelper.cpp: Ditto.
(WebCore::GtkDragAndDropHelper::handleDragLeave):

Source/WebKit/gtk:

* WebCoreSupport/ChromeClientGtk.cpp: Use g_idle_add() instead
of 0-timer.
(WebKit::ChromeClient::closeWindowSoon):
(WebKit::ChromeClient::widgetSizeChanged):
* WebCoreSupport/GtkAdjustmentWatcher.cpp: Ditto.
(WebKit::GtkAdjustmentWatcher::updateAdjustmentsFromScrollbarsLater):
* webkit/webkitwebview.cpp: Ditto.
(webkit_web_view_get_subresources):

Source/WTF:

* wtf/gtk/MainThreadGtk.cpp: Use g_idle_add() instead
of 0-timer.
(WTF::scheduleDispatchFunctionsOnMainThread):

Tools:

* DumpRenderTree/gtk/DumpRenderTree.cpp: Use g_idle_add() instead
of 0-timer.
(topLoadingFrameLoadFinished):
* DumpRenderTree/gtk/EventSender.cpp: Ditto.
(scheduleAsynchronousClickCallback):
(scheduleAsynchronousKeyDownCallback):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (158102 => 158103)


--- trunk/Source/WTF/ChangeLog	2013-10-28 07:29:21 UTC (rev 158102)
+++ trunk/Source/WTF/ChangeLog	2013-10-28 09:29:14 UTC (rev 158103)
@@ -1,3 +1,17 @@
+2013-10-28  Bastien Nocera <[email protected]>
+
+        Replace 0 timeouts g_timeout_add() by g_idle_add()
+        https://bugs.webkit.org/show_bug.cgi?id=123260
+
+        Reviewed by Carlos Garcia Campos.
+
+        A zero timeout should be equivalent to using g_idle_add_full(G_PRIORITY_DEFAULT, ...)
+        without the nagging feeling that the wrong API was used.
+
+        * wtf/gtk/MainThreadGtk.cpp: Use g_idle_add() instead
+        of 0-timer.
+        (WTF::scheduleDispatchFunctionsOnMainThread):
+
 2013-10-28  Zan Dobersek  <[email protected]>
 
         Re-enable simple line layout for GTK

Modified: trunk/Source/WTF/wtf/gtk/MainThreadGtk.cpp (158102 => 158103)


--- trunk/Source/WTF/wtf/gtk/MainThreadGtk.cpp	2013-10-28 07:29:21 UTC (rev 158102)
+++ trunk/Source/WTF/wtf/gtk/MainThreadGtk.cpp	2013-10-28 09:29:14 UTC (rev 158103)
@@ -46,7 +46,7 @@
 
 void scheduleDispatchFunctionsOnMainThread()
 {
-    g_timeout_add(0, timeoutFired, 0);
+    g_idle_add_full(G_PRIORITY_DEFAULT, timeoutFired, 0, 0);
 }
 
 } // namespace WTF

Modified: trunk/Source/WebCore/ChangeLog (158102 => 158103)


--- trunk/Source/WebCore/ChangeLog	2013-10-28 07:29:21 UTC (rev 158102)
+++ trunk/Source/WebCore/ChangeLog	2013-10-28 09:29:14 UTC (rev 158103)
@@ -1,3 +1,25 @@
+2013-10-28  Bastien Nocera <[email protected]>
+
+        Replace 0 timeouts g_timeout_add() by g_idle_add()
+        https://bugs.webkit.org/show_bug.cgi?id=123260
+
+        Reviewed by Carlos Garcia Campos.
+
+        A zero timeout should be equivalent to using g_idle_add_full(G_PRIORITY_DEFAULT, ...)
+        without the nagging feeling that the wrong API was used.
+
+        No new tests, no change in functionality.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Use g_idle_add() instead
+        of 0-timer.
+        (WebCore::MediaPlayerPrivateGStreamer::videoChanged):
+        (WebCore::MediaPlayerPrivateGStreamer::audioChanged):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: Ditto.
+        (WebCore::MediaPlayerPrivateGStreamerBase::volumeChanged):
+        (WebCore::MediaPlayerPrivateGStreamerBase::muteChanged):
+        * platform/gtk/GtkDragAndDropHelper.cpp: Ditto.
+        (WebCore::GtkDragAndDropHelper::handleDragLeave):
+
 2013-10-28  Zan Dobersek  <[email protected]>
 
         Re-enable simple line layout for GTK

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (158102 => 158103)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2013-10-28 07:29:21 UTC (rev 158102)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2013-10-28 09:29:14 UTC (rev 158103)
@@ -627,7 +627,7 @@
 {
     if (m_videoTimerHandler)
         g_source_remove(m_videoTimerHandler);
-    m_videoTimerHandler = g_timeout_add(0, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateVideoChangeTimeoutCallback), this);
+    m_videoTimerHandler = g_idle_add_full(G_PRIORITY_DEFAULT, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateVideoChangeTimeoutCallback), this, 0);
 }
 
 void MediaPlayerPrivateGStreamer::notifyPlayerOfVideo()
@@ -649,7 +649,7 @@
 {
     if (m_audioTimerHandler)
         g_source_remove(m_audioTimerHandler);
-    m_audioTimerHandler = g_timeout_add(0, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateAudioChangeTimeoutCallback), this);
+    m_audioTimerHandler = g_idle_add_full(G_PRIORITY_DEFAULT, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateAudioChangeTimeoutCallback), this, 0);
 }
 
 void MediaPlayerPrivateGStreamer::notifyPlayerOfAudio()

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (158102 => 158103)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2013-10-28 07:29:21 UTC (rev 158102)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2013-10-28 09:29:14 UTC (rev 158103)
@@ -266,7 +266,7 @@
 {
     if (m_volumeTimerHandler)
         g_source_remove(m_volumeTimerHandler);
-    m_volumeTimerHandler = g_timeout_add(0, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateVolumeChangeTimeoutCallback), this);
+    m_volumeTimerHandler = g_idle_add_full(G_PRIORITY_DEFAULT, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateVolumeChangeTimeoutCallback), this, 0);
 }
 
 MediaPlayer::NetworkState MediaPlayerPrivateGStreamerBase::networkState() const
@@ -318,7 +318,7 @@
 {
     if (m_muteTimerHandler)
         g_source_remove(m_muteTimerHandler);
-    m_muteTimerHandler = g_timeout_add(0, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateMuteChangeTimeoutCallback), this);
+    m_muteTimerHandler = g_idle_add_full(G_PRIORITY_DEFAULT, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateMuteChangeTimeoutCallback), this, 0);
 }
 
 

Modified: trunk/Source/WebCore/platform/gtk/GtkDragAndDropHelper.cpp (158102 => 158103)


--- trunk/Source/WebCore/platform/gtk/GtkDragAndDropHelper.cpp	2013-10-28 07:29:21 UTC (rev 158102)
+++ trunk/Source/WebCore/platform/gtk/GtkDragAndDropHelper.cpp	2013-10-28 09:29:14 UTC (rev 158103)
@@ -113,7 +113,7 @@
     data->context = context;
     data->context->exitedCallback = exitedCallback;
     data->glue = this;
-    g_timeout_add(0, reinterpret_cast<GSourceFunc>(handleDragLeaveLaterCallback), data);
+    g_idle_add_full(G_PRIORITY_DEFAULT, reinterpret_cast<GSourceFunc>(handleDragLeaveLaterCallback), data, 0);
 }
 
 static void queryNewDropContextData(DroppingContext* dropContext, GtkWidget* widget, guint time)

Modified: trunk/Source/WebKit/gtk/ChangeLog (158102 => 158103)


--- trunk/Source/WebKit/gtk/ChangeLog	2013-10-28 07:29:21 UTC (rev 158102)
+++ trunk/Source/WebKit/gtk/ChangeLog	2013-10-28 09:29:14 UTC (rev 158103)
@@ -1,3 +1,22 @@
+2013-10-28  Bastien Nocera <[email protected]>
+
+        Replace 0 timeouts g_timeout_add() by g_idle_add()
+        https://bugs.webkit.org/show_bug.cgi?id=123260
+
+        Reviewed by Carlos Garcia Campos.
+
+        A zero timeout should be equivalent to using g_idle_add_full(G_PRIORITY_DEFAULT, ...)
+        without the nagging feeling that the wrong API was used.
+
+        * WebCoreSupport/ChromeClientGtk.cpp: Use g_idle_add() instead
+        of 0-timer.
+        (WebKit::ChromeClient::closeWindowSoon):
+        (WebKit::ChromeClient::widgetSizeChanged):
+        * WebCoreSupport/GtkAdjustmentWatcher.cpp: Ditto.
+        (WebKit::GtkAdjustmentWatcher::updateAdjustmentsFromScrollbarsLater):
+        * webkit/webkitwebview.cpp: Ditto.
+        (webkit_web_view_get_subresources):
+
 2013-10-21  Zan Dobersek  <[email protected]>
 
         [GTK] g-ir-scanner should use the configured C compiler

Modified: trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp (158102 => 158103)


--- trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp	2013-10-28 07:29:21 UTC (rev 158102)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp	2013-10-28 09:29:14 UTC (rev 158103)
@@ -335,7 +335,7 @@
     // onload handler, it will need to call FrameLoaderClient::dispatchDidHandleOnloadEvents.
     // Instead of firing the close-web-view signal now, fire it after the caller finishes.
     // This seems to match the Mac/Windows port behavior.
-    m_closeSoonTimer = g_timeout_add(0, reinterpret_cast<GSourceFunc>(emitCloseWebViewSignalLater), m_webView);
+    m_closeSoonTimer = g_idle_add_full(G_PRIORITY_DEFAULT, reinterpret_cast<GSourceFunc>(emitCloseWebViewSignalLater), m_webView, 0);
 }
 
 bool ChromeClient::canTakeFocus(FocusDirection)
@@ -519,7 +519,7 @@
     // WebCore timers by default have a lower priority which leads to more artifacts when opaque
     // resize is on, thus we use g_timeout_add here to force a higher timeout priority.
     if (!m_repaintSoonSourceId)
-        m_repaintSoonSourceId = g_timeout_add(0, reinterpret_cast<GSourceFunc>(repaintEverythingSoonTimeout), this);
+        m_repaintSoonSourceId = g_idle_add_full(G_PRIORITY_DEFAULT, reinterpret_cast<GSourceFunc>(repaintEverythingSoonTimeout), this, 0);
 }
 
 static void coalesceRectsIfPossible(const IntRect& clipRect, Vector<IntRect>& rects)

Modified: trunk/Source/WebKit/gtk/WebCoreSupport/GtkAdjustmentWatcher.cpp (158102 => 158103)


--- trunk/Source/WebKit/gtk/WebCoreSupport/GtkAdjustmentWatcher.cpp	2013-10-28 07:29:21 UTC (rev 158102)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/GtkAdjustmentWatcher.cpp	2013-10-28 09:29:14 UTC (rev 158103)
@@ -90,8 +90,8 @@
     // The fact that this method was called means that we need to update the scrollbars, but at the
     // time of invocation they are not updated to reflect the scroll yet. We set a short timeout
     // here, which means that they will be updated as soon as WebKit returns to the main loop.
-    m_updateAdjustmentCallbackId = g_timeout_add(0, reinterpret_cast<GSourceFunc>(updateAdjustmentCallback),
-                                                 const_cast<void*>(static_cast<const void*>(this)));
+    m_updateAdjustmentCallbackId = g_idle_add_full(G_PRIORITY_DEFAULT, reinterpret_cast<GSourceFunc>(updateAdjustmentCallback),
+        const_cast<void*>(static_cast<const void*>(this)), 0);
 }
 
 static void adjustmentValueChangedCallback(GtkAdjustment* adjustment, GtkAdjustmentWatcher* watcher)

Modified: trunk/Tools/ChangeLog (158102 => 158103)


--- trunk/Tools/ChangeLog	2013-10-28 07:29:21 UTC (rev 158102)
+++ trunk/Tools/ChangeLog	2013-10-28 09:29:14 UTC (rev 158103)
@@ -1,3 +1,20 @@
+2013-10-28  Bastien Nocera <[email protected]>
+
+        Replace 0 timeouts g_timeout_add() by g_idle_add()
+        https://bugs.webkit.org/show_bug.cgi?id=123260
+
+        Reviewed by Carlos Garcia Campos.
+
+        A zero timeout should be equivalent to using g_idle_add_full(G_PRIORITY_DEFAULT, ...)
+        without the nagging feeling that the wrong API was used.
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp: Use g_idle_add() instead
+        of 0-timer.
+        (topLoadingFrameLoadFinished):
+        * DumpRenderTree/gtk/EventSender.cpp: Ditto.
+        (scheduleAsynchronousClickCallback):
+        (scheduleAsynchronousKeyDownCallback):
+
 2013-10-25  Anton Obzhirov  <[email protected]>
 
         [GTK] [WebKit2] CanHandleRequest API test fails

Modified: trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp (158102 => 158103)


--- trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp	2013-10-28 07:29:21 UTC (rev 158102)
+++ trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp	2013-10-28 09:29:14 UTC (rev 158103)
@@ -1121,7 +1121,7 @@
         return;
 
     if (WorkQueue::shared()->count())
-        g_timeout_add(0, processWork, 0);
+        g_idle_add_full(G_PRIORITY_DEFAULT, processWork, 0, 0);
     else
         dump();
 }

Modified: trunk/Tools/DumpRenderTree/gtk/EventSender.cpp (158102 => 158103)


--- trunk/Tools/DumpRenderTree/gtk/EventSender.cpp	2013-10-28 07:29:21 UTC (rev 158102)
+++ trunk/Tools/DumpRenderTree/gtk/EventSender.cpp	2013-10-28 09:29:14 UTC (rev 158103)
@@ -255,7 +255,7 @@
 
 static JSValueRef scheduleAsynchronousClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
-    g_timeout_add(0, sendClick, 0);
+    g_idle_add_full(G_PRIORITY_DEFAULT, sendClick, 0, 0);
     return JSValueMakeUndefined(context);
 }
 
@@ -906,7 +906,7 @@
 {
     GdkEvent* pressEvent = createKeyPressEvent(context, argumentCount, arguments, exception);
     if (pressEvent)
-        g_timeout_add(0, sendAsynchronousKeyDown, static_cast<gpointer>(pressEvent));
+        g_idle_add_full(G_PRIORITY_DEFAULT, sendAsynchronousKeyDown, static_cast<gpointer>(pressEvent), 0);
 
     return JSValueMakeUndefined(context);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to