Drop Timer::startOneShot() overload taking a double
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Apr 2017 08:02:21 +0000 (08:02 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Apr 2017 08:02:21 +0000 (08:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=170659

Reviewed by Yusuke Suzuki.

Drop Timer::startOneShot() overload taking a double as people should use Seconds type now.

Source/WebCore:

* Modules/geolocation/GeoNotifier.cpp:
(WebCore::GeoNotifier::startTimerIfNeeded):
* Modules/mediasession/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::configureWatchdogTimer):
* Modules/mediasession/WebMediaSessionManager.h:
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged):
* Modules/vibration/Vibration.cpp:
(WebCore::Vibration::timerFired):
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::close):
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::enqueuePasswordValueChangeNotification):
(WebCore::AXObjectCache::postLiveRegionChangeNotification):
(WebCore::AXObjectCache::focusAriaModalNode):
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::setStatus):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::addToMatchedPropertiesCache):
* dom/Document.cpp:
(WebCore::Document::setVisualUpdatesAllowed):
(WebCore::Document::finishedParsing):
* dom/ScriptedAnimationController.cpp:
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::startAlternativeTextUITimer):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::addBehaviorRestrictionsOnEndIfNecessary):
(WebCore::HTMLMediaElement::handleSeekToPlaybackPosition):
* html/SearchInputType.cpp:
(WebCore::SearchInputType::startSearchEventTimer):
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::setMessageDOMAndStartTimer):
* html/canvas/WebGLRenderingContextBase.cpp:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::startTimer):
(WebCore::MediaControlPanelElement::makeTransparent):
* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::startTimer):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::frameScheduledNavigationImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::frameScheduledNavigation):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::frameScheduledNavigation):
* inspector/InspectorPageAgent.h:
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::startTimer):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::documentDidFinishLoadEvent):
* loader/icon/IconDatabase.cpp:
* page/EventHandler.cpp:
* page/EventSource.cpp:
(WebCore::EventSource::scheduleReconnect):
* page/FocusController.cpp:
(WebCore::FocusController::setFocusedElementNeedsRepaint):
* page/FrameView.cpp:
(WebCore::FrameView::scrollPositionChanged):
(WebCore::FrameView::enableSpeculativeTilingIfNeeded):
* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
(WebCore::Settings::setTimeWithoutMouseMovementBeforeHidingControls):
(WebCore::Settings::timeWithoutMouseMovementBeforeHidingControls):
* page/SuspendableTimer.h:
* page/animation/CSSAnimationController.cpp:
* page/mac/EventHandlerMac.mm:
* page/mac/TextIndicatorWindow.mm:
(WebCore::TextIndicatorWindow::setTextIndicator):
* platform/HysteresisActivity.h:
(WebCore::HysteresisActivity::stop):
* platform/ScrollAnimationSmooth.cpp:
(WebCore::getAnimationParametersForGranularity):
(WebCore::ScrollAnimationSmooth::updatePerAxisData):
(WebCore::ScrollAnimationSmooth::animateScroll):
(WebCore::ScrollAnimationSmooth::animationTimerFired):
(WebCore::ScrollAnimationSmooth::startNextTimer):
* platform/ScrollAnimationSmooth.h:
* platform/Timer.h:
(WebCore::TimerBase::startRepeating):
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::scheduleClientDataBufferingCheck):
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::scheduleStatelessScrollSnap):
* platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
(WebCore::GameControllerGamepadProvider::gamepadHadInput):
* platform/gamepad/mac/HIDGamepadProvider.cpp:
(WebCore::HIDGamepadProvider::openAndScheduleManager):
(WebCore::HIDGamepadProvider::valuesChanged):
* platform/glib/MainThreadSharedTimerGLib.cpp:
(WebCore::MainThreadSharedTimer::setFireInterval):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::startTimer):
(WebCore::BitmapImage::internalStartAnimation):
(WebCore::BitmapImage::advanceAnimation):
(WebCore::BitmapImage::resetAnimation):
* platform/graphics/BitmapImage.h:
* platform/graphics/MediaPlaybackTargetPicker.cpp:
* platform/graphics/ShadowBlur.cpp:
(WebCore::ScratchBuffer::scheduleScratchBufferPurge):
* platform/graphics/ca/LayerPool.cpp:
(WebCore::LayerPool::schedulePrune):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3DManager::updateHighPerformanceState):
* platform/graphics/texmap/BitmapTexturePool.cpp:
(WebCore::BitmapTexturePool::scheduleReleaseUnusedTextures):
(WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::scheduleReleaseUnusedBuffers):
(WebCore::TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired):
* platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
* platform/gtk/ScrollAnimatorGtk.cpp:
(WebCore::ScrollAnimatorGtk::overlayScrollbarAnimationTimerFired):
(WebCore::ScrollAnimatorGtk::showOverlayScrollbars):
(WebCore::ScrollAnimatorGtk::hideOverlayScrollbars):
* platform/gtk/ScrollAnimatorGtk.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::startScrollbarPaintTimer):
* platform/mock/MediaPlaybackTargetPickerMock.cpp:
* platform/mock/PlatformSpeechSynthesizerMock.cpp:
(WebCore::PlatformSpeechSynthesizerMock::speak):
* platform/mock/TimerEventBasedMock.h:
(WebCore::TimerEvent::TimerEvent):
* platform/network/DNSResolveQueue.cpp:
(WebCore::DNSResolveQueue::add):
(WebCore::DNSResolveQueue::timerFired):
* platform/network/PingHandle.h:
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::ResourceHandleManager::downloadTimerCallback):
(WebCore::ResourceHandleManager::add):
(WebCore::ResourceHandleManager::cancel):
* platform/network/mac/NetworkStateNotifierMac.cpp:
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::sendPendingRequest):
* rendering/ImageQualityController.cpp:
(WebCore::ImageQualityController::restartTimer):
* rendering/RenderLayerCompositor.cpp:
* rendering/RenderProgress.cpp:
(WebCore::RenderProgress::RenderProgress):
* rendering/RenderProgress.h:
* rendering/RenderText.cpp:
(WebCore::SecureTextTimer::restart):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::animationRepeatIntervalForProgressBar):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::mediaControlsFadeOutDuration):
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::animationRepeatIntervalForProgressBar):
* rendering/RenderThemeGtk.h:
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::animationRepeatIntervalForProgressBar):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::animationRepeatIntervalForProgressBar):
(WebCore::RenderThemeMac::animationDurationForProgressBar):
* replay/EventLoopInputDispatcher.cpp:
(WebCore::EventLoopInputDispatcher::dispatchInputSoon):
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::startTimer):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls):
* testing/InternalSettings.h:
* testing/Internals.cpp:
(WebCore::Internals::setImageFrameDecodingDuration):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):

Source/WebKit:

* Storage/StorageAreaSync.cpp:
* Storage/StorageTracker.cpp:
(WebKit::StorageTracker::StorageTracker):
* Storage/StorageTracker.h:
(WebKit::StorageTracker::storageDatabaseIdleInterval):
(WebKit::StorageTracker::setStorageDatabaseIdleInterval):

Source/WebKit/mac:

* Plugins/WebNetscapePluginView.mm:
(PluginTimer::start):
* Storage/WebStorageManager.mm:
(+[WebStorageManager setStorageDatabaseIdleInterval:]):

Source/WebKit/win:

* Plugins/PluginMessageThrottlerWin.cpp:
(WebCore::PluginMessageThrottlerWin::appendMessage):
(WebCore::PluginMessageThrottlerWin::messageThrottleTimerFired):
* Plugins/PluginViewWin.cpp:
(WebCore::PluginView::invalidateRect):
* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::scheduleLayerFlush):

Source/WebKit2:

* NetworkProcess/PingLoad.h:
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::startTimeout):
* Platform/IPC/Connection.h:
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog):
(IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
(IPC::Connection::terminateSoon):
* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::setMinimumLifetime):
* PluginProcess/PluginProcess.h:
* Shared/ChildProcess.cpp:
(WebKit::ChildProcess::ChildProcess):
* Shared/ChildProcess.h:
(WebKit::ChildProcess::setTerminationTimeout):
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::CompositingRunLoop::startUpdateTimer):
* Shared/Plugins/PluginProcessCreationParameters.h:
* Shared/WebMemorySampler.cpp:
(WebKit::WebMemorySampler::initializeTimers):
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
(API::SharedJSContext::ensureContext):
* UIProcess/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::shutDownProcess):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::didChangeIsLoading):
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon):
(WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
(WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw):
* UIProcess/Gamepad/UIGamepadProvider.cpp:
* UIProcess/Plugins/PluginProcessProxy.cpp:
* UIProcess/ProcessThrottler.cpp:
* UIProcess/ResponsivenessTimer.cpp:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
* UIProcess/gtk/GestureController.cpp:
(WebKit::GestureController::DragGesture::begin):
* UIProcess/mac/WebInspectorProxyMac.mm:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::determinePrimarySnapshottedPlugIn):
* WebProcess/WebProcess.cpp:

Tools:

* TestWebKitAPI/Tests/WTF/RunLoop.cpp:
(TestWebKitAPI::TEST):
* WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp:
(WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215173 268f45cc-cd09-0410-ab3c-d52691b4dbfc

130 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/geolocation/GeoNotifier.cpp
Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp
Source/WebCore/Modules/mediasession/WebMediaSessionManager.h
Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp
Source/WebCore/Modules/vibration/Vibration.cpp
Source/WebCore/Modules/websockets/WebSocketChannel.cpp
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/css/CSSFontFace.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/ScriptedAnimationController.cpp
Source/WebCore/editing/AlternativeTextController.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/SearchInputType.cpp
Source/WebCore/html/ValidationMessage.cpp
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/track/VTTRegion.cpp
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/inspector/InspectorPageAgent.h
Source/WebCore/loader/NavigationScheduler.cpp
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/loader/icon/IconDatabase.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/EventSource.cpp
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/page/SuspendableTimer.h
Source/WebCore/page/animation/CSSAnimationController.cpp
Source/WebCore/page/mac/EventHandlerMac.mm
Source/WebCore/page/mac/TextIndicatorWindow.mm
Source/WebCore/platform/HysteresisActivity.h
Source/WebCore/platform/ScrollAnimationSmooth.cpp
Source/WebCore/platform/ScrollAnimationSmooth.h
Source/WebCore/platform/Timer.h
Source/WebCore/platform/audio/PlatformMediaSession.cpp
Source/WebCore/platform/cocoa/ScrollController.mm
Source/WebCore/platform/gamepad/cocoa/GameControllerGamepadProvider.mm
Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.cpp
Source/WebCore/platform/glib/MainThreadSharedTimerGLib.cpp
Source/WebCore/platform/graphics/BitmapImage.cpp
Source/WebCore/platform/graphics/BitmapImage.h
Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.cpp
Source/WebCore/platform/graphics/ShadowBlur.cpp
Source/WebCore/platform/graphics/ca/LayerPool.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
Source/WebCore/platform/graphics/texmap/BitmapTexturePool.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp
Source/WebCore/platform/gtk/ScrollAnimatorGtk.cpp
Source/WebCore/platform/gtk/ScrollAnimatorGtk.h
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.cpp
Source/WebCore/platform/mock/PlatformSpeechSynthesizerMock.cpp
Source/WebCore/platform/mock/TimerEventBasedMock.h
Source/WebCore/platform/network/DNSResolveQueue.cpp
Source/WebCore/platform/network/PingHandle.h
Source/WebCore/platform/network/curl/ResourceHandleManager.cpp
Source/WebCore/platform/network/mac/NetworkStateNotifierMac.cpp
Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
Source/WebCore/rendering/ImageQualityController.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderProgress.cpp
Source/WebCore/rendering/RenderProgress.h
Source/WebCore/rendering/RenderText.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/rendering/RenderThemeGtk.cpp
Source/WebCore/rendering/RenderThemeGtk.h
Source/WebCore/rendering/RenderThemeIOS.h
Source/WebCore/rendering/RenderThemeIOS.mm
Source/WebCore/rendering/RenderThemeMac.h
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/replay/EventLoopInputDispatcher.cpp
Source/WebCore/svg/animation/SMILTimeContainer.cpp
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebKit/ChangeLog
Source/WebKit/Storage/StorageAreaSync.cpp
Source/WebKit/Storage/StorageTracker.cpp
Source/WebKit/Storage/StorageTracker.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Plugins/WebNetscapePluginView.mm
Source/WebKit/mac/Storage/WebStorageManager.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/Plugins/PluginMessageThrottlerWin.cpp
Source/WebKit/win/Plugins/PluginViewWin.cpp
Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/PingLoad.h
Source/WebKit2/NetworkProcess/soup/NetworkDataTaskSoup.cpp
Source/WebKit2/Platform/IPC/Connection.h
Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm
Source/WebKit2/PluginProcess/PluginProcess.cpp
Source/WebKit2/PluginProcess/PluginProcess.h
Source/WebKit2/Shared/ChildProcess.cpp
Source/WebKit2/Shared/ChildProcess.h
Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp
Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.h
Source/WebKit2/Shared/WebMemorySampler.cpp
Source/WebKit2/Shared/WebProcessCreationParameters.h
Source/WebKit2/UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm
Source/WebKit2/UIProcess/ChildProcessProxy.cpp
Source/WebKit2/UIProcess/Cocoa/NavigationState.mm
Source/WebKit2/UIProcess/Cocoa/ViewGestureController.cpp
Source/WebKit2/UIProcess/Cocoa/ViewGestureController.h
Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
Source/WebKit2/UIProcess/Gamepad/UIGamepadProvider.cpp
Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp
Source/WebKit2/UIProcess/ProcessThrottler.cpp
Source/WebKit2/UIProcess/ResponsivenessTimer.cpp
Source/WebKit2/UIProcess/WebProcessPool.cpp
Source/WebKit2/UIProcess/gtk/GestureController.cpp
Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm
Source/WebKit2/WebProcess/WebPage/AcceleratedDrawingArea.cpp
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebProcess.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/RunLoop.cpp
Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp

index 06ef0af..1951cce 100644 (file)
@@ -1,3 +1,183 @@
+2017-04-10  Chris Dumez  <cdumez@apple.com>
+
+        Drop Timer::startOneShot() overload taking a double
+        https://bugs.webkit.org/show_bug.cgi?id=170659
+
+        Reviewed by Yusuke Suzuki.
+
+        Drop Timer::startOneShot() overload taking a double as people should use Seconds type now.
+
+        * Modules/geolocation/GeoNotifier.cpp:
+        (WebCore::GeoNotifier::startTimerIfNeeded):
+        * Modules/mediasession/WebMediaSessionManager.cpp:
+        (WebCore::WebMediaSessionManager::configureWatchdogTimer):
+        * Modules/mediasession/WebMediaSessionManager.h:
+        * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
+        (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged):
+        * Modules/vibration/Vibration.cpp:
+        (WebCore::Vibration::timerFired):
+        * Modules/websockets/WebSocketChannel.cpp:
+        (WebCore::WebSocketChannel::close):
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::enqueuePasswordValueChangeNotification):
+        (WebCore::AXObjectCache::postLiveRegionChangeNotification):
+        (WebCore::AXObjectCache::focusAriaModalNode):
+        * css/CSSFontFace.cpp:
+        (WebCore::CSSFontFace::setStatus):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::addToMatchedPropertiesCache):
+        * dom/Document.cpp:
+        (WebCore::Document::setVisualUpdatesAllowed):
+        (WebCore::Document::finishedParsing):
+        * dom/ScriptedAnimationController.cpp:
+        * editing/AlternativeTextController.cpp:
+        (WebCore::AlternativeTextController::startAlternativeTextUITimer):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::addBehaviorRestrictionsOnEndIfNecessary):
+        (WebCore::HTMLMediaElement::handleSeekToPlaybackPosition):
+        * html/SearchInputType.cpp:
+        (WebCore::SearchInputType::startSearchEventTimer):
+        * html/ValidationMessage.cpp:
+        (WebCore::ValidationMessage::setMessageDOMAndStartTimer):
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlPanelElement::startTimer):
+        (WebCore::MediaControlPanelElement::makeTransparent):
+        * html/track/VTTRegion.cpp:
+        (WebCore::VTTRegion::startTimer):
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::frameScheduledNavigationImpl):
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::frameScheduledNavigation):
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::frameScheduledNavigation):
+        * inspector/InspectorPageAgent.h:
+        * loader/NavigationScheduler.cpp:
+        (WebCore::NavigationScheduler::startTimer):
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::documentDidFinishLoadEvent):
+        * loader/icon/IconDatabase.cpp:
+        * page/EventHandler.cpp:
+        * page/EventSource.cpp:
+        (WebCore::EventSource::scheduleReconnect):
+        * page/FocusController.cpp:
+        (WebCore::FocusController::setFocusedElementNeedsRepaint):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::scrollPositionChanged):
+        (WebCore::FrameView::enableSpeculativeTilingIfNeeded):
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        * page/Settings.h:
+        (WebCore::Settings::setTimeWithoutMouseMovementBeforeHidingControls):
+        (WebCore::Settings::timeWithoutMouseMovementBeforeHidingControls):
+        * page/SuspendableTimer.h:
+        * page/animation/CSSAnimationController.cpp:
+        * page/mac/EventHandlerMac.mm:
+        * page/mac/TextIndicatorWindow.mm:
+        (WebCore::TextIndicatorWindow::setTextIndicator):
+        * platform/HysteresisActivity.h:
+        (WebCore::HysteresisActivity::stop):
+        * platform/ScrollAnimationSmooth.cpp:
+        (WebCore::getAnimationParametersForGranularity):
+        (WebCore::ScrollAnimationSmooth::updatePerAxisData):
+        (WebCore::ScrollAnimationSmooth::animateScroll):
+        (WebCore::ScrollAnimationSmooth::animationTimerFired):
+        (WebCore::ScrollAnimationSmooth::startNextTimer):
+        * platform/ScrollAnimationSmooth.h:
+        * platform/Timer.h:
+        (WebCore::TimerBase::startRepeating):
+        * platform/audio/PlatformMediaSession.cpp:
+        (WebCore::PlatformMediaSession::scheduleClientDataBufferingCheck):
+        * platform/cocoa/ScrollController.mm:
+        (WebCore::ScrollController::scheduleStatelessScrollSnap):
+        * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
+        (WebCore::GameControllerGamepadProvider::gamepadHadInput):
+        * platform/gamepad/mac/HIDGamepadProvider.cpp:
+        (WebCore::HIDGamepadProvider::openAndScheduleManager):
+        (WebCore::HIDGamepadProvider::valuesChanged):
+        * platform/glib/MainThreadSharedTimerGLib.cpp:
+        (WebCore::MainThreadSharedTimer::setFireInterval):
+        * platform/graphics/BitmapImage.cpp:
+        (WebCore::BitmapImage::startTimer):
+        (WebCore::BitmapImage::internalStartAnimation):
+        (WebCore::BitmapImage::advanceAnimation):
+        (WebCore::BitmapImage::resetAnimation):
+        * platform/graphics/BitmapImage.h:
+        * platform/graphics/MediaPlaybackTargetPicker.cpp:
+        * platform/graphics/ShadowBlur.cpp:
+        (WebCore::ScratchBuffer::scheduleScratchBufferPurge):
+        * platform/graphics/ca/LayerPool.cpp:
+        (WebCore::LayerPool::schedulePrune):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
+        * platform/graphics/mac/GraphicsContext3DMac.mm:
+        (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
+        * platform/graphics/texmap/BitmapTexturePool.cpp:
+        (WebCore::BitmapTexturePool::scheduleReleaseUnusedTextures):
+        (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
+        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
+        (WebCore::TextureMapperPlatformLayerProxy::scheduleReleaseUnusedBuffers):
+        (WebCore::TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired):
+        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
+        * platform/gtk/ScrollAnimatorGtk.cpp:
+        (WebCore::ScrollAnimatorGtk::overlayScrollbarAnimationTimerFired):
+        (WebCore::ScrollAnimatorGtk::showOverlayScrollbars):
+        (WebCore::ScrollAnimatorGtk::hideOverlayScrollbars):
+        * platform/gtk/ScrollAnimatorGtk.h:
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+        (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::ScrollAnimatorMac::startScrollbarPaintTimer):
+        * platform/mock/MediaPlaybackTargetPickerMock.cpp:
+        * platform/mock/PlatformSpeechSynthesizerMock.cpp:
+        (WebCore::PlatformSpeechSynthesizerMock::speak):
+        * platform/mock/TimerEventBasedMock.h:
+        (WebCore::TimerEvent::TimerEvent):
+        * platform/network/DNSResolveQueue.cpp:
+        (WebCore::DNSResolveQueue::add):
+        (WebCore::DNSResolveQueue::timerFired):
+        * platform/network/PingHandle.h:
+        * platform/network/curl/ResourceHandleManager.cpp:
+        (WebCore::ResourceHandleManager::downloadTimerCallback):
+        (WebCore::ResourceHandleManager::add):
+        (WebCore::ResourceHandleManager::cancel):
+        * platform/network/mac/NetworkStateNotifierMac.cpp:
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::ResourceHandle::sendPendingRequest):
+        * rendering/ImageQualityController.cpp:
+        (WebCore::ImageQualityController::restartTimer):
+        * rendering/RenderLayerCompositor.cpp:
+        * rendering/RenderProgress.cpp:
+        (WebCore::RenderProgress::RenderProgress):
+        * rendering/RenderProgress.h:
+        * rendering/RenderText.cpp:
+        (WebCore::SecureTextTimer::restart):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::animationRepeatIntervalForProgressBar):
+        * rendering/RenderTheme.h:
+        (WebCore::RenderTheme::mediaControlsFadeOutDuration):
+        * rendering/RenderThemeGtk.cpp:
+        (WebCore::RenderThemeGtk::animationRepeatIntervalForProgressBar):
+        * rendering/RenderThemeGtk.h:
+        * rendering/RenderThemeIOS.h:
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::RenderThemeIOS::animationRepeatIntervalForProgressBar):
+        * rendering/RenderThemeMac.h:
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::animationRepeatIntervalForProgressBar):
+        (WebCore::RenderThemeMac::animationDurationForProgressBar):
+        * replay/EventLoopInputDispatcher.cpp:
+        (WebCore::EventLoopInputDispatcher::dispatchInputSoon):
+        * svg/animation/SMILTimeContainer.cpp:
+        (WebCore::SMILTimeContainer::startTimer):
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls):
+        * testing/InternalSettings.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::setImageFrameDecodingDuration):
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::createRequest):
+
 2017-04-10  Miguel Gomez  <magomez@igalia.com>
 
         REGRESSION(r205841): [GTK] Test fast/images/animated-png.html is failing since r205841
