Remove monotonicallyIncreasingTime
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Mar 2018 17:13:32 +0000 (17:13 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Mar 2018 17:13:32 +0000 (17:13 +0000)
commit2b141ee33535e4444dd26fe63407f74b85083bfd
treefaceebff9a7758ec8ba87174268e46aac688b8f2
parent47cd65d7a54b6f6e86d842bed186204ec1f6c242
Remove monotonicallyIncreasingTime
https://bugs.webkit.org/show_bug.cgi?id=182911

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

* debugger/Debugger.cpp:
(JSC::Debugger::willEvaluateScript):
(JSC::Debugger::didEvaluateScript):
* debugger/Debugger.h:
* debugger/ScriptProfilingScope.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::breakpointActionProbe):
* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::snapshot):
(Inspector::InspectorHeapAgent::didGarbageCollect):
(Inspector::InspectorHeapAgent::dispatchGarbageCollectedEvent):
* inspector/agents/InspectorHeapAgent.h:
* inspector/agents/InspectorScriptProfilerAgent.cpp:
(Inspector::InspectorScriptProfilerAgent::startTracking):
(Inspector::InspectorScriptProfilerAgent::willEvaluateScript):
(Inspector::InspectorScriptProfilerAgent::didEvaluateScript):
(Inspector::InspectorScriptProfilerAgent::addEvent):
(Inspector::buildSamples):
* inspector/agents/InspectorScriptProfilerAgent.h:
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::takeSample):
* runtime/SamplingProfiler.h:

Source/WebCore:

While generic code uses MonotonicTime, CAAnimation uses media time (CFTimeInterval).
At this boundary, we convert MonotonicTime to media time, this is the same logic to
the code before this patch.

