[GTK] Use RunLoop::Timer in main thread shared timer GTK+ implementation
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Nov 2015 07:54:38 +0000 (07:54 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Nov 2015 07:54:38 +0000 (07:54 +0000)
commit730cdd66dbf17c0987e7d49e7e0881fd741f019f
treee5f23ca0edaf208fad2158d778ef74b14c0f80b0
parentd56d4220428dd6ea44ba20335d430fcdf7739a0d
[GTK] Use RunLoop::Timer in main thread shared timer GTK+ implementation
https://bugs.webkit.org/show_bug.cgi?id=150754

Reviewed by Darin Adler.

Source/WebCore:

It's more efficient because it uses a persistent source and it
simplifies the code even more.

* platform/MainThreadSharedTimer.cpp:
(WebCore::MainThreadSharedTimer::fired): Make it non-const to be
able to use it as function callback of a RunLoop::Timer.
* platform/MainThreadSharedTimer.h:
* platform/gtk/MainThreadSharedTimerGtk.cpp:
(WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
Initialize the RunLoop::Timer and set the prioriry.
(WebCore::MainThreadSharedTimer::setFireInterval):
(WebCore::MainThreadSharedTimer::stop):

Source/WTF:

Add API to set the priority of a RunLoop::Timer for GLib.

* wtf/RunLoop.h:
* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::TimerBase::setPriority):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191852 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/RunLoop.h
Source/WTF/wtf/glib/RunLoopGLib.cpp
Source/WebCore/ChangeLog
Source/WebCore/platform/MainThreadSharedTimer.cpp
Source/WebCore/platform/MainThreadSharedTimer.h
Source/WebCore/platform/gtk/MainThreadSharedTimerGtk.cpp