index 74a96ce..869502f 100644 (file)
@@ -87,7 +87,7 @@ void GeoNotifier::runErrorCallback(PositionError* error)
 
 void GeoNotifier::startTimerIfNeeded()
 {
-    m_timer.startOneShot(m_options.timeout / 1000.0);
+    m_timer.startOneShot(1_ms * m_options.timeout);
 }
 
 void GeoNotifier::stopTimer()
index 7a3369f..9b0eb92 100644 (file)
@@ -36,7 +36,7 @@
 
 namespace WebCore {
 
-static const double taskDelayInterval = 1.0 / 10.0;
+static const Seconds taskDelayInterval { 100_ms };
 
 struct ClientState {
     explicit ClientState(WebMediaSessionManagerClient& client, uint64_t contextId)
@@ -423,8 +423,8 @@ size_t WebMediaSessionManager::find(WebMediaSessionManagerClient* client, uint64
 
 void WebMediaSessionManager::configureWatchdogTimer()
 {
-    static const double watchdogTimerIntervalAfterPausing = 60 * 60;
-    static const double watchdogTimerIntervalAfterPlayingToEnd = 8 * 60;
+    static const Seconds watchdogTimerIntervalAfterPausing { 1_h };
+    static const Seconds watchdogTimerIntervalAfterPlayingToEnd { 8_min };
 
     if (!m_playbackTarget || !m_playbackTarget->hasActiveRoute()) {
         m_watchdogTimer.stop();
@@ -442,14 +442,14 @@ void WebMediaSessionManager::configureWatchdogTimer()
     }
 
     if (stopTimer) {
-        m_currentWatchdogInterval = 0;
+        m_currentWatchdogInterval = { };
         m_watchdogTimer.stop();
         LOG(Media, "WebMediaSessionManager::configureWatchdogTimer - timer stopped");
     } else {
-        double interval = didPlayToEnd ? watchdogTimerIntervalAfterPlayingToEnd : watchdogTimerIntervalAfterPausing;
+        Seconds interval = didPlayToEnd ? watchdogTimerIntervalAfterPlayingToEnd : watchdogTimerIntervalAfterPausing;
         if (interval != m_currentWatchdogInterval || !m_watchdogTimer.isActive()) {
             m_watchdogTimer.startOneShot(interval);
-            LOG(Media, "WebMediaSessionManager::configureWatchdogTimer - timer scheduled for %.0f", interval);
+            LOG(Media, "WebMediaSessionManager::configureWatchdogTimer - timer scheduled for %.0f seconds", interval.value());
         }
         m_currentWatchdogInterval = interval;
     }
index 57d58ef..29509e2 100644 (file)
@@ -102,7 +102,7 @@ private:
     RefPtr<MediaPlaybackTarget> m_playbackTarget;
     std::unique_ptr<WebCore::MediaPlaybackTargetPickerMock> m_pickerOverride;
     ConfigurationTasks m_taskFlags { NoTask };
-    double m_currentWatchdogInterval { 0 };
+    Seconds m_currentWatchdogInterval;
     bool m_externalOutputDeviceAvailable { false };
     bool m_targetChanged { false };
     bool m_mockPickerEnabled { false };
index db4c404..3f7b2c1 100644 (file)
@@ -143,7 +143,7 @@ void CanvasCaptureMediaStreamTrack::Source::canvasChanged(HTMLCanvasElement& can
     // FIXME: We should try to generate the frame at the time the screen is being updated.
     if (m_canvasChangedTimer.isActive())
         return;
-    m_canvasChangedTimer.startOneShot(0);
+    m_canvasChangedTimer.startOneShot(0_s);
 }
 
 void CanvasCaptureMediaStreamTrack::Source::captureCanvas()
index c1522b3..0518073 100644 (file)
@@ -110,7 +110,7 @@ void Vibration::timerFired()
         m_vibrationClient->vibrate(m_pattern[0]);
         break;
     }
-    m_timer.startOneShot(m_pattern[0] / 1000.0);
+    m_timer.startOneShot(1_ms * m_pattern[0]);
     m_pattern.remove(0);
 }
 
index c5cb124..61d3ccd 100644 (file)
@@ -61,7 +61,7 @@
 
 namespace WebCore {
 
-const double TCPMaximumSegmentLifetime = 2 * 60.0;
+const Seconds TCPMaximumSegmentLifetime { 2_min };
 
 WebSocketChannel::WebSocketChannel(Document& document, WebSocketChannelClient& client, SocketProvider& provider)
     : m_document(&document)
@@ -207,7 +207,7 @@ void WebSocketChannel::close(int code, const String& reason)
     Ref<WebSocketChannel> protectedThis(*this); // An attempt to send closing handshake may fail, which will get the channel closed and dereferenced.
     startClosingHandshake(code, reason);
     if (m_closing && !m_closingTimer.isActive())
-        m_closingTimer.startOneShot(2 * TCPMaximumSegmentLifetime);
+        m_closingTimer.startOneShot(TCPMaximumSegmentLifetime * 2);
 }
 
 void WebSocketChannel::fail(const String& reason)
index 1254050..f06df74 100644 (file)
@@ -110,9 +110,9 @@ namespace WebCore {
 using namespace HTMLNames;
 
 // Post value change notifications for password fields or elements contained in password fields at a 40hz interval to thwart analysis of typing cadence
-static double AccessibilityPasswordValueChangeNotificationInterval = 0.025;
-static double AccessibilityLiveRegionChangedNotificationInterval = 0.020;
-static double AccessibilityFocusAriaModalNodeNotificationInterval = 0.050;
+static const Seconds accessibilityPasswordValueChangeNotificationInterval { 25_ms };
+static const Seconds accessibilityLiveRegionChangedNotificationInterval { 20_ms };
+static const Seconds accessibilityFocusAriaModalNodeNotificationInterval { 50_ms };
 
 AccessibilityObjectInclusion AXComputedObjectAttributeCache::getIgnored(AXID id) const
 {
@@ -1311,7 +1311,7 @@ bool AXObjectCache::enqueuePasswordValueChangeNotification(AccessibilityObject*
 
     m_passwordNotificationsToPost.add(observableObject);
     if (!m_passwordNotificationPostTimer.isActive())
-        m_passwordNotificationPostTimer.startOneShot(AccessibilityPasswordValueChangeNotificationInterval);
+        m_passwordNotificationPostTimer.startOneShot(accessibilityPasswordValueChangeNotificationInterval);
 
     return true;
 }
@@ -1338,7 +1338,7 @@ void AXObjectCache::postLiveRegionChangeNotification(AccessibilityObject* object
     if (!m_liveRegionObjectsSet.contains(object))
         m_liveRegionObjectsSet.add(object);
 
-    m_liveRegionChangedPostTimer.startOneShot(AccessibilityLiveRegionChangedNotificationInterval);
+    m_liveRegionChangedPostTimer.startOneShot(accessibilityLiveRegionChangedNotificationInterval);
 }
 
 void AXObjectCache::liveRegionChangedNotificationPostTimerFired()
@@ -1372,7 +1372,7 @@ void AXObjectCache::focusAriaModalNode()
     if (m_focusAriaModalNodeTimer.isActive())
         m_focusAriaModalNodeTimer.stop();
     
-    m_focusAriaModalNodeTimer.startOneShot(AccessibilityFocusAriaModalNodeNotificationInterval);
+    m_focusAriaModalNodeTimer.startOneShot(accessibilityFocusAriaModalNodeNotificationInterval);
 }
 
 void AXObjectCache::focusAriaModalNodeTimerFired()
index 34bdbee..bf920f8 100644 (file)
@@ -527,7 +527,7 @@ void CSSFontFace::setStatus(Status newStatus)
     }
 
     if (newStatus == Status::Loading)
-        m_timeoutTimer.startOneShot(webFontsShouldAlwaysFallBack() ? 0 : 3);
+        m_timeoutTimer.startOneShot(webFontsShouldAlwaysFallBack() ? 0_s : 3_s);
     else if (newStatus == Status::Success || newStatus == Status::Failure)
         m_timeoutTimer.stop();
 
index ae7f976..4aa12d7 100644 (file)
 #include "WebKitCSSRegionRule.h"
 #include "WebKitFontFamilyNames.h"
 #include <bitset>
+#include <wtf/Seconds.h>
 #include <wtf/SetForScope.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/Vector.h>
@@ -1251,8 +1252,8 @@ void StyleResolver::addToMatchedPropertiesCache(const RenderStyle* style, const
     static const unsigned matchedDeclarationCacheAdditionsBetweenSweeps = 100;
     if (++m_matchedPropertiesCacheAdditionsSinceLastSweep >= matchedDeclarationCacheAdditionsBetweenSweeps
         && !m_matchedPropertiesCacheSweepTimer.isActive()) {
-        static const unsigned matchedDeclarationCacheSweepTimeInSeconds = 60;
-        m_matchedPropertiesCacheSweepTimer.startOneShot(matchedDeclarationCacheSweepTimeInSeconds);
+        static const Seconds matchedDeclarationCacheSweepTime { 1_min };
+        m_matchedPropertiesCacheSweepTimer.startOneShot(matchedDeclarationCacheSweepTime);
     }
 
     ASSERT(hash);
index 0e739e3..3e0d84e 100644 (file)
@@ -1199,7 +1199,7 @@ void Document::setVisualUpdatesAllowed(bool visualUpdatesAllowed)
     if (visualUpdatesAllowed)
         m_visualUpdatesSuppressionTimer.stop();
     else
-        m_visualUpdatesSuppressionTimer.startOneShot(settings().incrementalRenderingSuppressionTimeoutInSeconds());
+        m_visualUpdatesSuppressionTimer.startOneShot(1_s * settings().incrementalRenderingSuppressionTimeoutInSeconds());
 
     if (!visualUpdatesAllowed)
         return;
@@ -5004,8 +5004,8 @@ void Document::finishedParsing()
     // so that dynamically inserted content can also benefit from sharing optimizations.
     // Note that we don't refresh the timer on pool access since that could lead to huge caches being kept
     // alive indefinitely by something innocuous like JS setting .innerHTML repeatedly on a timer.
-    static const int timeToKeepSharedObjectPoolAliveAfterParsingFinishedInSeconds = 10;
-    m_sharedObjectPoolClearTimer.startOneShot(timeToKeepSharedObjectPoolAliveAfterParsingFinishedInSeconds);
+    static const Seconds timeToKeepSharedObjectPoolAliveAfterParsingFinished { 10_s };
+    m_sharedObjectPoolClearTimer.startOneShot(timeToKeepSharedObjectPoolAliveAfterParsingFinished);
 
     // Parser should have picked up all speculative preloads by now
     m_cachedResourceLoader->clearPreloads(CachedResourceLoader::ClearPreloadsMode::ClearSpeculativePreloads);
index 92e0db3..1b8591f 100644 (file)
 #include <wtf/CurrentTime.h>
 
 // Allow a little more than 60fps to make sure we can at least hit that frame rate.
-static const Seconds fullSpeedAnimationInterval { 0.015 };
+static const Seconds fullSpeedAnimationInterval { 15_ms };
 // Allow a little more than 30fps to make sure we can at least hit that frame rate.
-static const Seconds halfSpeedThrottlingAnimationInterval { 0.030 };
-static const Seconds aggressiveThrottlingAnimationInterval { 10 };
+static const Seconds halfSpeedThrottlingAnimationInterval { 30_ms };
+static const Seconds aggressiveThrottlingAnimationInterval { 10_s };
 #endif
 
 #define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(page() && page()->isAlwaysOnLoggingAllowed(), PerformanceLogging, "%p - ScriptedAnimationController::" fmt, this, ##__VA_ARGS__)
index e27bd0d..05afae4 100644 (file)
@@ -140,7 +140,7 @@ AlternativeTextController::~AlternativeTextController()
 
 void AlternativeTextController::startAlternativeTextUITimer(AlternativeTextType type)
 {
-    const double correctionPanelTimerInterval = 0.3;
+    const Seconds correctionPanelTimerInterval { 300_ms };
     if (!isAutomaticSpellingCorrectionEnabled())
         return;
 
index 4d60468..9fed6f7 100644 (file)
@@ -168,7 +168,7 @@ static const double SeekTime = 0.2;
 static const Seconds ScanRepeatDelay { 1.5_s };
 static const double ScanMaximumRate = 8;
 
-static const double HideMediaControlsAfterEndedDelay = 6;
+static const Seconds hideMediaControlsAfterEndedDelay { 6_s };
 
 static void setFlags(unsigned& value, unsigned flags)
 {
@@ -4497,7 +4497,7 @@ void HTMLMediaElement::addBehaviorRestrictionsOnEndIfNecessary()
 
     m_mediaSession->addBehaviorRestriction(MediaElementSession::RequireUserGestureToControlControlsManager);
     m_playbackControlsManagerBehaviorRestrictionsTimer.stop();
-    m_playbackControlsManagerBehaviorRestrictionsTimer.startOneShot(HideMediaControlsAfterEndedDelay);
+    m_playbackControlsManagerBehaviorRestrictionsTimer.startOneShot(hideMediaControlsAfterEndedDelay);
 }
 
 void HTMLMediaElement::handleSeekToPlaybackPosition(double position)
@@ -4507,7 +4507,7 @@ void HTMLMediaElement::handleSeekToPlaybackPosition(double position)
     // Please see <rdar://problem/28457219> for more details.
     seek(MediaTime::createWithDouble(position));
     m_seekToPlaybackPositionEndedTimer.stop();
-    m_seekToPlaybackPositionEndedTimer.startOneShot(0.5);
+    m_seekToPlaybackPositionEndedTimer.startOneShot(500_ms);
 
     if (!m_isScrubbingRemotely) {
         m_isScrubbingRemotely = true;
index f5d2bb9..d82359f 100644 (file)
@@ -165,7 +165,7 @@ void SearchInputType::startSearchEventTimer()
 
     // After typing the first key, we wait 0.5 seconds.
     // After the second key, 0.4 seconds, then 0.3, then 0.2 from then on.
-    m_searchEventTimer.startOneShot(std::max(0.2, 0.6 - 0.1 * length));
+    m_searchEventTimer.startOneShot(std::max(200_ms, 600_ms - 100_ms * length));
 }
 
 void SearchInputType::stopSearchEventTimer()
index 451fc59..470eaed 100644 (file)
@@ -144,7 +144,7 @@ void ValidationMessage::setMessageDOMAndStartTimer()
         m_timer = nullptr;
     else {
         m_timer = std::make_unique<Timer>(*this, &ValidationMessage::deleteBubbleTree);
-        m_timer->startOneShot(std::max(5.0, static_cast<double>(m_message.length()) * magnification / 1000));
+        m_timer->startOneShot(std::max(5_s, 1_ms * static_cast<double>(m_message.length()) * magnification));
     }
 }
 
index b512ffc..abec673 100644 (file)
 
 namespace WebCore {
 
-const double secondsBetweenRestoreAttempts = 1.0;
+static const Seconds secondsBetweenRestoreAttempts { 1_s };
 const int maxGLErrorsAllowedToConsole = 256;
 static const Seconds checkContextLossHandlingDelay { 3_s };
 
index 7b1df49..5f3b3c3 100644 (file)
@@ -137,7 +137,7 @@ void MediaControlPanelElement::startTimer()
     // The timer is required to set the property display:'none' on the panel,
     // such that captions are correctly displayed at the bottom of the video
     // at the end of the fadeout transition.
-    double duration = document().page() ? document().page()->theme().mediaControlsFadeOutDuration() : 0;
+    Seconds duration = document().page() ? document().page()->theme().mediaControlsFadeOutDuration() : 0_s;
     m_transitionTimer.startOneShot(duration);
 }
 
@@ -205,10 +205,10 @@ void MediaControlPanelElement::makeTransparent()
     if (!m_opaque)
         return;
 
-    double duration = document().page() ? document().page()->theme().mediaControlsFadeOutDuration() : 0;
+    Seconds duration = document().page() ? document().page()->theme().mediaControlsFadeOutDuration() : 0_s;
 
     setInlineStyleProperty(CSSPropertyTransitionProperty, CSSPropertyOpacity);
-    setInlineStyleProperty(CSSPropertyTransitionDuration, duration, CSSPrimitiveValue::CSS_S);
+    setInlineStyleProperty(CSSPropertyTransitionDuration, duration.value(), CSSPrimitiveValue::CSS_S);
     setInlineStyleProperty(CSSPropertyOpacity, 0.0, CSSPrimitiveValue::CSS_NUMBER);
 
     m_opaque = false;
index 0578bf9..cb4d05b 100644 (file)
@@ -56,7 +56,7 @@ namespace WebCore {
 static const float lineHeight = 5.33;
 
 // Default scrolling animation time period (s).
-static const float scrollTime = 0.433;
+static const Seconds scrollTime { 433_ms };
 
 VTTRegion::VTTRegion(ScriptExecutionContext& context)
     : ContextDestructionObserver(&context)
@@ -403,7 +403,7 @@ void VTTRegion::startTimer()
     if (m_scrollTimer.isActive())
         return;
 
-    double duration = isScrollingRegion() ? scrollTime : 0;
+    Seconds duration = isScrollingRegion() ? scrollTime : 0_s;
     m_scrollTimer.startOneShot(duration);
 }
 
index 51c4baa..c1b4688 100644 (file)
@@ -803,7 +803,7 @@ void InspectorInstrumentation::frameStoppedLoadingImpl(InstrumentingAgents& inst
         inspectorPageAgent->frameStoppedLoading(frame);
 }
 
-void InspectorInstrumentation::frameScheduledNavigationImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, double delay)
+void InspectorInstrumentation::frameScheduledNavigationImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, Seconds delay)
 {
     if (InspectorPageAgent* inspectorPageAgent = instrumentingAgents.inspectorPageAgent())
         inspectorPageAgent->frameScheduledNavigation(frame, delay);
index 4589752..9c21126 100644 (file)
@@ -179,7 +179,7 @@ public:
     static void loaderDetachedFromFrame(Frame&, DocumentLoader&);
     static void frameStartedLoading(Frame&);
     static void frameStoppedLoading(Frame&);
-    static void frameScheduledNavigation(Frame&, double delay);
+    static void frameScheduledNavigation(Frame&, Seconds delay);
     static void frameClearedScheduledNavigation(Frame&);
     static void willDestroyCachedResource(CachedResource&);
 
@@ -349,7 +349,7 @@ private:
     static void loaderDetachedFromFrameImpl(InstrumentingAgents&, DocumentLoader&);
     static void frameStartedLoadingImpl(InstrumentingAgents&, Frame&);
     static void frameStoppedLoadingImpl(InstrumentingAgents&, Frame&);
-    static void frameScheduledNavigationImpl(InstrumentingAgents&, Frame&, double delay);
+    static void frameScheduledNavigationImpl(InstrumentingAgents&, Frame&, Seconds delay);
     static void frameClearedScheduledNavigationImpl(InstrumentingAgents&, Frame&);
     static void willDestroyCachedResourceImpl(CachedResource&);
 
@@ -982,7 +982,7 @@ inline void InspectorInstrumentation::frameStoppedLoading(Frame& frame)
         frameStoppedLoadingImpl(*instrumentingAgents, frame);
 }
 
-inline void InspectorInstrumentation::frameScheduledNavigation(Frame& frame, double delay)
+inline void InspectorInstrumentation::frameScheduledNavigation(Frame& frame, Seconds delay)
 {
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         frameScheduledNavigationImpl(*instrumentingAgents, frame, delay);
index 32fd47e..6aa6a08 100644 (file)
@@ -806,9 +806,9 @@ void InspectorPageAgent::frameStoppedLoading(Frame& frame)
     m_frontendDispatcher->frameStoppedLoading(frameId(&frame));
 }
 
-void InspectorPageAgent::frameScheduledNavigation(Frame& frame, double delay)
+void InspectorPageAgent::frameScheduledNavigation(Frame& frame, Seconds delay)
 {
-    m_frontendDispatcher->frameScheduledNavigation(frameId(&frame), delay);
+    m_frontendDispatcher->frameScheduledNavigation(frameId(&frame), delay.value());
 }
 
 void InspectorPageAgent::frameClearedScheduledNavigation(Frame& frame)
index 7e928ae..2883181 100644 (file)
@@ -118,7 +118,7 @@ public:
     void loaderDetachedFromFrame(DocumentLoader&);
     void frameStartedLoading(Frame&);
     void frameStoppedLoading(Frame&);
-    void frameScheduledNavigation(Frame&, double delay);
+    void frameScheduledNavigation(Frame&, Seconds delay);
     void frameClearedScheduledNavigation(Frame&);
     void applyEmulatedMedia(String&);
     void didPaint(RenderObject&, const LayoutRect&);
index a391851..e6c392e 100644 (file)
@@ -541,7 +541,7 @@ void NavigationScheduler::startTimer()
     if (!m_redirect->shouldStartTimer(m_frame))
         return;
 
-    double delay = m_redirect->delay();
+    Seconds delay = 1_s * m_redirect->delay();
     m_timer.startOneShot(delay);
     InspectorInstrumentation::frameScheduledNavigation(m_frame, delay);
     m_redirect->didStartTimer(m_frame, m_timer); // m_redirect may be null on return (e.g. the client canceled the load)
index 7181992..e89065b 100644 (file)
@@ -84,7 +84,7 @@
 namespace WebCore {
 
 // Timeout for link preloads to be used after window.onload
-static const int unusedPreloadTimeoutInSeconds = 3;
+static const Seconds unusedPreloadTimeout { 3_s };
 
 static CachedResource* createResource(CachedResource::Type type, CachedResourceRequest&& request, SessionID sessionID)
 {
@@ -828,7 +828,7 @@ void CachedResourceLoader::documentDidFinishLoadEvent()
     // If m_preloads is not empty here, it's full of link preloads,
     // as speculative preloads were cleared at DCL.
     if (m_preloads && m_preloads->size() && !m_unusedPreloadsTimer.isActive())
-        m_unusedPreloadsTimer.startOneShot(unusedPreloadTimeoutInSeconds);
+        m_unusedPreloadsTimer.startOneShot(unusedPreloadTimeout);
 }
 
 void CachedResourceLoader::stopUnusedPreloadsTimer()
index 4cdcfaa..8de94ce 100644 (file)
@@ -67,7 +67,7 @@ static const int currentDatabaseVersion = 6;
 // Icons expire once every 4 days
 static const int iconExpirationTime = 60*60*24*4; 
 
-static const int updateTimerDelay = 5; 
+static const Seconds updateTimerDelay { 5_s };
 
 static bool checkIntegrityOnOpen = false;
 
index dca8230..845f3ae 100644 (file)
@@ -157,14 +157,14 @@ using namespace SVGNames;
 // during a scroll. The short interval is used if the content responds to the mouse events
 // in fakeMouseMoveDurationThreshold or less, otherwise the long interval is used.
 const double fakeMouseMoveDurationThreshold = 0.01;
-const double fakeMouseMoveShortInterval = 0.1;
-const double fakeMouseMoveLongInterval = 0.25;
+const Seconds fakeMouseMoveShortInterval = { 100_ms };
+const Seconds fakeMouseMoveLongInterval = { 250_ms };
 #endif
 
 #if ENABLE(CURSOR_SUPPORT)
 // The amount of time to wait for a cursor update on style and layout changes
 // Set to 50Hz, no need to be faster than common screen refresh rate
-const double cursorUpdateInterval = 0.02;
+static const Seconds cursorUpdateInterval { 20_ms };
 
 const int maximumCursorSize = 128;
 #endif
index b1ded3f..3794309 100644 (file)
@@ -138,7 +138,7 @@ void EventSource::scheduleInitialConnect()
 void EventSource::scheduleReconnect()
 {
     m_state = CONNECTING;
-    m_connectTimer.startOneShot(m_reconnectDelay / 1000.0);
+    m_connectTimer.startOneShot(1_ms * m_reconnectDelay);
     dispatchEvent(Event::create(eventNames().errorEvent, false, false));
 }
 
index a1b88ee..8f0a277 100644 (file)
@@ -1089,7 +1089,7 @@ bool FocusController::advanceFocusDirectionally(FocusDirection direction, Keyboa
 
 void FocusController::setFocusedElementNeedsRepaint()
 {
-    m_focusRepaintTimer.startOneShot(0.033);
+    m_focusRepaintTimer.startOneShot(33_ms);
 }
 
 void FocusController::focusRepaintTimerFired()
index fac1e2f..c3fcc93 100644 (file)
@@ -2515,7 +2515,7 @@ void FrameView::scrollPositionChanged(const ScrollPosition& oldPosition, const S
         m_delayedScrollEventTimer.stop();
         sendScrollEvent();
     } else if (!m_delayedScrollEventTimer.isActive())
-        m_delayedScrollEventTimer.startOneShot(throttlingDelay.value());
+        m_delayedScrollEventTimer.startOneShot(throttlingDelay);
 
     if (Document* document = frame().document())
         document->sendWillRevealEdgeEventsIfNeeded(oldPosition, newPosition, visibleContentRect(), contentsSize());
@@ -2934,7 +2934,7 @@ void FrameView::enableSpeculativeTilingIfNeeded()
     if (m_speculativeTilingEnableTimer.isActive())
         return;
     // Delay enabling a bit as load completion may trigger further loading from scripts.
-    static const double speculativeTilingEnableDelay = 0.5;
+    static const Seconds speculativeTilingEnableDelay { 500_ms };
     m_speculativeTilingEnableTimer.startOneShot(speculativeTilingEnableDelay);
 }
 
index e7cc90a..45070ed 100644 (file)
@@ -212,7 +212,7 @@ Settings::Settings(Page* page)
     , m_touchEventEmulationEnabled(false)
 #endif
     , m_scrollingPerformanceLoggingEnabled(false)
-    , m_timeWithoutMouseMovementBeforeHidingControls(3)
+    , m_timeWithoutMouseMovementBeforeHidingControls(3_s)
     , m_setImageLoadingSettingsTimer(*this, &Settings::imageLoadingSettingsTimerFired)
     , m_hiddenPageDOMTimerThrottlingEnabled(false)
     , m_hiddenPageCSSAnimationSuspensionEnabled(false)
index 9f37075..d196dc2 100644 (file)
@@ -256,8 +256,8 @@ public:
     WEBCORE_EXPORT static void setShouldRespectPriorityInCSSAttributeSetters(bool);
     static bool shouldRespectPriorityInCSSAttributeSetters();
 
-    void setTimeWithoutMouseMovementBeforeHidingControls(double time) { m_timeWithoutMouseMovementBeforeHidingControls = time; }
-    double timeWithoutMouseMovementBeforeHidingControls() const { return m_timeWithoutMouseMovementBeforeHidingControls; }
+    void setTimeWithoutMouseMovementBeforeHidingControls(Seconds time) { m_timeWithoutMouseMovementBeforeHidingControls = time; }
+    Seconds timeWithoutMouseMovementBeforeHidingControls() const { return m_timeWithoutMouseMovementBeforeHidingControls; }
 
     bool hiddenPageCSSAnimationSuspensionEnabled() const { return m_hiddenPageCSSAnimationSuspensionEnabled; }
     WEBCORE_EXPORT void setHiddenPageCSSAnimationSuspensionEnabled(bool);
@@ -361,7 +361,7 @@ private:
 #endif
     bool m_scrollingPerformanceLoggingEnabled : 1;
 
-    double m_timeWithoutMouseMovementBeforeHidingControls;
+    Seconds m_timeWithoutMouseMovementBeforeHidingControls;
 
     Timer m_setImageLoadingSettingsTimer;
     void imageLoadingSettingsTimerFired();
index 3129208..5584434 100644 (file)
@@ -45,8 +45,6 @@ public:
     bool isActive() const { return TimerBase::isActive() || (m_suspended && m_savedIsActive); }
     bool isSuspended() const { return m_suspended; }
 
-    void startOneShot(double interval) { startOneShot(Seconds { interval }); }
-
     Seconds repeatInterval() const;
 
     void startRepeating(Seconds repeatInterval);
index dcd7e40..00c73e1 100644 (file)
@@ -49,9 +49,9 @@
 namespace WebCore {
 
 // Allow a little more than 60fps to make sure we can at least hit that frame rate.
-static const Seconds animationTimerDelay { 0.015 };
+static const Seconds animationTimerDelay { 15_ms };
 // Allow a little more than 30fps to make sure we can at least hit that frame rate.
-static const Seconds animationTimerThrottledDelay { 0.030 };
+static const Seconds animationTimerThrottledDelay { 30_ms };
 
 class AnimationPrivateUpdateBlock {
 public:
index f51e0a8..f71e4fd 100644 (file)
@@ -74,7 +74,7 @@
 
 namespace WebCore {
 
-const double resetLatchedStateTimeout = 0.1;
+static const Seconds resetLatchedStateTimeout { 100_ms };
 
 static RetainPtr<NSEvent>& currentNSEventSlot()
 {
index e5929ba..fc36dcb 100644 (file)
@@ -476,7 +476,7 @@ void TextIndicatorWindow::setTextIndicator(Ref<TextIndicator> textIndicator, CGR
         [m_textIndicatorView present];
 
     if (lifetime == TextIndicatorWindowLifetime::Temporary)
-        m_temporaryTextIndicatorTimer.startOneShot(timeBeforeFadeStarts);
+        m_temporaryTextIndicatorTimer.startOneShot(1_s * timeBeforeFadeStarts);
 }
 
 void TextIndicatorWindow::closeWindow()
index 128ef82..599e171 100644 (file)
@@ -65,7 +65,7 @@ public:
             return;
         m_active = false;
 
-        m_timer.startOneShot(m_hysteresisSeconds);
+        m_timer.startOneShot(1_s * m_hysteresisSeconds);
     }
 
     void impulse()
@@ -89,7 +89,7 @@ private:
     }
 
     std::function<void(HysteresisState)> m_callback;
-    double m_hysteresisSeconds;
+    double m_hysteresisSeconds; // FIXME: Should use Seconds.
     bool m_active;
     Timer m_timer;
 };
index c8f5d5d..7a5f1ea 100644 (file)
@@ -37,8 +37,8 @@
 namespace WebCore {
 
 static const double frameRate = 60;
-static const double tickTime = 1 / frameRate;
-static const double minimumTimerInterval = .001;
+static const Seconds tickTime = 1_s / frameRate;
+static const Seconds minimumTimerInterval { 1_ms };
 
 ScrollAnimationSmooth::ScrollAnimationSmooth(ScrollableArea& scrollableArea, const FloatPoint& position, std::function<void (FloatPoint&&)>&& notifyPositionChangedFunction)
     : ScrollAnimation(scrollableArea)
@@ -226,40 +226,40 @@ static inline double releaseArea(ScrollAnimationSmooth::Curve curve, double star
     return endValue - startValue;
 }
 
-static inline void getAnimationParametersForGranularity(ScrollGranularity granularity, double& animationTime, double& repeatMinimumSustainTime, double& attackTime, double& releaseTime, ScrollAnimationSmooth::Curve& coastTimeCurve, double& maximumCoastTime)
+static inline void getAnimationParametersForGranularity(ScrollGranularity granularity, Seconds& animationTime, Seconds& repeatMinimumSustainTime, Seconds& attackTime, Seconds& releaseTime, ScrollAnimationSmooth::Curve& coastTimeCurve, Seconds& maximumCoastTime)
 {
     switch (granularity) {
     case ScrollByDocument:
-        animationTime = 20 * tickTime;
-        repeatMinimumSustainTime = 10 * tickTime;
-        attackTime = 10 * tickTime;
-        releaseTime = 10 * tickTime;
+        animationTime = tickTime * 10;
+        repeatMinimumSustainTime = tickTime * 10;
+        attackTime = tickTime * 10;
+        releaseTime = tickTime * 10;
         coastTimeCurve = ScrollAnimationSmooth::Curve::Linear;
-        maximumCoastTime = 1;
+        maximumCoastTime = 1_s;
         break;
     case ScrollByLine:
-        animationTime = 10 * tickTime;
-        repeatMinimumSustainTime = 7 * tickTime;
-        attackTime = 3 * tickTime;
-        releaseTime = 3 * tickTime;
+        animationTime = tickTime * 10;
+        repeatMinimumSustainTime = tickTime * 7;
+        attackTime = tickTime * 3;
+        releaseTime = tickTime * 3;
         coastTimeCurve = ScrollAnimationSmooth::Curve::Linear;
-        maximumCoastTime = 1;
+        maximumCoastTime = 1_s;
         break;
     case ScrollByPage:
-        animationTime = 15 * tickTime;
-        repeatMinimumSustainTime = 10 * tickTime;
-        attackTime = 5 * tickTime;
-        releaseTime = 5 * tickTime;
+        animationTime = tickTime * 15;
+        repeatMinimumSustainTime = tickTime * 10;
+        attackTime = tickTime * 5;
+        releaseTime = tickTime * 5;
         coastTimeCurve = ScrollAnimationSmooth::Curve::Linear;
-        maximumCoastTime = 1;
+        maximumCoastTime = 1_s;
         break;
     case ScrollByPixel:
-        animationTime = 11 * tickTime;
-        repeatMinimumSustainTime = 2 * tickTime;
-        attackTime = 3 * tickTime;
-        releaseTime = 3 * tickTime;
+        animationTime = tickTime * 11;
+        repeatMinimumSustainTime = tickTime * 2;
+        attackTime = tickTime * 3;
+        releaseTime = tickTime * 3;
         coastTimeCurve = ScrollAnimationSmooth::Curve::Quadratic;
-        maximumCoastTime = 1.25;
+        maximumCoastTime = 1250_ms;
         break;
     default:
         ASSERT_NOT_REACHED();
@@ -270,7 +270,7 @@ bool ScrollAnimationSmooth::updatePerAxisData(PerAxisData& data, ScrollGranulari
 {
     if (!data.startTime || !delta || (delta < 0) != (data.desiredPosition - data.currentPosition < 0)) {
         data.desiredPosition = data.currentPosition;
-        data.startTime = 0;
+        data.startTime = { };
     }
     float newPosition = data.desiredPosition + delta;
 
@@ -279,7 +279,7 @@ bool ScrollAnimationSmooth::updatePerAxisData(PerAxisData& data, ScrollGranulari
     if (newPosition == data.desiredPosition)
         return false;
 
-    double animationTime, repeatMinimumSustainTime, attackTime, releaseTime, maximumCoastTime;
+    Seconds animationTime, repeatMinimumSustainTime, attackTime, releaseTime, maximumCoastTime;
     Curve coastTimeCurve;
     getAnimationParametersForGranularity(granularity, animationTime, repeatMinimumSustainTime, attackTime, releaseTime, coastTimeCurve, maximumCoastTime);
 
@@ -298,7 +298,7 @@ bool ScrollAnimationSmooth::updatePerAxisData(PerAxisData& data, ScrollGranulari
 
     if (!data.startTime) {
         // FIXME: This should be the time from the event that got us here.
-        data.startTime = monotonicallyIncreasingTime() - tickTime / 2;
+        data.startTime = MonotonicTime::now() - tickTime / 2.;
         data.startPosition = data.currentPosition;
         data.lastAnimationTime = data.startTime;
     }
@@ -306,10 +306,10 @@ bool ScrollAnimationSmooth::updatePerAxisData(PerAxisData& data, ScrollGranulari
 
     double remainingDelta = data.desiredPosition - data.currentPosition;
     double attackAreaLeft = 0;
-    double deltaTime = data.lastAnimationTime - data.startTime;
-    double attackTimeLeft = std::max(0., data.attackTime - deltaTime);
-    double timeLeft = data.animationTime - deltaTime;
-    double minTimeLeft = data.releaseTime + std::min(repeatMinimumSustainTime, data.animationTime - data.releaseTime - attackTimeLeft);
+    Seconds deltaTime = data.lastAnimationTime - data.startTime;
+    Seconds attackTimeLeft = std::max(0_s, data.attackTime - deltaTime);
+    Seconds timeLeft = data.animationTime - deltaTime;
+    Seconds minTimeLeft = data.releaseTime + std::min(repeatMinimumSustainTime, data.animationTime - data.releaseTime - attackTimeLeft);
     if (timeLeft < minTimeLeft) {
         data.animationTime = deltaTime + minTimeLeft;
         timeLeft = minTimeLeft;
@@ -321,14 +321,14 @@ bool ScrollAnimationSmooth::updatePerAxisData(PerAxisData& data, ScrollGranulari
         double minCoastDelta = data.visibleLength;
 
         if (fabs(remainingDelta) > minCoastDelta) {
-            double maxCoastDelta = maximumCoastTime * targetMaxCoastVelocity;
+            double maxCoastDelta = maximumCoastTime.value() * targetMaxCoastVelocity;
             double coastFactor = std::min(1., (fabs(remainingDelta) - minCoastDelta) / (maxCoastDelta - minCoastDelta));
 
             // We could play with the curve here - linear seems a little soft. Initial testing makes me want to feed into the sustain time more aggressively.
-            double coastMinTimeLeft = std::min(maximumCoastTime, minTimeLeft + coastCurve(coastTimeCurve, coastFactor) * (maximumCoastTime - minTimeLeft));
+            Seconds coastMinTimeLeft = std::min(maximumCoastTime, minTimeLeft + (maximumCoastTime - minTimeLeft) * coastCurve(coastTimeCurve, coastFactor));
 
-            if (double additionalTime = std::max(0., coastMinTimeLeft - minTimeLeft)) {
-                double additionalReleaseTime = std::min(additionalTime, releaseTime / (releaseTime + repeatMinimumSustainTime) * additionalTime);
+            if (Seconds additionalTime = std::max(0_s, coastMinTimeLeft - minTimeLeft)) {
+                Seconds additionalReleaseTime = std::min(additionalTime, additionalTime * (releaseTime / (releaseTime + repeatMinimumSustainTime)));
                 data.releaseTime = releaseTime + additionalReleaseTime;
                 data.animationTime = deltaTime + coastMinTimeLeft;
                 timeLeft = coastMinTimeLeft;
@@ -336,43 +336,43 @@ bool ScrollAnimationSmooth::updatePerAxisData(PerAxisData& data, ScrollGranulari
         }
     }
 
-    double releaseTimeLeft = std::min(timeLeft, data.releaseTime);
-    double sustainTimeLeft = std::max(0., timeLeft - releaseTimeLeft - attackTimeLeft);
+    Seconds releaseTimeLeft = std::min(timeLeft, data.releaseTime);
+    Seconds sustainTimeLeft = std::max(0_s, timeLeft - releaseTimeLeft - attackTimeLeft);
     if (attackTimeLeft) {
         double attackSpot = deltaTime / data.attackTime;
-        attackAreaLeft = attackArea(Curve::Cubic, attackSpot, 1) * data.attackTime;
+        attackAreaLeft = attackArea(Curve::Cubic, attackSpot, 1) * data.attackTime.value();
     }
 
     double releaseSpot = (data.releaseTime - releaseTimeLeft) / data.releaseTime;
-    double releaseAreaLeft = releaseArea(Curve::Cubic, releaseSpot, 1) * data.releaseTime;
+    double releaseAreaLeft = releaseArea(Curve::Cubic, releaseSpot, 1) * data.releaseTime.value();
 
-    data.desiredVelocity = remainingDelta / (attackAreaLeft + sustainTimeLeft + releaseAreaLeft);
+    data.desiredVelocity = remainingDelta / (attackAreaLeft + sustainTimeLeft.value() + releaseAreaLeft);
     data.releasePosition = data.desiredPosition - data.desiredVelocity * releaseAreaLeft;
     if (attackAreaLeft)
         data.attackPosition = data.startPosition + data.desiredVelocity * attackAreaLeft;
     else
-        data.attackPosition = data.releasePosition - (data.animationTime - data.releaseTime - data.attackTime) * data.desiredVelocity;
+        data.attackPosition = data.releasePosition - (data.animationTime - data.releaseTime - data.attackTime).value() * data.desiredVelocity;
 
     if (sustainTimeLeft) {
-        double roundOff = data.releasePosition - ((attackAreaLeft ? data.attackPosition : data.currentPosition) + data.desiredVelocity * sustainTimeLeft);
-        data.desiredVelocity += roundOff / sustainTimeLeft;
+        double roundOff = data.releasePosition - ((attackAreaLeft ? data.attackPosition : data.currentPosition) + data.desiredVelocity * sustainTimeLeft.value());
+        data.desiredVelocity += roundOff / sustainTimeLeft.value();
     }
 
     return true;
 }
 
-bool ScrollAnimationSmooth::animateScroll(PerAxisData& data, double currentTime)
+bool ScrollAnimationSmooth::animateScroll(PerAxisData& data, MonotonicTime currentTime)
 {
     if (!data.startTime)
         return false;
 
-    double lastScrollInterval = currentTime - data.lastAnimationTime;
+    Seconds lastScrollInterval = currentTime - data.lastAnimationTime;
     if (lastScrollInterval < minimumTimerInterval)
         return true;
 
     data.lastAnimationTime = currentTime;
 
-    double deltaTime = currentTime - data.startTime;
+    Seconds deltaTime = currentTime - data.startTime;
     double newPosition = data.currentPosition;
 
     if (deltaTime > data.animationTime) {
@@ -380,18 +380,18 @@ bool ScrollAnimationSmooth::animateScroll(PerAxisData& data, double currentTime)
         return false;
     }
     if (deltaTime < data.attackTime)
-        newPosition = attackCurve(Curve::Cubic, deltaTime, data.attackTime, data.startPosition, data.attackPosition);
+        newPosition = attackCurve(Curve::Cubic, deltaTime.value(), data.attackTime.value(), data.startPosition, data.attackPosition);
     else if (deltaTime < (data.animationTime - data.releaseTime))
-        newPosition = data.attackPosition + (deltaTime - data.attackTime) * data.desiredVelocity;
+        newPosition = data.attackPosition + (deltaTime - data.attackTime).value() * data.desiredVelocity;
     else {
         // release is based on targeting the exact final position.
-        double releaseDeltaT = deltaTime - (data.animationTime - data.releaseTime);
-        newPosition = releaseCurve(Curve::Cubic, releaseDeltaT, data.releaseTime, data.releasePosition, data.desiredPosition);
+        Seconds releaseDeltaT = deltaTime - (data.animationTime - data.releaseTime);
+        newPosition = releaseCurve(Curve::Cubic, releaseDeltaT.value(), data.releaseTime.value(), data.releasePosition, data.desiredPosition);
     }
 
     // Normalize velocity to a per second amount. Could be used to check for jank.
-    if (lastScrollInterval > 0)
-        data.currentVelocity = (newPosition - data.currentPosition) / lastScrollInterval;
+    if (lastScrollInterval > 0_s)
+        data.currentVelocity = (newPosition - data.currentPosition) / lastScrollInterval.value();
     data.currentPosition = newPosition;
 
     return true;
@@ -399,8 +399,8 @@ bool ScrollAnimationSmooth::animateScroll(PerAxisData& data, double currentTime)
 
 void ScrollAnimationSmooth::animationTimerFired()
 {
-    double currentTime = monotonicallyIncreasingTime();
-    double deltaToNextFrame = ceil((currentTime - m_startTime) * frameRate) / frameRate - (currentTime - m_startTime);
+    MonotonicTime currentTime = MonotonicTime::now();
+    Seconds deltaToNextFrame = 1_s * ceil((currentTime - m_startTime).value() * frameRate) / frameRate - (currentTime - m_startTime);
     currentTime += deltaToNextFrame;
 
     bool continueAnimation = false;
@@ -422,7 +422,7 @@ void ScrollAnimationSmooth::animationTimerFired()
 }
 
 #if USE(REQUEST_ANIMATION_FRAME_TIMER)
-void ScrollAnimationSmooth::startNextTimer(double delay)
+void ScrollAnimationSmooth::startNextTimer(Seconds delay)
 {
     m_animationTimer.startOneShot(delay);
 }
index eba9db2..8d6f9c9 100644 (file)
@@ -76,29 +76,29 @@ private:
         double desiredVelocity { 0 };
 
         double startPosition { 0 };
-        double startTime { 0 };
+        MonotonicTime startTime;
         double startVelocity { 0 };
 
-        double animationTime { 0 };
-        double lastAnimationTime { 0 };
+        Seconds animationTime;
+        MonotonicTime lastAnimationTime;
 
         double attackPosition { 0 };
-        double attackTime { 0 };
+        Seconds attackTime;
         Curve attackCurve { Curve::Quadratic };
 
         double releasePosition { 0 };
-        double releaseTime { 0 };
+        Seconds releaseTime;
         Curve releaseCurve { Curve::Quadratic };
 
         int visibleLength { 0 };
     };
 
     bool updatePerAxisData(PerAxisData&, ScrollGranularity, float delta, float minScrollPosition, float maxScrollPosition);
-    bool animateScroll(PerAxisData&, double currentTime);
+    bool animateScroll(PerAxisData&, MonotonicTime currentTime);
 
 #if USE(REQUEST_ANIMATION_FRAME_TIMER)
     void requestAnimationTimerFired();
-    void startNextTimer(double delay);
+    void startNextTimer(Seconds delay);
 #else
     void startNextTimer();
 #endif
@@ -110,7 +110,7 @@ private:
     PerAxisData m_horizontalData;
     PerAxisData m_verticalData;
 
-    double m_startTime { 0 };
+    MonotonicTime m_startTime;
 #if USE(REQUEST_ANIMATION_FRAME_TIMER)
     Timer m_animationTimer;
 #else
index 05174b4..52deba8 100644 (file)
@@ -55,8 +55,6 @@ public:
     WEBCORE_EXPORT void start(Seconds nextFireInterval, Seconds repeatInterval);
 
     void startRepeating(Seconds repeatInterval) { start(repeatInterval, repeatInterval); }
-
-    void startOneShot(double interval) { startOneShot(Seconds { interval }); }
     void startOneShot(Seconds interval) { start(interval, 0_s); }
 
     WEBCORE_EXPORT void stop();
index 569a5b9..02d1099 100644 (file)
@@ -34,7 +34,7 @@
 
 namespace WebCore {
 
-const double kClientDataBufferingTimerThrottleDelay = 0.1;
+static const Seconds clientDataBufferingTimerThrottleDelay { 100_ms };
 
 #if !LOG_DISABLED
 static const char* stateName(PlatformMediaSession::State state)
@@ -260,7 +260,7 @@ void PlatformMediaSession::visibilityChanged()
 void PlatformMediaSession::scheduleClientDataBufferingCheck()
 {
     if (!m_clientDataBufferingTimer.isActive())
-        m_clientDataBufferingTimer.startOneShot(kClientDataBufferingTimerThrottleDelay);
+        m_clientDataBufferingTimer.startOneShot(clientDataBufferingTimerThrottleDelay);
 }
 
 void PlatformMediaSession::clientDataBufferingTimerFired()
index 1e8f7df..ee3e537 100644 (file)
@@ -490,7 +490,7 @@ void ScrollController::scheduleStatelessScrollSnap()
         return;
 
     static const Seconds statelessScrollSnapDelay = 750_ms;
-    m_statelessSnapTransitionTimer.startOneShot(statelessScrollSnapDelay.value());
+    m_statelessSnapTransitionTimer.startOneShot(statelessScrollSnapDelay);
     startDeferringTestsDueToScrollSnapping();
 }
 
index 515f3e4..10e7745 100644 (file)
@@ -40,7 +40,7 @@ SOFT_LINK_CONSTANT_MAY_FAIL(GameController, GCControllerDidDisconnectNotificatio
 
 namespace WebCore {
 
-static const std::chrono::milliseconds InputNotificationDelay = 16ms;
+static const Seconds inputNotificationDelay { 16_ms };
 
 GameControllerGamepadProvider& GameControllerGamepadProvider::singleton()
 {
@@ -144,7 +144,7 @@ unsigned GameControllerGamepadProvider::indexForNewlyConnectedDevice()
 void GameControllerGamepadProvider::gamepadHadInput(GameControllerGamepad&, bool hadButtonPresses)
 {
     if (!m_inputNotificationTimer.isActive())
-        m_inputNotificationTimer.startOneShot(InputNotificationDelay);
+        m_inputNotificationTimer.startOneShot(inputNotificationDelay);
 
     if (hadButtonPresses)
         m_shouldMakeInvisibileGamepadsVisible = true;
index 002664c..2e22992 100644 (file)
@@ -34,8 +34,8 @@
 
 namespace WebCore {
 
-static const double ConnectionDelayInterval = 0.5;
-static const double InputNotificationDelay = 0.05;
+static const Seconds connectionDelayInterval { 500_ms };
+static const Seconds inputNotificationDelay { 50_ms };
 
 static RetainPtr<CFDictionaryRef> deviceMatchingDictionary(uint32_t usagePage, uint32_t usage)
 {
@@ -142,9 +142,9 @@ void HIDGamepadProvider::openAndScheduleManager()
     IOHIDManagerScheduleWithRunLoop(m_manager.get(), CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
     IOHIDManagerOpen(m_manager.get(), kIOHIDOptionsTypeNone);
 
-    // Any connections we are notified of within the ConnectionDelayInterval of listening likely represent
+    // Any connections we are notified of within the connectionDelayInterval of listening likely represent
     // devices that were already connected, so we suppress notifying clients of these.
-    m_connectionDelayTimer.startOneShot(ConnectionDelayInterval);
+    m_connectionDelayTimer.startOneShot(connectionDelayInterval);
 }
 
 void HIDGamepadProvider::closeAndUnscheduleManager()
@@ -243,7 +243,7 @@ void HIDGamepadProvider::valuesChanged(IOHIDValueRef value)
     // This isActive check is necessary as we want to delay input notifications from the time of the first input,
     // and not push the notification out on every subsequent input.
     if (!m_inputNotificationTimer.isActive())
-        m_inputNotificationTimer.startOneShot(InputNotificationDelay);
+        m_inputNotificationTimer.startOneShot(inputNotificationDelay);
 }
 
 void HIDGamepadProvider::inputNotificationTimerFired()
index 4afe29d..2147740 100644 (file)
@@ -41,7 +41,7 @@ MainThreadSharedTimer::MainThreadSharedTimer()
 void MainThreadSharedTimer::setFireInterval(Seconds interval)
 {
     ASSERT(m_firedFunction);
-    m_timer.startOneShot(interval.value());
+    m_timer.startOneShot(interval);
 }
 
 void MainThreadSharedTimer::stop()
index c23b9dd..1b949cd 100644 (file)
@@ -286,7 +286,7 @@ void BitmapImage::clearTimer()
     m_frameTimer = nullptr;
 }
 
-void BitmapImage::startTimer(double delay)
+void BitmapImage::startTimer(Seconds delay)
 {
     ASSERT(!m_frameTimer);
     m_frameTimer = std::make_unique<Timer>(*this, &BitmapImage::advanceAnimation);
@@ -332,14 +332,14 @@ BitmapImage::StartAnimationStatus BitmapImage::internalStartAnimation()
     if (!m_source.isAllDataReceived() && !frameIsCompleteAtIndex(nextFrame))
         return StartAnimationStatus::IncompleteData;
 
-    double time = monotonicallyIncreasingTime();
+    MonotonicTime time = MonotonicTime::now();
 
     // Handle initial state.
     if (!m_desiredFrameStartTime)
         m_desiredFrameStartTime = time;
 
     // Setting 'm_desiredFrameStartTime' to 'time' means we are late; otherwise we are early.
-    m_desiredFrameStartTime = std::max(time, m_desiredFrameStartTime + frameDurationAtIndex(m_currentFrame));
+    m_desiredFrameStartTime = std::max(time, m_desiredFrameStartTime + Seconds { frameDurationAtIndex(m_currentFrame) });
 
     // Request async decoding for nextFrame only if this is required. If nextFrame is not in the frameCache,
     // it will be decoded on a separate work queue. When decoding nextFrame finishes, we will be notified
@@ -357,7 +357,7 @@ BitmapImage::StartAnimationStatus BitmapImage::internalStartAnimation()
         UNUSED_PARAM(isAsyncDecode);
 #endif
 
-        m_desiredFrameDecodeTimeForTesting = time + std::max(m_frameDecodingDurationForTesting, 0.0f);
+        m_desiredFrameDecodeTimeForTesting = time + std::max(m_frameDecodingDurationForTesting, 0_s);
         if (m_clearDecoderAfterAsyncFrameRequestForTesting)
             m_source.clear(data());
     }
@@ -374,7 +374,7 @@ void BitmapImage::advanceAnimation()
     // Pretend as if decoding nextFrame has taken m_frameDecodingDurationForTesting from
     // the time this decoding was requested.
     if (shouldUseAsyncDecodingForAnimatedImagesForTesting()) {
-        double time = monotonicallyIncreasingTime();
+        MonotonicTime time = MonotonicTime::now();
         // Start a timer with the remaining time from now till the m_desiredFrameDecodeTime.
         if (m_desiredFrameDecodeTimeForTesting > std::max(time, m_desiredFrameStartTime)) {
             startTimer(m_desiredFrameDecodeTimeForTesting - time);
@@ -426,7 +426,7 @@ void BitmapImage::resetAnimation()
     stopAnimation();
     m_currentFrame = 0;
     m_repetitionsComplete = RepetitionCountNone;
-    m_desiredFrameStartTime = 0;
+    m_desiredFrameStartTime = { };
     m_animationFinished = false;
 
     // For extremely large animations, when the animation is reset, we just throw everything away.
index 422d6c9..8ea24d6 100644 (file)
@@ -97,8 +97,8 @@ public:
     bool currentFrameKnownToBeOpaque() const override { return !frameHasAlphaAtIndex(currentFrame()); }
     ImageOrientation orientationForCurrentFrame() const override { return frameOrientationAtIndex(currentFrame()); }
 
-    bool shouldUseAsyncDecodingForAnimatedImagesForTesting() const { return m_frameDecodingDurationForTesting > 0; }
-    void setFrameDecodingDurationForTesting(float duration) { m_frameDecodingDurationForTesting = duration; }
+    bool shouldUseAsyncDecodingForAnimatedImagesForTesting() const { return m_frameDecodingDurationForTesting > 0_s; }
+    void setFrameDecodingDurationForTesting(Seconds duration) { m_frameDecodingDurationForTesting = duration; }
     bool shouldUseAsyncDecodingForLargeImages();
     bool shouldUseAsyncDecodingForAnimatedImages();
     void setClearDecoderAfterAsyncFrameRequestForTesting(bool value) { m_clearDecoderAfterAsyncFrameRequestForTesting = value; }
@@ -190,7 +190,7 @@ protected:
 
 private:
     void clearTimer();
-    void startTimer(double delay);
+    void startTimer(Seconds delay);
     bool isBitmapImage() const override { return true; }
     void dump(TextStream&) const override;
 
@@ -207,11 +207,11 @@ private:
     SubsamplingLevel m_currentSubsamplingLevel { SubsamplingLevel::Default };
     std::unique_ptr<Timer> m_frameTimer;
     RepetitionCount m_repetitionsComplete { RepetitionCountNone }; // How many repetitions we've finished.
-    double m_desiredFrameStartTime { 0 }; // The system time at which we hope to see the next call to startAnimation().
+    MonotonicTime m_desiredFrameStartTime; // The system time at which we hope to see the next call to startAnimation().
     bool m_animationFinished { false };
 
-    float m_frameDecodingDurationForTesting { 0 };
-    double m_desiredFrameDecodeTimeForTesting { 0 };
+    Seconds m_frameDecodingDurationForTesting;
+    MonotonicTime m_desiredFrameDecodeTimeForTesting;
     bool m_clearDecoderAfterAsyncFrameRequestForTesting { false };
 #if !LOG_DISABLED
     size_t m_lateFrameCount { 0 };
index 4931686..f5013f4 100644 (file)
@@ -33,7 +33,7 @@
 
 namespace WebCore {
 
-static const double pendingActionInterval = 1.0 / 10.0;
+static const Seconds pendingActionInterval { 100_ms };
 
 MediaPlaybackTargetPicker::MediaPlaybackTargetPicker(Client& client)
     : m_client(&client)
index f17b3ff..87f45e4 100644 (file)
@@ -124,7 +124,7 @@ public:
         if (m_purgeTimer.isActive())
             m_purgeTimer.stop();
 
-        const double scratchBufferPurgeInterval = 2;
+        const Seconds scratchBufferPurgeInterval { 2_s };
         m_purgeTimer.startOneShot(scratchBufferPurgeInterval);
     }
     
index 0cf7f77..0cc4fac 100644 (file)
@@ -110,7 +110,7 @@ void LayerPool::schedulePrune()
 {
     if (m_pruneTimer.isActive())
         return;
-    m_pruneTimer.startOneShot(1);
+    m_pruneTimer.startOneShot(1_s);
 }
 
 void LayerPool::pruneTimerFired()
index 0466f77..9d2acd4 100644 (file)
@@ -370,7 +370,7 @@ bool MediaPlayerPrivateGStreamer::changePipelineState(GstState newState)
     if (newState == GST_STATE_READY && !m_readyTimerHandler.isActive()) {
         // Max interval in seconds to stay in the READY state on manual
         // state change requests.
-        static const double readyStateTimerDelay = 60;
+        static const Seconds readyStateTimerDelay { 1_min };
         m_readyTimerHandler.startOneShot(readyStateTimerDelay);
     } else if (newState != GST_STATE_READY)
         m_readyTimerHandler.stop();
index 56be06f..1c4e435 100644 (file)
@@ -278,8 +278,8 @@ void GraphicsContext3DManager::updateHighPerformanceState()
             LOG(WebGL, "Set a timer to turn off high-performance GPU.");
             // FIXME: Expose this value as a Setting, which would require this class
             // to reference a frame, page or document.
-            static const int timeToKeepHighPerformanceGPUAliveInSeconds = 10;
-            m_disableHighPerformanceGPUTimer.startOneShot(timeToKeepHighPerformanceGPUAliveInSeconds);
+            static const Seconds timeToKeepHighPerformanceGPUAlive { 10_s };
+            m_disableHighPerformanceGPUTimer.startOneShot(timeToKeepHighPerformanceGPUAlive);
         }
     }
 #endif
index 00cc8ee..8e35fef 100644 (file)
@@ -33,8 +33,8 @@
 
 namespace WebCore {
 
-static const double s_releaseUnusedSecondsTolerance = 3;
-static const double s_releaseUnusedTexturesTimerInterval = 0.5;
+static const double releaseUnusedSecondsTolerance = 3;
+static const Seconds releaseUnusedTexturesTimerInterval { 500_ms };
 
 #if USE(TEXTURE_MAPPER_GL)
 BitmapTexturePool::BitmapTexturePool(RefPtr<GraphicsContext3D>&& context3D)
@@ -66,13 +66,13 @@ void BitmapTexturePool::scheduleReleaseUnusedTextures()
     if (m_releaseUnusedTexturesTimer.isActive())
         return;
 
-    m_releaseUnusedTexturesTimer.startOneShot(s_releaseUnusedTexturesTimerInterval);
+    m_releaseUnusedTexturesTimer.startOneShot(releaseUnusedTexturesTimerInterval);
 }
 
 void BitmapTexturePool::releaseUnusedTexturesTimerFired()
 {
-    // Delete entries, which have been unused in s_releaseUnusedSecondsTolerance.
-    double minUsedTime = monotonicallyIncreasingTime() - s_releaseUnusedSecondsTolerance;
+    // Delete entries, which have been unused in releaseUnusedSecondsTolerance.
+    double minUsedTime = monotonicallyIncreasingTime() - releaseUnusedSecondsTolerance;
 
     if (!m_textures.isEmpty()) {
         std::sort(m_textures.begin(), m_textures.end(),
index 4db7482..dc3e747 100644 (file)
@@ -37,8 +37,8 @@
 #include <wtf/glib/RunLoopSourcePriority.h>
 #endif
 
-const double s_releaseUnusedSecondsTolerance = 1;
-const double s_releaseUnusedBuffersTimerInterval = 0.5;
+static const double releaseUnusedSecondsTolerance = 1;
+static const Seconds releaseUnusedBuffersTimerInterval = { 500_ms };
 
 namespace WebCore {
 
@@ -144,7 +144,7 @@ std::unique_ptr<TextureMapperPlatformLayerBuffer> TextureMapperPlatformLayerProx
 void TextureMapperPlatformLayerProxy::scheduleReleaseUnusedBuffers()
 {
     if (!m_releaseUnusedBuffersTimer.isActive())
-        m_releaseUnusedBuffersTimer.startOneShot(s_releaseUnusedBuffersTimerInterval);
+        m_releaseUnusedBuffersTimer.startOneShot(releaseUnusedBuffersTimerInterval);
 }
 
 void TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired()
@@ -154,7 +154,7 @@ void TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired()
         return;
 
     auto buffers = WTFMove(m_usedBuffers);
-    double minUsedTime = monotonicallyIncreasingTime() - s_releaseUnusedSecondsTolerance;
+    double minUsedTime = monotonicallyIncreasingTime() - releaseUnusedSecondsTolerance;
 
     for (auto& buffer : buffers) {
         if (buffer && buffer->lastUsedTime() >= minUsedTime)
index 3f5673e..f529475 100644 (file)
@@ -144,7 +144,7 @@ void CoordinatedImageBacking::releaseSurfaceIfNeeded()
     m_surface = nullptr;
 }
 
-static const double clearContentsTimerInterval = 3;
+static const Seconds clearContentsTimerInterval { 3_s };
 
 void CoordinatedImageBacking::updateVisibilityIfNeeded(bool& changedToVisible)
 {
index 44e4734..1b95481 100644 (file)
@@ -38,8 +38,8 @@
 
 namespace WebCore {
 
-static const double overflowScrollbarsAnimationDuration = 1;
-static const double overflowScrollbarsAnimationHideDelay = 2;
+static const Seconds overflowScrollbarsAnimationDuration { 1_s };
+static const Seconds overflowScrollbarsAnimationHideDelay { 2_s };
 
 std::unique_ptr<ScrollAnimator> ScrollAnimator::create(ScrollableArea& scrollableArea)
 {
@@ -176,10 +176,10 @@ void ScrollAnimatorGtk::overlayScrollbarAnimationTimerFired()
     if (m_overlayScrollbarsLocked)
         return;
 
-    double currentTime = monotonicallyIncreasingTime();
+    MonotonicTime currentTime = MonotonicTime::now();
     double progress = 1;
     if (currentTime < m_overlayScrollbarAnimationEndTime)
-        progress = (currentTime - m_overlayScrollbarAnimationStartTime) / (m_overlayScrollbarAnimationEndTime - m_overlayScrollbarAnimationStartTime);
+        progress = (currentTime - m_overlayScrollbarAnimationStartTime).value() / (m_overlayScrollbarAnimationEndTime - m_overlayScrollbarAnimationStartTime).value();
     progress = m_overlayScrollbarAnimationSource + (easeOutCubic(progress) * (m_overlayScrollbarAnimationTarget - m_overlayScrollbarAnimationSource));
     if (progress != m_overlayScrollbarAnimationCurrent) {
         m_overlayScrollbarAnimationCurrent = progress;
@@ -188,9 +188,9 @@ void ScrollAnimatorGtk::overlayScrollbarAnimationTimerFired()
 
     if (m_overlayScrollbarAnimationCurrent != m_overlayScrollbarAnimationTarget) {
         static const double frameRate = 60;
-        static const double tickTime = 1 / frameRate;
-        static const double minimumTimerInterval = .001;
-        double deltaToNextFrame = std::max(tickTime - (monotonicallyIncreasingTime() - currentTime), minimumTimerInterval);
+        static const Seconds tickTime = 1_s / frameRate;
+        static const Seconds minimumTimerInterval = 1_ms;
+        Seconds deltaToNextFrame = std::max(tickTime - (MonotonicTime::now() - currentTime), minimumTimerInterval);
         m_overlayScrollbarAnimationTimer.startOneShot(deltaToNextFrame);
     } else
         hideOverlayScrollbars();
@@ -211,7 +211,7 @@ void ScrollAnimatorGtk::showOverlayScrollbars()
     m_overlayScrollbarAnimationSource = m_overlayScrollbarAnimationCurrent;
     m_overlayScrollbarAnimationTarget = 1;
     if (m_overlayScrollbarAnimationTarget != m_overlayScrollbarAnimationCurrent) {
-        m_overlayScrollbarAnimationStartTime = monotonicallyIncreasingTime();
+        m_overlayScrollbarAnimationStartTime = MonotonicTime::now();
         m_overlayScrollbarAnimationEndTime = m_overlayScrollbarAnimationStartTime + overflowScrollbarsAnimationDuration;
         m_overlayScrollbarAnimationTimer.startOneShot(0_s);
     } else
@@ -231,7 +231,7 @@ void ScrollAnimatorGtk::hideOverlayScrollbars()
     m_overlayScrollbarAnimationTarget = 0;
     if (m_overlayScrollbarAnimationTarget == m_overlayScrollbarAnimationCurrent)
         return;
-    m_overlayScrollbarAnimationStartTime = monotonicallyIncreasingTime() + overflowScrollbarsAnimationHideDelay;
+    m_overlayScrollbarAnimationStartTime = MonotonicTime::now() + overflowScrollbarsAnimationHideDelay;
     m_overlayScrollbarAnimationEndTime = m_overlayScrollbarAnimationStartTime + overflowScrollbarsAnimationDuration + overflowScrollbarsAnimationHideDelay;
     m_overlayScrollbarAnimationTimer.startOneShot(overflowScrollbarsAnimationHideDelay);
 }
index 70e5b73..c4253e5 100644 (file)
@@ -80,8 +80,8 @@ private:
     double m_overlayScrollbarAnimationSource { 0 };
     double m_overlayScrollbarAnimationTarget { 0 };
     double m_overlayScrollbarAnimationCurrent { 0 };
-    double m_overlayScrollbarAnimationStartTime { 0 };
-    double m_overlayScrollbarAnimationEndTime { 0 };
+    MonotonicTime m_overlayScrollbarAnimationStartTime;
+    MonotonicTime m_overlayScrollbarAnimationEndTime;
 };
 
 } // namespace WebCore
index f3fc2ae..3db3c02 100644 (file)
@@ -82,7 +82,7 @@ static const char* boolString(bool val)
 }
 #endif
 
-static const double DefaultWatchdogTimerInterval = 1;
+static const Seconds defaultWatchdogTimerInterval { 1_s };
 
 @class WebAVMediaSelectionOption;
 
@@ -986,7 +986,7 @@ bool WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason(WebVideoFu
     m_videoFullscreenModel->requestFullscreenMode(HTMLMediaElementEnums::VideoFullscreenModeNone, reason == ExitFullScreenReason::DoneButtonTapped);
 
     if (!m_watchdogTimer.isActive())
-        m_watchdogTimer.startOneShot(DefaultWatchdogTimerInterval);
+        m_watchdogTimer.startOneShot(defaultWatchdogTimerInterval);
 
     return false;
 }
index 9624d05..0da349b 100644 (file)
@@ -1338,7 +1338,7 @@ void ScrollAnimatorMac::updateScrollerStyle()
 
 void ScrollAnimatorMac::startScrollbarPaintTimer()
 {
-    m_initialScrollbarPaintTimer.startOneShot(0.1);
+    m_initialScrollbarPaintTimer.startOneShot(100_ms);
 }
 
 bool ScrollAnimatorMac::scrollbarPaintTimerIsActive() const
index 1a60ca2..5aaa84d 100644 (file)
@@ -37,7 +37,7 @@ using namespace WebCore;
 
 namespace WebCore {
 
-static const double timerInterval = 1.0 / 10.0;
+static const Seconds timerInterval { 100_ms };
 
 MediaPlaybackTargetPickerMock::MediaPlaybackTargetPickerMock(MediaPlaybackTargetPicker::Client& client)
     : MediaPlaybackTargetPicker(client)
index f3bc71c..67f97dd 100644 (file)
@@ -68,7 +68,7 @@ void PlatformSpeechSynthesizerMock::speak(RefPtr<PlatformSpeechSynthesisUtteranc
     client()->boundaryEventOccurred(*m_utterance, SpeechSentenceBoundary, m_utterance->text().length());
 
     // Give the fake speech job some time so that pause and other functions have time to be called.
-    m_speakingFinishedTimer.startOneShot(.1);
+    m_speakingFinishedTimer.startOneShot(100_ms);
 }
 
 void PlatformSpeechSynthesizerMock::cancel()
index de0e8a9..ddcd275 100644 (file)
@@ -63,7 +63,7 @@ public:
         , m_timer(*this, &TimerEvent::timerFired)
         , m_notifier(notifier)
     {
-        m_timer.startOneShot(0.5);
+        m_timer.startOneShot(500_ms);
     }
 
     virtual ~TimerEvent()
index 58773aa..a8c2df4 100644 (file)
@@ -37,7 +37,7 @@ namespace WebCore {
 static const int gNamesToResolveImmediately = 4;
 
 // Coalesce prefetch requests for this long before sending them out.
-static const double gCoalesceDelayInSeconds = 1.0;
+static const Seconds coalesceDelay { 1_s };
 
 // Sending many DNS requests at once can overwhelm some gateways. See <rdar://8105550> for specific CFNET issues with CFHost throttling.
 static const int gMaxSimultaneousRequests = 8;
@@ -48,7 +48,7 @@ static const int gMaxSimultaneousRequests = 8;
 static const int gMaxRequestsToQueue = 64;
 
 // If there were queued names that couldn't be sent simultaneously, check the state of resolvers after this delay.
-static const double gRetryResolvingInSeconds = 0.1;
+static const Seconds resolvingRetryDelay { 100_ms };
 
 DNSResolveQueue& DNSResolveQueue::singleton()
 {
@@ -101,7 +101,7 @@ void DNSResolveQueue::add(const String& hostname)
     if (m_names.size() < gMaxRequestsToQueue) {
         m_names.add(hostname);
         if (!m_timer.isActive())
-            m_timer.startOneShot(gCoalesceDelayInSeconds);
+            m_timer.startOneShot(coalesceDelay);
     }
 }
 
@@ -122,7 +122,7 @@ void DNSResolveQueue::timerFired()
     }
 
     if (!m_names.isEmpty())
-        m_timer.startOneShot(gRetryResolvingInSeconds);
+        m_timer.startOneShot(resolvingRetryDelay);
 }
 
 } // namespace WebCore
index 17c54e0..cbafc09 100644 (file)
@@ -53,7 +53,7 @@ public:
 
         // If the server never responds, this object will hang around forever.
         // Set a very generous timeout, just in case.
-        m_timeoutTimer.startOneShot(60000);
+        m_timeoutTimer.startOneShot(60000_s);
     }
 
 private:
index afba55f..cacfbb5 100644 (file)
@@ -83,7 +83,7 @@
 namespace WebCore {
 
 const int selectTimeoutMS = 5;
-const double pollTimeSeconds = 0.05;
+static const Seconds pollTime { 50_ms };
 const int maxRunningJobs = 128;
 const char* const errorDomainCurl = "CurlErrorDomain";
 
@@ -727,7 +727,7 @@ void ResourceHandleManager::downloadTimerCallback()
     bool started = startScheduledJobs(); // new jobs might have been added in the meantime
 
     if (!m_downloadTimer.isActive() && (started || (runningHandles > 0)))
-        m_downloadTimer.startOneShot(pollTimeSeconds);
+        m_downloadTimer.startOneShot(pollTime);
 }
 
 void ResourceHandleManager::setProxyInfo(const String& host,
@@ -877,7 +877,7 @@ void ResourceHandleManager::add(ResourceHandle* job)
     job->ref();
     m_resourceHandleList.append(job);
     if (!m_downloadTimer.isActive())
-        m_downloadTimer.startOneShot(pollTimeSeconds);
+        m_downloadTimer.startOneShot(pollTime);
 }
 
 bool ResourceHandleManager::removeScheduledJob(ResourceHandle* job)
@@ -1238,7 +1238,7 @@ void ResourceHandleManager::cancel(ResourceHandle* job)
     ResourceHandleInternal* d = job->getInternal();
     d->m_cancelled = true;
     if (!m_downloadTimer.isActive())
-        m_downloadTimer.startOneShot(pollTimeSeconds);
+        m_downloadTimer.startOneShot(pollTime);
 }
 
 } // namespace WebCore
index 55ade21..912f67b 100644 (file)
@@ -31,7 +31,7 @@
 
 namespace WebCore {
 
-static const double StateChangeTimerInterval = 2.0;
+static const Seconds StateChangeTimerInterval { 2_s };
 
 void NetworkStateNotifier::updateState()
 {
index 139e09d..9d6d5c4 100644 (file)
@@ -771,7 +771,7 @@ void ResourceHandle::sendPendingRequest()
 #endif
 
     if (d->m_firstRequest.timeoutInterval() > 0)
-        d->m_timeoutSource.startOneShot(d->m_firstRequest.timeoutInterval());
+        d->m_timeoutSource.startOneShot(1_s * d->m_firstRequest.timeoutInterval());
 
     // Balanced by a deref() in cleanupSoupRequestOperation, which should always run.
     ref();
index 1bc82e9..75415d0 100644 (file)
@@ -35,7 +35,7 @@
 namespace WebCore {
 
 static const double cInterpolationCutoff = 800. * 800.;
-static const double cLowQualityTimeThreshold = 0.500; // 500 ms
+static const Seconds lowQualityTimeThreshold { 500_ms };
 
 ImageQualityController::ImageQualityController(const RenderView& renderView)
     : m_renderView(renderView)
@@ -94,7 +94,7 @@ void ImageQualityController::highQualityRepaintTimerFired()
 
 void ImageQualityController::restartTimer()
 {
-    m_timer.startOneShot(cLowQualityTimeThreshold);
+    m_timer.startOneShot(lowQualityTimeThreshold);
 }
 
 std::optional<InterpolationQuality> ImageQualityController::interpolationQualityFromStyle(const RenderStyle& style)
index eac42e2..1a838d8 100644 (file)
@@ -92,11 +92,11 @@ static const int canvasAreaThresholdRequiringCompositing = 50 * 100;
 #endif
 // During page loading delay layer flushes up to this many seconds to allow them coalesce, reducing workload.
 #if PLATFORM(IOS)
-static const double throttledLayerFlushInitialDelay = .5;
-static const double throttledLayerFlushDelay = 1.5;
+static const Seconds throttledLayerFlushInitialDelay { 500_ms };
+static const Seconds throttledLayerFlushDelay { 1.5_s };
 #else
-static const double throttledLayerFlushInitialDelay = .5;
-static const double throttledLayerFlushDelay = .5;
+static const Seconds throttledLayerFlushInitialDelay { 500_ms };
+static const Seconds throttledLayerFlushDelay { 500_ms };
 #endif
 
 using namespace HTMLNames;
index 3b14e40..56a45c7 100644 (file)
@@ -32,7 +32,6 @@ RenderProgress::RenderProgress(HTMLElement& element, RenderStyle&& style)
     : RenderBlockFlow(element, WTFMove(style))
     , m_position(HTMLProgressElement::InvalidPosition)
     , m_animationStartTime(0)
-    , m_animationRepeatInterval(0)
     , m_animationDuration(0)
     , m_animating(false)
     , m_animationTimer(*this, &RenderProgress::animationTimerFired)
index 3a6d84d..2964ec5 100644 (file)
@@ -50,7 +50,7 @@ private:
 
     double m_position;
     double m_animationStartTime;
-    double m_animationRepeatInterval;
+    Seconds m_animationRepeatInterval;
     double m_animationDuration;
     bool m_animating;
     Timer m_animationTimer;
index 2c88ac5..2a522dc 100644 (file)
@@ -107,7 +107,7 @@ inline SecureTextTimer::SecureTextTimer(RenderText& renderer)
 inline void SecureTextTimer::restart(unsigned offsetAfterLastTypedCharacter)
 {
     m_offsetAfterLastTypedCharacter = offsetAfterLastTypedCharacter;
-    startOneShot(m_renderer.settings().passwordEchoDurationInSeconds());
+    startOneShot(1_s * m_renderer.settings().passwordEchoDurationInSeconds());
 }
 
 inline unsigned SecureTextTimer::takeOffsetAfterLastTypedCharacter()
index c31a9aa..db4d808 100644 (file)
@@ -1062,9 +1062,9 @@ void RenderTheme::paintSliderTicks(const RenderObject& o, const PaintInfo& paint
 }
 #endif
 
-double RenderTheme::animationRepeatIntervalForProgressBar(RenderProgress&) const
+Seconds RenderTheme::animationRepeatIntervalForProgressBar(RenderProgress&) const
 {
-    return 0;
+    return 0_s;
 }
 
 double RenderTheme::animationDurationForProgressBar(RenderProgress&) const
index 71d165a..617cadb 100644 (file)
@@ -195,7 +195,7 @@ public:
     virtual ScrollbarControlSize scrollbarControlSizeForPart(ControlPart) { return RegularScrollbar; }
 
     // Returns the repeat interval of the animation for the progress bar.
-    virtual double animationRepeatIntervalForProgressBar(RenderProgress&) const;
+    virtual Seconds animationRepeatIntervalForProgressBar(RenderProgress&) const;
     // Returns the duration of the animation for the progress bar.
     virtual double animationDurationForProgressBar(RenderProgress&) const;
     virtual IntRect progressBarRectForBounds(const RenderObject&, const IntRect&) const;
@@ -208,7 +208,7 @@ public:
     virtual bool usesMediaControlVolumeSlider() const { return true; }
     virtual bool usesVerticalVolumeSlider() const { return true; }
     virtual double mediaControlsFadeInDuration() { return 0.1; }
-    virtual double mediaControlsFadeOutDuration() { return 0.3; }
+    virtual Seconds mediaControlsFadeOutDuration() { return 300_ms; }
     virtual String formatMediaControlsTime(float time) const;
     virtual String formatMediaControlsCurrentTime(float currentTime, float duration) const;
     virtual String formatMediaControlsRemainingTime(float currentTime, float duration) const;
index 17284f4..ba4c6d2 100644 (file)
@@ -2111,15 +2111,15 @@ void RenderThemeGtk::adjustProgressBarStyle(StyleResolver&, RenderStyle& style,
 // These values have been copied from RenderThemeChromiumSkia.cpp
 static const int progressActivityBlocks = 5;
 static const int progressAnimationFrames = 10;
-static const double progressAnimationInterval = 0.125;
-double RenderThemeGtk::animationRepeatIntervalForProgressBar(RenderProgress&) const
+static const Seconds progressAnimationInterval { 125_ms };
+Seconds RenderThemeGtk::animationRepeatIntervalForProgressBar(RenderProgress&) const
 {
     return progressAnimationInterval;
 }
 
 double RenderThemeGtk::animationDurationForProgressBar(RenderProgress&) const
 {
-    return progressAnimationInterval * progressAnimationFrames * 2; // "2" for back and forth;
+    return progressAnimationInterval.value() * progressAnimationFrames * 2; // "2" for back and forth;
 }
 
 IntRect RenderThemeGtk::calculateProgressRect(const RenderObject& renderObject, const IntRect& fullBarRect)
index 7b82d93..64a4d89 100644 (file)
@@ -168,7 +168,7 @@ private:
 #endif
 #endif
 
-    double animationRepeatIntervalForProgressBar(RenderProgress&) const override;
+    Seconds animationRepeatIntervalForProgressBar(RenderProgress&) const override;
     double animationDurationForProgressBar(RenderProgress&) const override;
     void adjustProgressBarStyle(StyleResolver&, RenderStyle&, const Element*) const override;
     IntRect progressBarRectForBounds(const RenderObject&, const IntRect&) const override;
index bb398f7..0b1e545 100644 (file)
@@ -81,7 +81,7 @@ protected:
     bool paintSliderThumbDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
 
     // Returns the repeat interval of the animation for the progress bar.
-    double animationRepeatIntervalForProgressBar(RenderProgress&) const override;
+    Seconds animationRepeatIntervalForProgressBar(RenderProgress&) const override;
     // Returns the duration of the animation for the progress bar.
     double animationDurationForProgressBar(RenderProgress&) const override;
 
index 2013195..d9f4f77 100644 (file)
@@ -870,9 +870,9 @@ bool RenderThemeIOS::paintSliderThumbDecorations(const RenderObject& box, const
     return false;
 }
 
-double RenderThemeIOS::animationRepeatIntervalForProgressBar(RenderProgress&) const
+Seconds RenderThemeIOS::animationRepeatIntervalForProgressBar(RenderProgress&) const
 {
-    return 0;
+    return 0_s;
 }
 
 double RenderThemeIOS::animationDurationForProgressBar(RenderProgress&) const
index 6b9c727..f3900a0 100644 (file)
@@ -87,7 +87,7 @@ public:
 #endif
 
     // Returns the repeat interval of the animation for the progress bar.
-    double animationRepeatIntervalForProgressBar(RenderProgress&) const override;
+    Seconds animationRepeatIntervalForProgressBar(RenderProgress&) const override;
     // Returns the duration of the animation for the progress bar.
     double animationDurationForProgressBar(RenderProgress&) const override;
     IntRect progressBarRectForBounds(const RenderObject&, const IntRect&) const override;
index f80e2c9..9b55ef6 100644 (file)
 
 // We estimate the animation rate of a Mac OS X progress bar is 33 fps.
 // Hard code the value here because we haven't found API for it.
-const double progressAnimationFrameRate = 0.033;
+static const Seconds progressAnimationFrameRate = 33_ms;
 
 // Mac OS X progress bar animation seems to have 256 frames.
-const double progressAnimationNumFrames = 256;
+static const double progressAnimationNumFrames = 256;
 
 @interface WebCoreRenderThemeNotificationObserver : NSObject
 {
@@ -1129,14 +1129,14 @@ int RenderThemeMac::minimumProgressBarHeight(const RenderStyle& style) const
     return sizeForSystemFont(style, progressBarSizes()).height();
 }
 
-double RenderThemeMac::animationRepeatIntervalForProgressBar(RenderProgress&) const
+Seconds RenderThemeMac::animationRepeatIntervalForProgressBar(RenderProgress&) const
 {
     return progressAnimationFrameRate;
 }
 
 double RenderThemeMac::animationDurationForProgressBar(RenderProgress&) const
 {
-    return progressAnimationNumFrames * progressAnimationFrameRate;
+    return progressAnimationNumFrames * progressAnimationFrameRate.value();
 }
 
 void RenderThemeMac::adjustProgressBarStyle(StyleResolver&, RenderStyle&, const Element*) const
index 510293f..9e2786d 100644 (file)
@@ -118,7 +118,7 @@ void EventLoopInputDispatcher::dispatchInputSoon()
     }
 
     LOG(WebReplay, "%-20s (WAIT: %.3f ms)", "ReplayEvents", waitInterval * 1000.0);
-    m_timer.startOneShot(waitInterval);
+    m_timer.startOneShot(1_s * waitInterval);
 }
 
 void EventLoopInputDispatcher::dispatchInput()
index 125b43b..45caf9f 100644 (file)
@@ -35,8 +35,8 @@
 
 namespace WebCore {
 
-static const Seconds SMILAnimationFrameDelay { 1.0 / 60 };
-static const Seconds SMILAnimationFrameThrottledDelay { 1.0 / 30 };
+static const Seconds SMILAnimationFrameDelay { 1_s / 60. };
+static const Seconds SMILAnimationFrameThrottledDelay { 1_s / 30. };
 
 SMILTimeContainer::SMILTimeContainer(SVGSVGElement& owner)
     : m_beginTime(0)
@@ -216,7 +216,7 @@ void SMILTimeContainer::startTimer(SMILTime elapsed, SMILTime fireTime, SMILTime
         return;
 
     SMILTime delay = std::max(fireTime - elapsed, minimumDelay);
-    m_timer.startOneShot(delay.value());
+    m_timer.startOneShot(1_s * delay.value());
 }
 
 void SMILTimeContainer::timerFired()
index e9ea4cb..7acf505 100644 (file)
@@ -570,7 +570,7 @@ ExceptionOr<void> InternalSettings::setTimeWithoutMouseMovementBeforeHidingContr
 {
     if (!m_page)
         return Exception { INVALID_ACCESS_ERR };
-    settings().setTimeWithoutMouseMovementBeforeHidingControls(time);
+    settings().setTimeWithoutMouseMovementBeforeHidingControls(Seconds { time });
     return { };
 }
 
index 20a7363..19e5bde 100644 (file)
@@ -159,7 +159,7 @@ private:
 #endif
         String m_defaultVideoPosterURL;
         bool m_forcePendingWebGLPolicy;
-        bool m_originalTimeWithoutMouseMovementBeforeHidingControls;
+        Seconds m_originalTimeWithoutMouseMovementBeforeHidingControls;
         bool m_useLegacyBackgroundSizeShorthandBehavior;
         bool m_autoscrollForDragAndDropEnabled;
         bool m_quickTimePluginReplacementEnabled;
index 555bf15..d59e687 100644 (file)
@@ -729,7 +729,7 @@ void Internals::setImageFrameDecodingDuration(HTMLImageElement& element, float d
     if (!is<BitmapImage>(image))
         return;
     
-    downcast<BitmapImage>(*image).setFrameDecodingDurationForTesting(duration);
+    downcast<BitmapImage>(*image).setFrameDecodingDurationForTesting(Seconds { duration });
 }
 
 void Internals::resetImageAnimation(HTMLImageElement& element)
index 9def937..1306108 100644 (file)
@@ -738,7 +738,7 @@ ExceptionOr<void> XMLHttpRequest::createRequest()
         else {
             request.setTimeoutInterval(std::numeric_limits<double>::infinity());
             m_sendingTime = MonotonicTime::now();
-            m_timeoutTimer.startOneShot(Seconds { m_timeoutMilliseconds / 1000. });
+            m_timeoutTimer.startOneShot(1_ms * m_timeoutMilliseconds);
         }
     }
 
index efc307a..12701ce 100644 (file)
@@ -1,3 +1,19 @@
+2017-04-10  Chris Dumez  <cdumez@apple.com>
+
+        Drop Timer::startOneShot() overload taking a double
+        https://bugs.webkit.org/show_bug.cgi?id=170659
+
+        Reviewed by Yusuke Suzuki.
+
+        Drop Timer::startOneShot() overload taking a double as people should use Seconds type now.
+
+        * Storage/StorageAreaSync.cpp:
+        * Storage/StorageTracker.cpp:
+        (WebKit::StorageTracker::StorageTracker):
+        * Storage/StorageTracker.h:
+        (WebKit::StorageTracker::storageDatabaseIdleInterval):
+        (WebKit::StorageTracker::setStorageDatabaseIdleInterval):
+
 2017-04-09  Chris Dumez  <cdumez@apple.com>
 
         Start dropping Timer API dealing with double
index ac0dcc1..ba15e4a 100644 (file)
@@ -41,7 +41,7 @@ namespace WebKit {
 
 // If the StorageArea undergoes rapid changes, don't sync each change to disk.
 // Instead, queue up a batch of items to sync and actually do the sync at the following interval.
-static const double StorageSyncInterval = 1.0;
+static const Seconds StorageSyncInterval { 1_s };
 
 // A sane limit on how many items we'll schedule to sync all at once.  This makes it
 // much harder to starve the rest of LocalStorage and the OS's IO subsystem in general.
index 59a00fe..7c576ab 100644 (file)
@@ -52,7 +52,7 @@ static StorageTracker* storageTracker = nullptr;
 
 // If there is no document referencing a storage database, close the underlying database
 // after it has been idle for m_StorageDatabaseIdleInterval seconds.
-static const double DefaultStorageDatabaseIdleInterval = 300;
+static const Seconds defaultStorageDatabaseIdleInterval { 300_s };
     
 void StorageTracker::initializeTracker(const String& storagePath, StorageTrackerClient* client)
 {
@@ -97,7 +97,7 @@ StorageTracker::StorageTracker(const String& storagePath)
     , m_thread(std::make_unique<StorageThread>())
     , m_isActive(false)
     , m_needsInitialization(false)
-    , m_StorageDatabaseIdleInterval(DefaultStorageDatabaseIdleInterval)
+    , m_StorageDatabaseIdleInterval(defaultStorageDatabaseIdleInterval)
 {
 }
 
index 55d5b0d..e1ed6b9 100644 (file)
@@ -59,8 +59,8 @@ public:
     
     bool isActive();
 
-    double storageDatabaseIdleInterval() { return m_StorageDatabaseIdleInterval; }
-    void setStorageDatabaseIdleInterval(double interval) { m_StorageDatabaseIdleInterval = interval; }
+    Seconds storageDatabaseIdleInterval() { return m_StorageDatabaseIdleInterval; }
+    void setStorageDatabaseIdleInterval(Seconds interval) { m_StorageDatabaseIdleInterval = interval; }
 
     void syncFileSystemAndTrackerDatabase();
 
@@ -110,7 +110,7 @@ private:
     
     bool m_isActive;
     bool m_needsInitialization;
-    double m_StorageDatabaseIdleInterval;
+    Seconds m_StorageDatabaseIdleInterval;
 };
     
 } // namespace WebCore
index 651a8c6..205bdd7 100644 (file)
@@ -1,3 +1,17 @@
+2017-04-10  Chris Dumez  <cdumez@apple.com>
+
+        Drop Timer::startOneShot() overload taking a double
+        https://bugs.webkit.org/show_bug.cgi?id=170659
+
+        Reviewed by Yusuke Suzuki.
+
+        Drop Timer::startOneShot() overload taking a double as people should use Seconds type now.
+
+        * Plugins/WebNetscapePluginView.mm:
+        (PluginTimer::start):
+        * Storage/WebStorageManager.mm:
+        (+[WebStorageManager setStorageDatabaseIdleInterval:]):
+
 2017-04-09  Chris Dumez  <cdumez@apple.com>
 
         Drop Timer::startRepeating() overload taking a double
index 087fcfb..0193e40 100644 (file)
@@ -111,7 +111,7 @@ static WebNetscapePluginView *currentPluginView = nil;
 
 typedef struct OpaquePortState* PortState;
 
-static const double ThrottledTimerInterval = 0.25;
+static const Seconds throttledTimerInterval { 250_ms };
 
 class PluginTimer : public TimerBase {
 public:
@@ -130,10 +130,10 @@ public:
     {
         ASSERT(!isActive());
 
-        double timeInterval = m_interval / 1000.0;
+        Seconds timeInterval = 1_ms * m_interval;
         
         if (throttle)
-            timeInterval = std::max(timeInterval, ThrottledTimerInterval);
+            timeInterval = std::max(timeInterval, throttledTimerInterval);
         
         if (m_repeat)
             startRepeating(Seconds { timeInterval });
index 3704f7e..81ba1e6 100644 (file)
@@ -117,7 +117,7 @@ static pthread_once_t registerLocalStoragePath = PTHREAD_ONCE_INIT;
 
 + (void)setStorageDatabaseIdleInterval:(double)interval
 {
-    WebKit::StorageTracker::tracker().setStorageDatabaseIdleInterval(interval);
+    WebKit::StorageTracker::tracker().setStorageDatabaseIdleInterval(1_s * interval);
 }
 
 + (void)closeIdleLocalStorageDatabases
index adc85fd..7fdc71a 100644 (file)
@@ -1,3 +1,20 @@
+2017-04-10  Chris Dumez  <cdumez@apple.com>
+
+        Drop Timer::startOneShot() overload taking a double
+        https://bugs.webkit.org/show_bug.cgi?id=170659
+
+        Reviewed by Yusuke Suzuki.
+
+        Drop Timer::startOneShot() overload taking a double as people should use Seconds type now.
+
+        * Plugins/PluginMessageThrottlerWin.cpp:
+        (WebCore::PluginMessageThrottlerWin::appendMessage):
+        (WebCore::PluginMessageThrottlerWin::messageThrottleTimerFired):
+        * Plugins/PluginViewWin.cpp:
+        (WebCore::PluginView::invalidateRect):
+        * WebCoreSupport/AcceleratedCompositingContext.cpp:
+        (AcceleratedCompositingContext::scheduleLayerFlush):
+
 2017-04-09  Chris Dumez  <cdumez@apple.com>
 
         Drop Timer::startRepeating() overload taking a double
index a53c315..4331afa 100644 (file)
@@ -39,7 +39,7 @@ namespace WebCore {
 // This value allows Flash 60 messages/second, which should be enough for video
 // playback, and also gets us over the limit for kicking into high-resolution
 // timer mode (see SharedTimerWin.cpp).
-static const double MessageThrottleTimeInterval = 0.016;
+static const Seconds messageThrottleTimeInterval { 16_ms };
 
 // During a continuous stream of messages, process one every 5ms.
 static const double MessageDirectProcessingInterval = 0.005;
@@ -95,7 +95,7 @@ void PluginMessageThrottlerWin::appendMessage(HWND hWnd, UINT msg, WPARAM wParam
     }
 
     if (!m_messageThrottleTimer.isActive())
-        m_messageThrottleTimer.startOneShot(MessageThrottleTimeInterval);
+        m_messageThrottleTimer.startOneShot(messageThrottleTimeInterval);
 }
 
 void PluginMessageThrottlerWin::processQueuedMessage()
@@ -118,7 +118,7 @@ void PluginMessageThrottlerWin::messageThrottleTimerFired()
     processQueuedMessage();
 
     if (m_front)
-        m_messageThrottleTimer.startOneShot(MessageThrottleTimeInterval);
+        m_messageThrottleTimer.startOneShot(messageThrottleTimeInterval);
 }
 
 PluginMessage* PluginMessageThrottlerWin::allocateMessage()
index 75cb77f..24fb13e 100644 (file)
@@ -839,7 +839,7 @@ void PluginView::invalidateRect(NPRect* rect)
         if (m_plugin->quirks().contains(PluginQuirkThrottleInvalidate)) {
             m_invalidRects.append(r);
             if (!m_invalidateTimer.isActive())
-                m_invalidateTimer.startOneShot(0.001);
+                m_invalidateTimer.startOneShot(1_ms);
         } else
             invalidateRect(r);
     }
index fc0d155..5e16e20 100644 (file)
@@ -349,7 +349,7 @@ void AcceleratedCompositingContext::scheduleLayerFlush()
     if (m_layerFlushTimer.isActive())
         return;
 
-    m_layerFlushTimer.startOneShot(0.05);
+    m_layerFlushTimer.startOneShot(50_ms);
 }
 
 bool AcceleratedCompositingContext::flushPendingLayerChanges()
index cc7bd87..e42e2fd 100644 (file)
@@ -1,3 +1,63 @@
+2017-04-10  Chris Dumez  <cdumez@apple.com>
+
+        Drop Timer::startOneShot() overload taking a double
+        https://bugs.webkit.org/show_bug.cgi?id=170659
+
+        Reviewed by Yusuke Suzuki.
+
+        Drop Timer::startOneShot() overload taking a double as people should use Seconds type now.
+
+        * NetworkProcess/PingLoad.h:
+        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
+        (WebKit::NetworkDataTaskSoup::startTimeout):
+        * Platform/IPC/Connection.h:
+        * Platform/IPC/mac/ConnectionMac.mm:
+        (IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog):
+        (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
+        (IPC::Connection::terminateSoon):
+        * PluginProcess/PluginProcess.cpp:
+        (WebKit::PluginProcess::setMinimumLifetime):
+        * PluginProcess/PluginProcess.h:
+        * Shared/ChildProcess.cpp:
+        (WebKit::ChildProcess::ChildProcess):
+        * Shared/ChildProcess.h:
+        (WebKit::ChildProcess::setTerminationTimeout):
+        * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
+        (WebKit::CompositingRunLoop::startUpdateTimer):
+        * Shared/Plugins/PluginProcessCreationParameters.h:
+        * Shared/WebMemorySampler.cpp:
+        (WebKit::WebMemorySampler::initializeTimers):
+        * Shared/WebProcessCreationParameters.h:
+        * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
+        (API::SharedJSContext::ensureContext):
+        * UIProcess/ChildProcessProxy.cpp:
+        (WebKit::ChildProcessProxy::shutDownProcess):
+        * UIProcess/Cocoa/NavigationState.mm:
+        (WebKit::NavigationState::didChangeIsLoading):
+        * UIProcess/Cocoa/ViewGestureController.cpp:
+        (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
+        * UIProcess/Cocoa/ViewGestureController.h:
+        * UIProcess/DrawingAreaProxyImpl.cpp:
+        (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon):
+        (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
+        (WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw):
+        * UIProcess/Gamepad/UIGamepadProvider.cpp:
+        * UIProcess/Plugins/PluginProcessProxy.cpp:
+        * UIProcess/ProcessThrottler.cpp:
+        * UIProcess/ResponsivenessTimer.cpp:
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::createNewWebProcess):
+        * UIProcess/gtk/GestureController.cpp:
+        (WebKit::GestureController::DragGesture::begin):
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
+        (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
+        (WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
+        * WebProcess/WebProcess.cpp:
+
 2017-04-09  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [WK2] Add infrastructure to perform actions after an asynchronous position information request finishes
index f0144d6..39be06d 100644 (file)
@@ -46,7 +46,7 @@ public:
 
         // If the server never responds, this object will hang around forever.
         // Set a very generous timeout, just in case.
-        m_timeoutTimer.startOneShot(60000);
+        m_timeoutTimer.startOneShot(60000_s);
     }
     
 private:
index 5ff9b78..90be23d 100644 (file)
@@ -291,7 +291,7 @@ void NetworkDataTaskSoup::timeoutFired()
 void NetworkDataTaskSoup::startTimeout()
 {
     if (m_firstRequest.timeoutInterval() > 0)
-        m_timeoutSource.startOneShot(m_firstRequest.timeoutInterval());
+        m_timeoutSource.startOneShot(1_s * m_firstRequest.timeoutInterval());
 }
 
 void NetworkDataTaskSoup::stopTimeout()
index cb00b2d..fce1e63 100644 (file)
@@ -189,7 +189,7 @@ public:
 
 #if PLATFORM(COCOA)
     bool kill();
-    void terminateSoon(double intervalInSeconds);
+    void terminateSoon(Seconds);
 #endif
 
     bool isValid() const { return m_isValid; }
index 5e65bf3..e6ab9dd 100644 (file)
@@ -82,20 +82,20 @@ enum {
 //    to ensure it has a chance to terminate cleanly.
 class ConnectionTerminationWatchdog {
 public:
-    static void createConnectionTerminationWatchdog(OSObjectPtr<xpc_connection_t>& xpcConnection, double intervalInSeconds)
+    static void createConnectionTerminationWatchdog(OSObjectPtr<xpc_connection_t>& xpcConnection, Seconds interval)
     {
-        new ConnectionTerminationWatchdog(xpcConnection, intervalInSeconds);
+        new ConnectionTerminationWatchdog(xpcConnection, interval);
     }
     
 private:
-    ConnectionTerminationWatchdog(OSObjectPtr<xpc_connection_t>& xpcConnection, double intervalInSeconds)
+    ConnectionTerminationWatchdog(OSObjectPtr<xpc_connection_t>& xpcConnection, Seconds interval)
         : m_xpcConnection(xpcConnection)
         , m_watchdogTimer(RunLoop::main(), this, &ConnectionTerminationWatchdog::watchdogTimerFired)
 #if PLATFORM(IOS)
         , m_assertion(std::make_unique<WebKit::ProcessAndUIAssertion>(xpc_connection_get_pid(m_xpcConnection.get()), WebKit::AssertionState::Background))
 #endif
     {
-        m_watchdogTimer.startOneShot(intervalInSeconds);
+        m_watchdogTimer.startOneShot(interval);
     }
     
     void watchdogTimerFired()
@@ -155,10 +155,10 @@ void Connection::platformInvalidate()
 #endif
 }
     
-void Connection::terminateSoon(double intervalInSeconds)
+void Connection::terminateSoon(Seconds interval)
 {
     if (m_xpcConnection)
-        ConnectionTerminationWatchdog::createConnectionTerminationWatchdog(m_xpcConnection, intervalInSeconds);
+        ConnectionTerminationWatchdog::createConnectionTerminationWatchdog(m_xpcConnection, interval);
 }
     
 void Connection::platformInitialize(Identifier identifier)
index 758153b..9699b05 100644 (file)
@@ -216,9 +216,9 @@ void PluginProcess::deleteWebsiteDataForHostNames(const Vector<String>& hostName
     parentProcessConnection()->send(Messages::PluginProcessProxy::DidDeleteWebsiteDataForHostNames(callbackID), 0);
 }
 
-void PluginProcess::setMinimumLifetime(double lifetime)
+void PluginProcess::setMinimumLifetime(Seconds lifetime)
 {
-    if (lifetime <= 0.0)
+    if (lifetime <= 0_s)
         return;
     
     disableTermination();
index 92c6777..2479a43 100644 (file)
@@ -101,7 +101,7 @@ private:
 
     void platformInitializePluginProcess(PluginProcessCreationParameters&&);
     
-    void setMinimumLifetime(double);
+    void setMinimumLifetime(Seconds);
     void minimumLifetimeTimerFired();
     // Our web process connections.
     Vector<RefPtr<WebProcessConnection>> m_webProcessConnections;
index bc1f2d6..f1a3a38 100644 (file)
@@ -33,8 +33,7 @@
 namespace WebKit {
 
 ChildProcess::ChildProcess()
-    : m_terminationTimeout(0)
-    , m_terminationCounter(0)
+    : m_terminationCounter(0)
     , m_terminationTimer(RunLoop::main(), this, &ChildProcess::terminationTimerFired)
     , m_processSuppressionDisabled("Process Suppression Disabled by UIProcess")
 {
index 8ba24de..6fe72b1 100644 (file)
@@ -81,7 +81,7 @@ protected:
     explicit ChildProcess();
     virtual ~ChildProcess();
 
-    void setTerminationTimeout(double seconds) { m_terminationTimeout = seconds; }
+    void setTerminationTimeout(Seconds seconds) { m_terminationTimeout = seconds; }
 
     virtual void initializeProcess(const ChildProcessInitializationParameters&);
     virtual void initializeProcessName(const ChildProcessInitializationParameters&);
@@ -120,7 +120,7 @@ private:
 
     // The timeout, in seconds, before this process will be terminated if termination
     // has been enabled. If the timeout is 0 seconds, the process will be terminated immediately.
-    double m_terminationTimeout;
+    Seconds m_terminationTimeout;
 
     // A termination counter; when the counter reaches zero, the process will be terminated
     // after a given period of time.
index aadd6ab..5617bba 100644 (file)
@@ -154,7 +154,7 @@ void CompositingRunLoop::startUpdateTimer(UpdateTiming timing)
     if (timing == WaitUntilNextFrame)
         nextUpdateTime = std::max((1 / targetFPS) - (monotonicallyIncreasingTime() - m_lastUpdateTime), 0.0);
 
-    m_updateTimer.startOneShot(nextUpdateTime);
+    m_updateTimer.startOneShot(1_s * nextUpdateTime);
 }
 
 void CompositingRunLoop::stopUpdateTimer()
index a12a444..b1a34a4 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "Attachment.h"
 #include "PluginProcessAttributes.h"
+#include <wtf/Seconds.h>
 
 #if PLATFORM(COCOA)
 #include <WebCore/MachSendRight.h>
@@ -51,8 +52,8 @@ struct PluginProcessCreationParameters {
     PluginProcessType processType;
     bool supportsAsynchronousPluginInitialization;
 
-    double minimumLifetime;
-    double terminationTimeout;
+    Seconds minimumLifetime;
+    Seconds terminationTimeout;
 
 #if PLATFORM(COCOA)
     WebCore::MachSendRight acceleratedCompositingPort;
index babc288..1513390 100644 (file)
@@ -91,7 +91,7 @@ void WebMemorySampler::initializeTimers(double interval)
     m_sampleTimer.startRepeating(1_s);
     printf("Started memory sampler for process %s %d", processName().utf8().data(), getpid());
     if (interval > 0) {
-        m_stopTimer.startOneShot(interval);
+        m_stopTimer.startOneShot(1_s * interval);
         printf(" for a interval of %g seconds", interval);
     }
     printf("; Sampler log file stored at: %s\n", m_sampleLogFilePath.utf8().data());
index fd806b2..926a322 100644 (file)
@@ -126,7 +126,7 @@ struct WebProcessCreationParameters {
     bool hasRichContentServices { false };
 #endif
 
-    double terminationTimeout { 0 };
+    Seconds terminationTimeout;
 
     TextCheckerState textCheckerState;
 
index 83945df..1b5dd03 100644 (file)
@@ -46,7 +46,7 @@ public:
     {
         if (!m_context) {
             m_context = adoptNS([[JSContext alloc] init]);
-            m_timer.startOneShot(1);
+            m_timer.startOneShot(1_s);
         }
         return m_context.get();
     }
index dd8aef5..27bec36 100644 (file)
@@ -197,7 +197,7 @@ void ChildProcessProxy::shutDownProcess()
         // On iOS deploy a watchdog in the UI process, since the child process may be suspended.
         // If 30s is insufficient for any outstanding activity to complete cleanly, then it will be killed.
         ASSERT(m_connection);
-        m_connection->terminateSoon(30);
+        m_connection->terminateSoon(30_s);
 #endif
         break;
     case State::Terminated:
index 6b81ce4..96b9602 100644 (file)
@@ -887,7 +887,7 @@ void NavigationState::didChangeIsLoading()
     } else {
         // Delay releasing the background activity for 3 seconds to give the application a chance to start another navigation
         // before suspending the WebContent process <rdar://problem/27910964>.
-        m_releaseActivityTimer.startOneShot(3s);
+        m_releaseActivityTimer.startOneShot(3_s);
     }
 #endif
 
index 799da65..c4d3001 100644 (file)
@@ -40,13 +40,13 @@ using namespace WebCore;
 
 namespace WebKit {
 
-static const std::chrono::seconds swipeSnapshotRemovalWatchdogAfterFirstVisuallyNonEmptyLayoutDuration = 3s;
-static const Seconds swipeSnapshotRemovalActiveLoadMonitoringInterval = 250_ms;
+static const Seconds swipeSnapshotRemovalWatchdogAfterFirstVisuallyNonEmptyLayoutDuration { 3_s };
+static const Seconds swipeSnapshotRemovalActiveLoadMonitoringInterval { 250_ms };
 
 #if PLATFORM(MAC)
-static const std::chrono::seconds swipeSnapshotRemovalWatchdogDuration = 5s;
+static const Seconds swipeSnapshotRemovalWatchdogDuration = 5_s;
 #else
-static const std::chrono::seconds swipeSnapshotRemovalWatchdogDuration = 3s;
+static const Seconds swipeSnapshotRemovalWatchdogDuration = 3_s;
 #endif
 
 static HashMap<uint64_t, ViewGestureController*>& viewGestureControllersForAllPages()
@@ -297,10 +297,10 @@ void ViewGestureController::SnapshotRemovalTracker::watchdogTimerFired()
     fireRemovalCallbackImmediately();
 }
 
-void ViewGestureController::SnapshotRemovalTracker::startWatchdog(std::chrono::seconds duration)
+void ViewGestureController::SnapshotRemovalTracker::startWatchdog(Seconds duration)
 {
-    log(String::format("(re)started watchdog timer for %lld seconds", duration.count()));
-    m_watchdogTimer.startOneShot(duration.count());
+    log(String::format("(re)started watchdog timer for %.1f seconds", duration.seconds()));
+    m_watchdogTimer.startOneShot(duration);
 }
 
 } // namespace WebKit
index 1be59bc..f193e78 100644 (file)
@@ -159,7 +159,7 @@ private:
         bool eventOccurred(Events);
         bool cancelOutstandingEvent(Events);
 
-        void startWatchdog(std::chrono::seconds);
+        void startWatchdog(Seconds);
 
     private:
         static String eventsDescription(Events);
index 9a97b3f..09ba30b 100644 (file)
@@ -187,7 +187,7 @@ void DrawingAreaProxyImpl::discardBackingStoreSoon()
 
     // We'll wait this many seconds after the last paint before throwing away our backing store to save memory.
     // FIXME: It would be smarter to make this delay based on how expensive painting is. See <http://webkit.org/b/55733>.
-    static const double discardBackingStoreDelay = 2;
+    static const Seconds discardBackingStoreDelay = 2_s;
 
     m_discardBackingStoreTimer.startOneShot(discardBackingStoreDelay);
 }
@@ -228,7 +228,7 @@ void DrawingAreaProxyImpl::DrawingMonitor::start(std::function<void (CallbackBas
     m_callback = callback;
 #if PLATFORM(GTK)
     g_signal_connect_swapped(m_webPage.viewWidget(), "draw", reinterpret_cast<GCallback>(webViewDrawCallback), this);
-    m_timer.startOneShot(1);
+    m_timer.startOneShot(1_s);
 #else
     m_timer.startOneShot(0_s);
 #endif
@@ -255,7 +255,7 @@ void DrawingAreaProxyImpl::DrawingMonitor::didDraw()
     if (monotonicallyIncreasingTimeMS() - m_startTime > 1000)
         stop();
     else
-        m_timer.startOneShot(0.100);
+        m_timer.startOneShot(100_ms);
 }
 
 void DrawingAreaProxyImpl::dispatchAfterEnsuringDrawing(std::function<void(CallbackBase::Error)> callbackFunction)
index 657c416..0bee754 100644 (file)
@@ -39,7 +39,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
-static const double maximumGamepadUpdateInterval = 1 / 120.0;
+static const Seconds maximumGamepadUpdateInterval { 1_s / 120. };
 
 UIGamepadProvider& UIGamepadProvider::singleton()
 {
index 5ff51b5..bacd73e 100644 (file)
@@ -46,11 +46,11 @@ using namespace WebCore;
 
 namespace WebKit {
 
-static const double minimumLifetime = 2 * 60;
-static const double snapshottingMinimumLifetime = 30;
+static const Seconds minimumLifetime { 2_min };
+static const Seconds snapshottingMinimumLifetime { 30_s };
 
-static const double shutdownTimeout = 1 * 60;
-static const double snapshottingShutdownTimeout = 15;
+static const Seconds shutdownTimeout { 1_min };
+static const Seconds snapshottingShutdownTimeout { 15_s };
 
 static uint64_t generateCallbackID()
 {
index 77b0b8c..093863c 100644 (file)
@@ -31,7 +31,7 @@
 
 namespace WebKit {
     
-static const unsigned processSuspensionTimeout = 30;
+static const Seconds processSuspensionTimeout { 30_s };
     
 ProcessThrottler::ProcessThrottler(ProcessThrottlerClient& process)
     : m_process(process)
index feb469f..9ae5fd1 100644 (file)
@@ -28,7 +28,7 @@
 
 namespace WebKit {
 
-static const double responsivenessTimeout = 3;
+static const Seconds responsivenessTimeout { 3_s };
 
 ResponsivenessTimer::ResponsivenessTimer(ResponsivenessTimer::Client& client)
     : m_client(client)
index 1dd7ae2..efe46f5 100644 (file)
@@ -689,7 +689,7 @@ WebProcessProxy& WebProcessPool::createNewWebProcess(WebsiteDataStore* websiteDa
 
     parameters.iconDatabaseEnabled = !iconDatabasePath().isEmpty();
 
-    parameters.terminationTimeout = 0;
+    parameters.terminationTimeout = 0_s;
 
     parameters.textCheckerState = TextChecker::state();
 
index 0556ea7..a373429 100644 (file)
@@ -127,7 +127,7 @@ void GestureController::DragGesture::begin(DragGesture* dragGesture, double x, d
     GtkWidget* widget = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture));
     unsigned delay;
     g_object_get(gtk_widget_get_settings(widget), "gtk-long-press-time", &delay, nullptr);
-    dragGesture->m_longPressTimeout.startOneShot(delay / 1000.0);
+    dragGesture->m_longPressTimeout.startOneShot(1_ms * delay);
 }
 
 void GestureController::DragGesture::update(DragGesture* dragGesture, double x, double y, GtkGesture* gesture)
index dbd4042..2c457c7 100644 (file)
@@ -52,7 +52,7 @@ static const NSUInteger windowStyleMask = NSWindowStyleMaskTitled | NSWindowStyl
 
 // The time we keep our WebView alive before closing it and its process.
 // Reusing the WebView improves start up time for people that jump in and out of the Inspector.
-static const unsigned webViewCloseTimeout = 60;
+static const Seconds webViewCloseTimeout { 1_min };
 
 // WKWebInspectorProxyObjCAdapter is a helper ObjC object used as a delegate or notification observer
 // for the sole purpose of getting back into the C++ code from an ObjC caller.
index f428210..e3c58c8 100644 (file)
@@ -384,7 +384,7 @@ void AcceleratedDrawingArea::exitAcceleratedCompositingModeNow()
     m_previousLayerTreeHost->setIsDiscardable(true);
     m_previousLayerTreeHost->pauseRendering();
     m_previousLayerTreeHost->setLayerFlushSchedulingEnabled(false);
-    m_discardPreviousLayerTreeHostTimer.startOneShot(5);
+    m_discardPreviousLayerTreeHostTimer.startOneShot(5_s);
 #else
     m_layerTreeHost = nullptr;
 #endif
index a141043..b8b9360 100644 (file)
@@ -234,7 +234,7 @@ void CoordinatedLayerTreeHost::scheduleAnimation()
         return;
 
     scheduleLayerFlush();
-    m_layerFlushTimer.startOneShot(m_coordinator.nextAnimationServiceTime());
+    m_layerFlushTimer.startOneShot(1_s * m_coordinator.nextAnimationServiceTime());
 }
 
 void CoordinatedLayerTreeHost::commitScrollOffset(uint32_t layerID, const WebCore::IntSize& offset)
index 25e1a53..f308d30 100644 (file)
@@ -5333,7 +5333,7 @@ static const float primarySnapshottedPlugInSearchBucketSize = 1.1;
 static const int primarySnapshottedPlugInMinimumWidth = 400;
 static const int primarySnapshottedPlugInMinimumHeight = 300;
 static const unsigned maxPrimarySnapshottedPlugInDetectionAttempts = 2;
-static const int deferredPrimarySnapshottedPlugInDetectionDelay = 3;
+static const Seconds deferredPrimarySnapshottedPlugInDetectionDelay = 3_s;
 static const float overlappingImageBoundsScale = 1.1;
 static const float minimumOverlappingImageToPluginDimensionScale = .9;
 
@@ -5441,7 +5441,7 @@ void WebPage::determinePrimarySnapshottedPlugIn()
     if (!candidatePlugIn) {
         LOG(Plugins, "Primary Plug-In Detection: fail - did not find a candidate plug-in.");
         if (m_numberOfPrimarySnapshotDetectionAttempts < maxPrimarySnapshottedPlugInDetectionAttempts) {
-            LOG(Plugins, "Primary Plug-In Detection: will attempt again in %ds.", deferredPrimarySnapshottedPlugInDetectionDelay);
+            LOG(Plugins, "Primary Plug-In Detection: will attempt again in %.1f s.", deferredPrimarySnapshottedPlugInDetectionDelay.value());
             m_determinePrimarySnapshottedPlugInTimer.startOneShot(deferredPrimarySnapshottedPlugInDetectionDelay);
         }
         return;
index f13bca0..5b95c79 100644 (file)
@@ -143,7 +143,7 @@ using namespace WebCore;
 static const double plugInAutoStartExpirationTimeUpdateThreshold = 29 * 24 * 60 * 60;
 
 // This should be greater than tileRevalidationTimeout in TileController.
-static const double nonVisibleProcessCleanupDelay = 10;
+static const Seconds nonVisibleProcessCleanupDelay { 10_s };
 
 namespace WebKit {
 
index fa9c386..7ba610a 100644 (file)
@@ -1,3 +1,17 @@
+2017-04-10  Chris Dumez  <cdumez@apple.com>
+
+        Drop Timer::startOneShot() overload taking a double
+        https://bugs.webkit.org/show_bug.cgi?id=170659
+
+        Reviewed by Yusuke Suzuki.
+
+        Drop Timer::startOneShot() overload taking a double as people should use Seconds type now.
+
+        * TestWebKitAPI/Tests/WTF/RunLoop.cpp:
+        (TestWebKitAPI::TEST):
+        * WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp:
+        (WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded):
+
 2017-04-09  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [WK2] Add infrastructure to perform actions after an asynchronous position information request finishes
index d1de031..93b3d8c 100644 (file)
@@ -95,7 +95,7 @@ TEST(WTF_RunLoop, OneShotTimer)
 
     {
         DerivedTimer timer(testFinished);
-        timer.startOneShot(0.1);
+        timer.startOneShot(100_ms);
         Util::run(&testFinished);
     }
 }
index a9f7f40..b9acccc 100644 (file)
@@ -48,7 +48,7 @@ void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded()
     if (m_waitToDumpWatchdogTimer.isActive())
         return;
 
-    m_waitToDumpWatchdogTimer.startOneShot(m_timeout / 1000.0);
+    m_waitToDumpWatchdogTimer.startOneShot(1_ms * m_timeout);
 }
 
 JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url)