* Modules/gamepad/Gamepad.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::SourceBuffer):
(WebCore::SourceBuffer::monitorBufferingRate):
* Modules/mediasource/SourceBuffer.h:
* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::startSpeakingImmediately):
(WebCore::SpeechSynthesis::fireEvent):
* Modules/speech/SpeechSynthesisUtterance.h:
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::parseRuleList):
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
* dom/Element.cpp:
(WebCore::Element::setActive):
* history/CachedPage.cpp:
(WebCore::CachedPage::CachedPage):
(WebCore::CachedPage::hasExpired const):
* history/CachedPage.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::startProgressEventTimer):
(WebCore::HTMLMediaElement::progressEventTimerFired):
(WebCore::HTMLMediaElement::refreshCachedTime const):
(WebCore::HTMLMediaElement::invalidateCachedTime const):
(WebCore::HTMLMediaElement::currentMediaTime const):
(WebCore::HTMLMediaElement::startPlaybackProgressTimer):
* html/HTMLMediaElement.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::removeBehaviorRestriction):
(WebCore::MediaElementSession::mostRecentUserInteractionTime const):
(WebCore::MediaElementSession::resetPlaybackSessionState):
* html/MediaElementSession.h:
* html/parser/HTMLParserScheduler.cpp:
(WebCore::PumpSession::PumpSession):
(WebCore::HTMLParserScheduler::HTMLParserScheduler):
* html/parser/HTMLParserScheduler.h:
(WebCore::HTMLParserScheduler::checkForYield):
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::recordAction):
(WebCore::InspectorCanvas::finalizeFrame):
* inspector/InspectorCanvas.h:
* inspector/agents/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::startTracking):
(WebCore::InspectorMemoryAgent::didHandleMemoryPressure):
(WebCore::InspectorMemoryAgent::collectSample):
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForTiming):
(WebCore::InspectorNetworkAgent::timestamp):
(WebCore::InspectorNetworkAgent::didFinishLoading):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::timestamp):
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::timestamp):
* inspector/agents/WebHeapAgent.cpp:
(WebCore::WebHeapAgent::dispatchGarbageCollectedEvent):
* inspector/agents/WebHeapAgent.h:
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didDraw):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::didAccessDecodedData):
* loader/cache/CachedResource.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneLiveResourcesToSize):
* page/EventHandler.cpp:
(WebCore::MaximumDurationTracker::MaximumDurationTracker):
(WebCore::MaximumDurationTracker::~MaximumDurationTracker):
* page/FocusController.cpp:
(WebCore::FocusController::setFocusedElement):
(WebCore::FocusController::timeSinceFocusWasSet const):
* page/FocusController.h:
* page/FrameView.cpp:
(WebCore::FrameView::reset):
(WebCore::FrameView::willPaintContents):
(WebCore::FrameView::didPaintContents):
* page/FrameView.h:
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::freezeAtTime):
(WebCore::AnimationBase::beginAnimationUpdateTime const):
* page/animation/AnimationBase.h:
(WebCore::AnimationBase::onAnimationStartResponse):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::beginAnimationUpdateTime):
(WebCore::CSSAnimationControllerPrivate::receivedStartTimeResponse):
(WebCore::CSSAnimationControllerPrivate::startTimeResponse):
(WebCore::CSSAnimationController::notifyAnimationStarted):
* page/animation/CSSAnimationController.h:
* page/animation/CSSAnimationControllerPrivate.h:
* page/mac/WheelEventDeltaFilterMac.h:
* page/mac/WheelEventDeltaFilterMac.mm:
(WebCore::WheelEventDeltaFilterMac::beginFilteringDeltas):
(WebCore::WheelEventDeltaFilterMac::updateFromDelta):
(WebCore::WheelEventDeltaFilterMac::endFilteringDeltas):
* platform/ControlStates.h:
(WebCore::ControlStates::timeSinceControlWasFocused const):
(WebCore::ControlStates::setTimeSinceControlWasFocused):
* platform/PlatformSpeechSynthesisUtterance.h:
(WebCore::PlatformSpeechSynthesisUtterance::startTime const):
(WebCore::PlatformSpeechSynthesisUtterance::setStartTime):
* platform/gamepad/PlatformGamepad.h:
(WebCore::PlatformGamepad::lastUpdateTime const):
(WebCore::PlatformGamepad::connectTime const):
(WebCore::PlatformGamepad::PlatformGamepad):
* platform/gamepad/cocoa/GameControllerGamepad.mm:
(WebCore::GameControllerGamepad::setupAsExtendedGamepad):
(WebCore::GameControllerGamepad::setupAsGamepad):
* platform/gamepad/mac/HIDGamepad.cpp:
(WebCore::HIDGamepad::HIDGamepad):
(WebCore::HIDGamepad::valueChanged):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::suspendAnimations):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::notifyAnimationStarted):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::LayerClient::platformCALayerAnimationStarted):
(WebCore::AVFWrapper::createImageForTimeInRect):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::addAnimation):
(WebCore::GraphicsLayerCA::pauseAnimation):
(WebCore::GraphicsLayerCA::platformCALayerAnimationStarted):
(WebCore::GraphicsLayerCA::setAnimationOnLayer):
(WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer):
(WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
(WebCore::GraphicsLayerCA::AnimationProcessingAction::AnimationProcessingAction):
* platform/graphics/ca/LayerPool.cpp:
(WebCore::LayerPool::LayerPool):
(WebCore::LayerPool::addLayer):
(WebCore::LayerPool::decayedCapacity const):
(WebCore::LayerPool::pruneTimerFired):
* platform/graphics/ca/LayerPool.h:
* platform/graphics/ca/PlatformCAAnimation.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/PlatformCALayerClient.h:
(WebCore::PlatformCALayerClient::platformCALayerAnimationStarted):
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::revalidateTiles):
(WebCore::TileGrid::startedNewCohort):
(WebCore::TileGrid::TileCohortInfo::timeUntilExpiration):
(WebCore::TileGrid::cohortRemovalTimerFired):
* platform/graphics/ca/TileGrid.h:
(WebCore::TileGrid::TileCohortInfo::TileCohortInfo):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(mediaTimeToCurrentTime):
(-[WebAnimationDelegate animationDidStart:]):
(PlatformCALayerCocoa::animationStarted):
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::notifyAnimationsStarted):
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::animationStarted):
(PlatformCALayerWin::layerTreeAsString const):
* platform/graphics/ca/win/PlatformCALayerWin.h:
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::decodeSample):
* platform/graphics/texmap/BitmapTexturePool.cpp:
(WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
* platform/graphics/texmap/BitmapTexturePool.h:
(WebCore::BitmapTexturePool::Entry::markIsInUse):
(WebCore::BitmapTexturePool::Entry::canBeReleased const):
(): Deleted.
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
(WebCore::GraphicsLayerTextureMapper::addAnimation):
(WebCore::GraphicsLayerTextureMapper::pauseAnimation):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::TextureMapperAnimation::TextureMapperAnimation):
(WebCore::TextureMapperAnimation::apply):
(WebCore::TextureMapperAnimation::pause):
(WebCore::TextureMapperAnimation::resume):
(WebCore::TextureMapperAnimation::computeTotalRunningTime):
(WebCore::TextureMapperAnimations::pause):
(WebCore::TextureMapperAnimations::suspend):
* platform/graphics/texmap/TextureMapperAnimation.h:
(WebCore::TextureMapperAnimation::startTime const):
(WebCore::TextureMapperAnimation::pauseTime const):
* platform/graphics/texmap/TextureMapperFPSCounter.cpp:
(WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
(WebCore::TextureMapperFPSCounter::updateFPSAndDisplay):
* platform/graphics/texmap/TextureMapperFPSCounter.h:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
(WebCore::TextureMapperPlatformLayerBuffer::markUsed):
(WebCore::TextureMapperPlatformLayerBuffer::lastUsedTime const):
(): Deleted.
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::addAnimation):
(WebCore::CoordinatedGraphicsLayer::pauseAnimation):
(WebCore::CoordinatedGraphicsLayer::suspendAnimations):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::sendFrame):
* platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
(WebCore::LibWebRTCAudioModule::StartPlayoutOnAudioThread):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::startProducingData):
(WebCore::DisplayCaptureSourceCocoa::stopProducingData):
(WebCore::DisplayCaptureSourceCocoa::elapsedTime):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSourceMac::render):
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::sampleBufferFromPixelBuffer):
(WebCore::ScreenDisplayCaptureSourceMac::frameAvailable):
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::startProducingData):
(WebCore::MockRealtimeAudioSource::stopProducingData):
(WebCore::MockRealtimeAudioSource::elapsedTime):
(WebCore::MockRealtimeAudioSource::tick):
(WebCore::MockRealtimeAudioSource::delaySamples):
* platform/mock/MockRealtimeAudioSource.h:
(WebCore::MockRealtimeAudioSource::render):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::startProducingData):
(WebCore::MockRealtimeVideoSource::stopProducingData):
(WebCore::MockRealtimeVideoSource::elapsedTime):
(WebCore::MockRealtimeVideoSource::drawText):
(WebCore::MockRealtimeVideoSource::delaySamples):
(WebCore::MockRealtimeVideoSource::generateFrame):
* platform/mock/MockRealtimeVideoSource.h:
* platform/network/DNSResolveQueue.cpp:
(WebCore::DNSResolveQueue::DNSResolveQueue):
(WebCore::DNSResolveQueue::isUsingProxy):
* platform/network/DNSResolveQueue.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::suspendAnimations):
* rendering/RenderBoxModelObject.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::notifyAnimationStarted):
(WebCore::RenderLayerBacking::suspendAnimations):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::didPaintBacking):
* rendering/RenderProgress.cpp:
(WebCore::RenderProgress::RenderProgress):
(WebCore::RenderProgress::animationProgress const):
(WebCore::RenderProgress::updateAnimationState):
* rendering/RenderProgress.h:
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::animationDurationForProgressBar const):
* rendering/RenderTheme.h:
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::animationDurationForProgressBar const):
* rendering/RenderThemeGtk.h:
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::animationDurationForProgressBar const):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::animationDurationForProgressBar const):
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::SMILTimeContainer):
(WebCore::SMILTimeContainer::elapsed const):
(WebCore::SMILTimeContainer::isActive const):
(WebCore::SMILTimeContainer::isPaused const):
(WebCore::SMILTimeContainer::isStarted const):
(WebCore::SMILTimeContainer::begin):
(WebCore::SMILTimeContainer::pause):
(WebCore::SMILTimeContainer::resume):
(WebCore::SMILTimeContainer::setElapsed):
(WebCore::SMILTimeContainer::timerFired):
* svg/animation/SMILTimeContainer.h:
* testing/Internals.cpp:
(WebCore::Internals::delayMediaStreamTrackSamples):
* testing/MockGamepad.cpp:
(WebCore::MockGamepad::MockGamepad):
(WebCore::MockGamepad::updateDetails):
(WebCore::MockGamepad::setAxisValue):
(WebCore::MockGamepad::setButtonValue):

Source/WebCore/PAL:

* pal/system/ClockGeneric.cpp:
(PAL::ClockGeneric::currentTime const):
(PAL::ClockGeneric::now const):
* pal/system/ClockGeneric.h:

Source/WebKit:

* NetworkProcess/cache/CacheStorageEngineCache.cpp:
(WebKit::CacheStorage::Cache::toRecordInformation):
* Platform/IPC/ArgumentCoders.cpp:
(IPC::ArgumentCoder<Seconds>::encode):
(IPC::ArgumentCoder<Seconds>::decode):
(IPC::ArgumentCoder<MonotonicTime>::encode):
(IPC::ArgumentCoder<MonotonicTime>::decode):
* Platform/IPC/ArgumentCoders.h:
* Shared/Gamepad/GamepadData.cpp:
(WebKit::GamepadData::GamepadData):
* Shared/Gamepad/GamepadData.h:
(WebKit::GamepadData::lastUpdateTime const):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<MonotonicTime>::encode): Deleted.
(IPC::ArgumentCoder<MonotonicTime>::decode): Deleted.
(IPC::ArgumentCoder<Seconds>::encode): Deleted.
(IPC::ArgumentCoder<Seconds>::decode): Deleted.
ArgumentCoders for MonotonicTime and Seconds are now used internally.
Move them to Platform/IPC/ArgumentCoders.h.

* Shared/WebCoreArgumentCoders.h:
* UIProcess/API/glib/IconDatabase.cpp:
(WebKit::IconDatabase::iconDatabaseSyncThread):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
(WebKit::DrawingAreaProxyImpl::DrawingMonitor::stop):
(WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw):
* UIProcess/DrawingAreaProxyImpl.h:
* UIProcess/Gamepad/UIGamepad.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::animationDidStart):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::acceleratedAnimationDidStart):
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(mediaTimeToCurrentTime):
(-[WKAnimationDelegate animationDidStart:]):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::animationStarted):
This argument `beginTime` is not CFTimeInverval actually. We add currentTimeToMediaTime
conversion here to fix this issue.

* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::animationDidStart):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::destroyRenderingResources):

Source/WebKitLegacy/win:

* FullscreenVideoController.cpp:
(FullscreenVideoController::LayerClient::platformCALayerAnimationStarted):
* Plugins/PluginMessageThrottlerWin.cpp:
(WebCore::PluginMessageThrottlerWin::PluginMessageThrottlerWin):
(WebCore::PluginMessageThrottlerWin::appendMessage):
* Plugins/PluginMessageThrottlerWin.h:
* WebView.cpp:
(WebView::notifyAnimationStarted):
* WebView.h:

Source/WTF:

This patch drops monotonicallyIncreasingTime and monotonicallyIncreasingTimeMS.
We have MonotonicTime API instead. This offers strongly typed MonotonicTime,
Seconds etc. This reduces the chance of bugs mixing doubles which represent milliseconds
and seconds.

Large part of this patch is mechanical one: replacing monotonicallyIncreasingTime with
MonotonicTime, using MonotonicTime and Seconds instead of raw doubles.

But this patch actually finds some bugs (but it is a bit difficult to show it as a test).
One is mixing media time (CACurrentMediaTime()) and MonotonicTime. Basically they are
super close because both uses mach_absolute_time(). But they would be slightly different.
So we should not mix them.

The second bug is GraphicsLayer::suspendAnimations(double). While CA ports (Apple, AppleWin,
iOS etc.) use this double as MonotonicTime, GTK and WPE use this double as Seconds (timeOffset).
This patch fixes it and now the signature becomes GraphicsLayer::suspendAnimations(MonotonicTime).

