[WTF] Clean up RunLoop and WorkQueue with Seconds and Function
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Mar 2017 18:56:54 +0000 (18:56 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Mar 2017 18:56:54 +0000 (18:56 +0000)
commit2f316c79f7275550b39a3c0308a961d51fb53889
tree589b1363ff2fce02e41fea2bd32d269c6865974c
parent7614a7070d024bd24e6f862731a9a77d30555fa3
[WTF] Clean up RunLoop and WorkQueue with Seconds and Function
https://bugs.webkit.org/show_bug.cgi?id=169537

Reviewed by Sam Weinig.

Source/JavaScriptCore:

* runtime/Watchdog.cpp:
(JSC::Watchdog::startTimer):

Source/WebKit2:

* Shared/ChildProcess.cpp:
(WebKit::didCloseOnConnectionWorkQueue):
* UIProcess/Storage/LocalStorageDatabase.cpp:
* WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
(WebKit::AcceleratedSurfaceX11::resize):

Source/WTF:

This patch modernizes RunLoop and WorkQueue.

1. Use Ref<> aggressively
2. Use Seconds instead of chrono times
3. Use Function<> instead of std::function

* wtf/MainThread.cpp:
(WTF::dispatchFunctionsFromMainThread):
* wtf/RunLoop.h:
* wtf/WorkQueue.h:
* wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::WorkQueue::dispatch):
(WTF::WorkQueue::dispatchAfter):
(WTF::WorkQueue::concurrentApply):
* wtf/generic/MainThreadGeneric.cpp:
(WTF::scheduleDispatchFunctionsOnMainThread):
* wtf/generic/RunLoopGeneric.cpp:
(WTF::RunLoop::TimerBase::ScheduledTask::create):
(WTF::RunLoop::TimerBase::ScheduledTask::EarliestSchedule::operator()):
(WTF::RunLoop::populateTasks):
(WTF::RunLoop::runImpl):
(WTF::RunLoop::schedule):
(WTF::RunLoop::scheduleAndWakeUp):
(WTF::RunLoop::dispatchAfter):
(WTF::RunLoop::TimerBase::start):
* wtf/generic/WorkQueueGeneric.cpp:
(WorkQueue::dispatch):
(WorkQueue::dispatchAfter):
* wtf/glib/RunLoopGLib.cpp:
(WTF::DispatchAfterContext::DispatchAfterContext):
(WTF::RunLoop::dispatchAfter):
(WTF::RunLoop::TimerBase::updateReadyTime):
(WTF::RunLoop::TimerBase::start):
* wtf/win/WorkQueueWin.cpp:
(WTF::WorkQueue::performWorkOnRegisteredWorkThread):
(WTF::WorkQueue::dispatch):
(WTF::WorkQueue::dispatchAfter):

Tools:

* TestWebKitAPI/Tests/WTF/WorkQueue.cpp:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/Watchdog.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/MainThread.cpp
Source/WTF/wtf/RunLoop.h
Source/WTF/wtf/WorkQueue.h
Source/WTF/wtf/cocoa/WorkQueueCocoa.cpp
Source/WTF/wtf/generic/MainThreadGeneric.cpp
Source/WTF/wtf/generic/RunLoopGeneric.cpp
Source/WTF/wtf/generic/WorkQueueGeneric.cpp
Source/WTF/wtf/glib/RunLoopGLib.cpp
Source/WTF/wtf/win/WorkQueueWin.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/ChildProcess.cpp
Source/WebKit2/UIProcess/Storage/LocalStorageDatabase.cpp
Source/WebKit2/WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/WorkQueue.cpp