[GTK] Use a persistent main loop source in RunLoop glib implementation
https://bugs.webkit.org/show_bug.cgi?id=150590
Reviewed by Žan Doberšek.
Source/WebKit2:
Use RunLoop::dispatch() instead of
GMainLoopSource::scheduleAndDeleteOnDestroy in a couple of simple
cases.
* NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
(WebKit::NetworkCache::runTaskInQueue):
* UIProcess/gtk/DragAndDropHandler.cpp:
(WebKit::DragAndDropHandler::dragLeave):
Source/WTF:
It's more efficient than creating and destroying a new source for
every dispatch and it simplifies the code.
* wtf/RunLoop.h:
* wtf/glib/MainThreadGLib.cpp:
(WTF::scheduleDispatchFunctionsOnMainThread): Use
RunLoop::dispatch() instead of GMainLoopSource::scheduleAndDeleteOnDestroy().
* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::RunLoop): Create and setup the persistent source.
(WTF::RunLoop::~RunLoop): Destroy the persistent source.
(WTF::RunLoop::stop): Stop the persistent source before stopping
the main loop.
(WTF::RunLoop::wakeUp): Make the persistent source active. We
no longer need to explicitly wakeup the context.
(WTF::RunLoop::TimerBase::TimerBase): Create and setup the
persistent source.
(WTF::RunLoop::TimerBase::~TimerBase): Destroy the persistent source.
(WTF::RunLoop::TimerBase::updateReadyTime): Set the ready time
according to the fire interval.
(WTF::RunLoop::TimerBase::start): Make the persistent source active.
(WTF::RunLoop::TimerBase::stop): Stop the persistent source.
(WTF::RunLoop::TimerBase::isActive): Return whether the
persistent source is active.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191786
268f45cc-cd09-0410-ab3c-
d52691b4dbfc