[GLIB] Add API to GMainLoopSource to schedule sources after a delay in microseconds
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Oct 2014 10:10:47 +0000 (10:10 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Oct 2014 10:10:47 +0000 (10:10 +0000)
commit4e1529edff6e83b4ae834b2126a2c77b58ff1407
tree1108a1b47f19a019182d16f42f3c870bb9b89a0f
parent40516d86f1d98020b083a0f2f5a365bfe9f6efb9
[GLIB] Add API to GMainLoopSource to schedule sources after a delay in microseconds
https://bugs.webkit.org/show_bug.cgi?id=137782

Reviewed by Sergio Villar Senin.

Source/WebCore:

* platform/gtk/SharedTimerGtk.cpp:
(WebCore::setSharedTimerFireInterval): Use microseconds instead of
milliseconds.

Source/WebKit2:

* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
(WebKit::LayerTreeHostGtk::layerFlushTimerFired): Use microseconds
instead of milliseconds.

Source/WTF:

In some cases when we have a double with the time in seconds, the
conversion to milliseconds ends up truncating the value to 0, and
the source scheduled immediately.

* wtf/gobject/GMainLoopSource.cpp:
(WTF::createMicrosecondsTimeoutSource): Use a custom timeout
source that handles the interval in microseconds instead of milliseconds.
(WTF::GMainLoopSource::scheduleAfterDelay): Use MicrosecondsTimeoutSource.
(WTF::GMainLoopSource::scheduleAfterDelayAndDeleteOnDestroy): Ditto.
* wtf/gobject/GMainLoopSource.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/gobject/GMainLoopSource.cpp
Source/WTF/wtf/gobject/GMainLoopSource.h
Source/WebCore/ChangeLog
Source/WebCore/platform/gtk/SharedTimerGtk.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp