Timer scheduling should be based off the monotonic clock
https://bugs.webkit.org/show_bug.cgi?id=64544
Patch by James Robinson <[email protected]> on 2011-07-18
Reviewed by Darin Adler.
Source/JavaScriptCore:
Switches ThreadCondition::timedWait and related utility functions from currentTime() to
monotonicallyIncreasingTime().
Add WTF::monotonicallyIncreasingTime() to list of exported functions so it can be accessed from WebCore/WebKit.
(WTF::ThreadCondition::timedWait):
(WTF::absoluteTimeToWaitTimeoutInterval):
- wtf/gtk/ThreadingGtk.cpp:
(WTF::ThreadCondition::timedWait):
(WTF::ThreadCondition::timedWait):
Source/WebCore:
Changes the Timer scheduling logic from using absolute values in terms of currentTime() to using relative
intervals in terms of monotonicallyIncreasingTime(). This provides better standards compliance, compatibility,
and predictability when the system clock is adjusted.
No automated tests since there is no way to modify the system clock from DRT.
(WebCore::MainThreadSharedTimer::setFireInterval):
- platform/ThreadTimers.cpp:
(WebCore::ThreadTimers::updateSharedTimer):
(WebCore::ThreadTimers::sharedTimerFiredInternal):
(WebCore::TimerBase::start):
(WebCore::TimerBase::nextFireInterval):
- platform/android/SharedTimerAndroid.cpp:
(WebCore::setSharedTimerFireInterval):
- platform/brew/SharedTimerBrew.cpp:
(WebCore::setSharedTimerFireInterval):
- platform/chromium/PlatformBridge.h:
- platform/chromium/SharedTimerChromium.cpp:
(WebCore::setSharedTimerFireInterval):
- platform/efl/SharedTimerEfl.cpp:
(WebCore::addNewTimer):
(WebCore::setSharedTimerFireInterval):
- platform/gtk/SharedTimerGtk.cpp:
(WebCore::setSharedTimerFireInterval):
- platform/haiku/SharedTimerHaiku.cpp:
(WebCore::SharedTimerHaiku::start):
(WebCore::setSharedTimerFireInterval):
- platform/mac/SharedTimerMac.mm:
(WebCore::setSharedTimerFireInterval):
- platform/qt/SharedTimerQt.cpp:
(WebCore::SharedTimerQt::start):
(WebCore::setSharedTimerFireInterval):
- platform/win/SharedTimerWin.cpp:
(WebCore::setSharedTimerFireInterval):
- platform/wince/SharedTimerWinCE.cpp:
(WebCore::setSharedTimerFireInterval):
- platform/wx/SharedTimerWx.cpp:
(WebCore::setSharedTimerFireInterval):
- workers/WorkerRunLoop.cpp:
(WebCore::WorkerSharedTimer::setFireInterval):
Source/WebKit/chromium:
Renames setSharedTimerFireTime to setSharedTimerFireInterval to be consistent with WebCore.
(WebKit::WebKitClient::setSharedTimerFireInterval):
(WebCore::PlatformBridge::setSharedTimerFireInterval):
Source/WebKit2:
Converts the WebKit2 RunLoop and CoreIPC timeouts to use monotonicallyIncreasingTime().
- Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::waitForMessage):
(CoreIPC::Connection::waitForSyncReply):