In this patch, we still uses bunch of double for Seconds. But fixing them at this patch increases
the size of this larger and larger. So some of them remains double. This should be fixed in
subsequent patches.

* benchmarks/ConditionSpeedTest.cpp:
* benchmarks/LockSpeedTest.cpp:
* wtf/CurrentTime.cpp:
(WTF::MonotonicTime::now):
(WTF::monotonicallyIncreasingTime): Deleted.
* wtf/CurrentTime.h:
(WTF::monotonicallyIncreasingTimeMS): Deleted.
* wtf/MemoryPressureHandler.h:
* wtf/MonotonicTime.cpp:
(WTF::MonotonicTime::now): Deleted.
* wtf/MonotonicTime.h:
* wtf/ParkingLot.cpp:
* wtf/Seconds.h:
(WTF::Seconds::nan):
* wtf/Stopwatch.h:
(WTF::Stopwatch::reset):
(WTF::Stopwatch::start):
(WTF::Stopwatch::stop):
(WTF::Stopwatch::elapsedTime):
(WTF::Stopwatch::elapsedTimeSince):
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
(WTF::MemoryPressureHandler::holdOff):
(WTF::MemoryPressureHandler::respondToMemoryPressure):
* wtf/linux/MemoryPressureHandlerLinux.cpp:
(WTF::MemoryPressureHandler::EventFDPoller::EventFDPoller):
(WTF::MemoryPressureHandler::holdOff):
(WTF::MemoryPressureHandler::respondToMemoryPressure):
* wtf/win/MemoryPressureHandlerWin.cpp:
(WTF::MemoryPressureHandler::holdOff):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
177 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/debugger/Debugger.cpp
Source/JavaScriptCore/debugger/Debugger.h
Source/JavaScriptCore/debugger/ScriptProfilingScope.h
Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.h
Source/JavaScriptCore/inspector/agents/InspectorScriptProfilerAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorScriptProfilerAgent.h
Source/JavaScriptCore/runtime/SamplingProfiler.cpp
Source/JavaScriptCore/runtime/SamplingProfiler.h
Source/WTF/ChangeLog
Source/WTF/benchmarks/ConditionSpeedTest.cpp
Source/WTF/benchmarks/LockSpeedTest.cpp
Source/WTF/wtf/CurrentTime.cpp
Source/WTF/wtf/CurrentTime.h
Source/WTF/wtf/MemoryPressureHandler.h
Source/WTF/wtf/MonotonicTime.cpp
Source/WTF/wtf/MonotonicTime.h
Source/WTF/wtf/ParkingLot.cpp
Source/WTF/wtf/Seconds.h
Source/WTF/wtf/Stopwatch.h
Source/WTF/wtf/cocoa/MemoryPressureHandlerCocoa.mm
Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp
Source/WTF/wtf/win/MemoryPressureHandlerWin.cpp
Source/WebCore/ChangeLog
Source/WebCore/Modules/gamepad/Gamepad.h
Source/WebCore/Modules/mediasource/SourceBuffer.cpp
Source/WebCore/Modules/mediasource/SourceBuffer.h
Source/WebCore/Modules/speech/SpeechSynthesis.cpp
Source/WebCore/Modules/speech/SpeechSynthesisUtterance.h
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/system/ClockGeneric.cpp
Source/WebCore/PAL/pal/system/ClockGeneric.h
Source/WebCore/contentextensions/ContentExtensionCompiler.cpp
Source/WebCore/contentextensions/ContentExtensionParser.cpp
Source/WebCore/contentextensions/ContentExtensionsBackend.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/history/CachedPage.cpp
Source/WebCore/history/CachedPage.h
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/MediaElementSession.cpp
Source/WebCore/html/MediaElementSession.h
Source/WebCore/html/parser/HTMLParserScheduler.cpp
Source/WebCore/html/parser/HTMLParserScheduler.h
Source/WebCore/inspector/InspectorCanvas.cpp
Source/WebCore/inspector/InspectorCanvas.h
Source/WebCore/inspector/agents/InspectorMemoryAgent.cpp
Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
Source/WebCore/inspector/agents/InspectorPageAgent.cpp
Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp
Source/WebCore/inspector/agents/WebHeapAgent.cpp
Source/WebCore/inspector/agents/WebHeapAgent.h
Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/cache/CachedResource.cpp
Source/WebCore/loader/cache/CachedResource.h
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/FocusController.h
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/page/animation/AnimationBase.cpp
Source/WebCore/page/animation/AnimationBase.h
Source/WebCore/page/animation/CSSAnimationController.cpp
Source/WebCore/page/animation/CSSAnimationController.h
Source/WebCore/page/animation/CSSAnimationControllerPrivate.h
Source/WebCore/page/mac/WheelEventDeltaFilterMac.h
Source/WebCore/page/mac/WheelEventDeltaFilterMac.mm
Source/WebCore/platform/ControlStates.h
Source/WebCore/platform/PlatformSpeechSynthesisUtterance.h
Source/WebCore/platform/gamepad/PlatformGamepad.h
Source/WebCore/platform/gamepad/cocoa/GameControllerGamepad.mm
Source/WebCore/platform/gamepad/mac/HIDGamepad.cpp
Source/WebCore/platform/graphics/GraphicsLayer.cpp
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/platform/graphics/GraphicsLayerClient.h
Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
Source/WebCore/platform/graphics/ca/LayerPool.cpp
Source/WebCore/platform/graphics/ca/LayerPool.h
Source/WebCore/platform/graphics/ca/PlatformCAAnimation.h
Source/WebCore/platform/graphics/ca/PlatformCALayer.h
Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h
Source/WebCore/platform/graphics/ca/TileGrid.cpp
Source/WebCore/platform/graphics/ca/TileGrid.h
Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h
Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h
Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm
Source/WebCore/platform/graphics/texmap/BitmapTexturePool.cpp
Source/WebCore/platform/graphics/texmap/BitmapTexturePool.h
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.h
Source/WebCore/platform/graphics/texmap/TextureMapperFPSCounter.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperFPSCounter.h
Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h
Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
Source/WebCore/platform/mediastream/RealtimeMediaSource.h
Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp
Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp
Source/WebCore/platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp
Source/WebCore/platform/mediastream/mac/DisplayCaptureSourceCocoa.h
Source/WebCore/platform/mediastream/mac/MockRealtimeAudioSourceMac.h
Source/WebCore/platform/mediastream/mac/MockRealtimeAudioSourceMac.mm
Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm
Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h
Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm
Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp
Source/WebCore/platform/mock/MockRealtimeAudioSource.h
Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
Source/WebCore/platform/mock/MockRealtimeVideoSource.h
Source/WebCore/platform/network/DNSResolveQueue.cpp
Source/WebCore/platform/network/DNSResolveQueue.h
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderBoxModelObject.h
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderProgress.cpp
Source/WebCore/rendering/RenderProgress.h
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/svg/animation/SMILTimeContainer.cpp
Source/WebCore/svg/animation/SMILTimeContainer.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/MockGamepad.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp
Source/WebKit/Platform/IPC/ArgumentCoders.h
Source/WebKit/Shared/Gamepad/GamepadData.cpp
Source/WebKit/Shared/Gamepad/GamepadData.h
Source/WebKit/Shared/WebCoreArgumentCoders.cpp
Source/WebKit/Shared/WebCoreArgumentCoders.h
Source/WebKit/UIProcess/API/glib/IconDatabase.cpp
Source/WebKit/UIProcess/DrawingAreaProxyImpl.cpp
Source/WebKit/UIProcess/DrawingAreaProxyImpl.h
Source/WebKit/UIProcess/Gamepad/UIGamepad.h
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm
Source/WebKit/WebProcess/WebPage/DrawingArea.h
Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm
Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/FullscreenVideoController.cpp
Source/WebKitLegacy/win/Plugins/PluginMessageThrottlerWin.cpp
Source/WebKitLegacy/win/Plugins/PluginMessageThrottlerWin.h
Source/WebKitLegacy/win/WebView.cpp
Source/WebKitLegacy/win/WebView.h