Changeset 158103 in webkit


Ignore:
Timestamp:
Oct 28, 2013 2:29:14 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Bastien Nocera <hadess@hadess.net> 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):

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r158102 r158103  
     12013-10-28  Bastien Nocera <hadess@hadess.net>
     2
     3        Replace 0 timeouts g_timeout_add() by g_idle_add()
     4        https://bugs.webkit.org/show_bug.cgi?id=123260
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        A zero timeout should be equivalent to using g_idle_add_full(G_PRIORITY_DEFAULT, ...)
     9        without the nagging feeling that the wrong API was used.
     10
     11        * wtf/gtk/MainThreadGtk.cpp: Use g_idle_add() instead
     12        of 0-timer.
     13        (WTF::scheduleDispatchFunctionsOnMainThread):
     14
    1152013-10-28  Zan Dobersek  <zdobersek@igalia.com>
    216
  • trunk/Source/WTF/wtf/gtk/MainThreadGtk.cpp

    r111778 r158103  
    4747void scheduleDispatchFunctionsOnMainThread()
    4848{
    49     g_timeout_add(0, timeoutFired, 0);
     49    g_idle_add_full(G_PRIORITY_DEFAULT, timeoutFired, 0, 0);
    5050}
    5151
  • trunk/Source/WebCore/ChangeLog

    r158102 r158103  
     12013-10-28  Bastien Nocera <hadess@hadess.net>
     2
     3        Replace 0 timeouts g_timeout_add() by g_idle_add()
     4        https://bugs.webkit.org/show_bug.cgi?id=123260
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        A zero timeout should be equivalent to using g_idle_add_full(G_PRIORITY_DEFAULT, ...)
     9        without the nagging feeling that the wrong API was used.
     10
     11        No new tests, no change in functionality.
     12
     13        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Use g_idle_add() instead
     14        of 0-timer.
     15        (WebCore::MediaPlayerPrivateGStreamer::videoChanged):
     16        (WebCore::MediaPlayerPrivateGStreamer::audioChanged):
     17        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: Ditto.
     18        (WebCore::MediaPlayerPrivateGStreamerBase::volumeChanged):
     19        (WebCore::MediaPlayerPrivateGStreamerBase::muteChanged):
     20        * platform/gtk/GtkDragAndDropHelper.cpp: Ditto.
     21        (WebCore::GtkDragAndDropHelper::handleDragLeave):
     22
    1232013-10-28  Zan Dobersek  <zdobersek@igalia.com>
    224
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

    r157834 r158103  
    628628    if (m_videoTimerHandler)
    629629        g_source_remove(m_videoTimerHandler);
    630     m_videoTimerHandler = g_timeout_add(0, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateVideoChangeTimeoutCallback), this);
     630    m_videoTimerHandler = g_idle_add_full(G_PRIORITY_DEFAULT, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateVideoChangeTimeoutCallback), this, 0);
    631631}
    632632
     
    650650    if (m_audioTimerHandler)
    651651        g_source_remove(m_audioTimerHandler);
    652     m_audioTimerHandler = g_timeout_add(0, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateAudioChangeTimeoutCallback), this);
     652    m_audioTimerHandler = g_idle_add_full(G_PRIORITY_DEFAULT, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateAudioChangeTimeoutCallback), this, 0);
    653653}
    654654
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp

    r157624 r158103  
    267267    if (m_volumeTimerHandler)
    268268        g_source_remove(m_volumeTimerHandler);
    269     m_volumeTimerHandler = g_timeout_add(0, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateVolumeChangeTimeoutCallback), this);
     269    m_volumeTimerHandler = g_idle_add_full(G_PRIORITY_DEFAULT, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateVolumeChangeTimeoutCallback), this, 0);
    270270}
    271271
     
    319319    if (m_muteTimerHandler)
    320320        g_source_remove(m_muteTimerHandler);
    321     m_muteTimerHandler = g_timeout_add(0, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateMuteChangeTimeoutCallback), this);
     321    m_muteTimerHandler = g_idle_add_full(G_PRIORITY_DEFAULT, reinterpret_cast<GSourceFunc>(mediaPlayerPrivateMuteChangeTimeoutCallback), this, 0);
    322322}
    323323
  • trunk/Source/WebCore/platform/gtk/GtkDragAndDropHelper.cpp

    r157058 r158103  
    114114    data->context->exitedCallback = exitedCallback;
    115115    data->glue = this;
    116     g_timeout_add(0, reinterpret_cast<GSourceFunc>(handleDragLeaveLaterCallback), data);
     116    g_idle_add_full(G_PRIORITY_DEFAULT, reinterpret_cast<GSourceFunc>(handleDragLeaveLaterCallback), data, 0);
    117117}
    118118
  • trunk/Source/WebKit/gtk/ChangeLog

    r157711 r158103  
     12013-10-28  Bastien Nocera <hadess@hadess.net>
     2
     3        Replace 0 timeouts g_timeout_add() by g_idle_add()
     4        https://bugs.webkit.org/show_bug.cgi?id=123260
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        A zero timeout should be equivalent to using g_idle_add_full(G_PRIORITY_DEFAULT, ...)
     9        without the nagging feeling that the wrong API was used.
     10
     11        * WebCoreSupport/ChromeClientGtk.cpp: Use g_idle_add() instead
     12        of 0-timer.
     13        (WebKit::ChromeClient::closeWindowSoon):
     14        (WebKit::ChromeClient::widgetSizeChanged):
     15        * WebCoreSupport/GtkAdjustmentWatcher.cpp: Ditto.
     16        (WebKit::GtkAdjustmentWatcher::updateAdjustmentsFromScrollbarsLater):
     17        * webkit/webkitwebview.cpp: Ditto.
     18        (webkit_web_view_get_subresources):
     19
    1202013-10-21  Zan Dobersek  <zdobersek@igalia.com>
    221
  • trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp

    r157534 r158103  
    336336    // Instead of firing the close-web-view signal now, fire it after the caller finishes.
    337337    // This seems to match the Mac/Windows port behavior.
    338     m_closeSoonTimer = g_timeout_add(0, reinterpret_cast<GSourceFunc>(emitCloseWebViewSignalLater), m_webView);
     338    m_closeSoonTimer = g_idle_add_full(G_PRIORITY_DEFAULT, reinterpret_cast<GSourceFunc>(emitCloseWebViewSignalLater), m_webView, 0);
    339339}
    340340
     
    520520    // resize is on, thus we use g_timeout_add here to force a higher timeout priority.
    521521    if (!m_repaintSoonSourceId)
    522         m_repaintSoonSourceId = g_timeout_add(0, reinterpret_cast<GSourceFunc>(repaintEverythingSoonTimeout), this);
     522        m_repaintSoonSourceId = g_idle_add_full(G_PRIORITY_DEFAULT, reinterpret_cast<GSourceFunc>(repaintEverythingSoonTimeout), this, 0);
    523523}
    524524
  • trunk/Source/WebKit/gtk/WebCoreSupport/GtkAdjustmentWatcher.cpp

    r156543 r158103  
    9191    // time of invocation they are not updated to reflect the scroll yet. We set a short timeout
    9292    // here, which means that they will be updated as soon as WebKit returns to the main loop.
    93     m_updateAdjustmentCallbackId = g_timeout_add(0, reinterpret_cast<GSourceFunc>(updateAdjustmentCallback),
    94                                                  const_cast<void*>(static_cast<const void*>(this)));
     93    m_updateAdjustmentCallbackId = g_idle_add_full(G_PRIORITY_DEFAULT, reinterpret_cast<GSourceFunc>(updateAdjustmentCallback),
     94        const_cast<void*>(static_cast<const void*>(this)), 0);
    9595}
    9696
  • trunk/Tools/ChangeLog

    r158002 r158103  
     12013-10-28  Bastien Nocera <hadess@hadess.net>
     2
     3        Replace 0 timeouts g_timeout_add() by g_idle_add()
     4        https://bugs.webkit.org/show_bug.cgi?id=123260
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        A zero timeout should be equivalent to using g_idle_add_full(G_PRIORITY_DEFAULT, ...)
     9        without the nagging feeling that the wrong API was used.
     10
     11        * DumpRenderTree/gtk/DumpRenderTree.cpp: Use g_idle_add() instead
     12        of 0-timer.
     13        (topLoadingFrameLoadFinished):
     14        * DumpRenderTree/gtk/EventSender.cpp: Ditto.
     15        (scheduleAsynchronousClickCallback):
     16        (scheduleAsynchronousKeyDownCallback):
     17
    1182013-10-25  Anton Obzhirov  <a.obzhirov@samsung.com>
    219
  • trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp

    r156683 r158103  
    11221122
    11231123    if (WorkQueue::shared()->count())
    1124         g_timeout_add(0, processWork, 0);
     1124        g_idle_add_full(G_PRIORITY_DEFAULT, processWork, 0, 0);
    11251125    else
    11261126        dump();
  • trunk/Tools/DumpRenderTree/gtk/EventSender.cpp

    r152718 r158103  
    256256static JSValueRef scheduleAsynchronousClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
    257257{
    258     g_timeout_add(0, sendClick, 0);
     258    g_idle_add_full(G_PRIORITY_DEFAULT, sendClick, 0, 0);
    259259    return JSValueMakeUndefined(context);
    260260}
     
    907907    GdkEvent* pressEvent = createKeyPressEvent(context, argumentCount, arguments, exception);
    908908    if (pressEvent)
    909         g_timeout_add(0, sendAsynchronousKeyDown, static_cast<gpointer>(pressEvent));
     909        g_idle_add_full(G_PRIORITY_DEFAULT, sendAsynchronousKeyDown, static_cast<gpointer>(pressEvent), 0);
    910910
    911911    return JSValueMakeUndefined(context);
Note: See TracChangeset for help on using the changeset viewer.