https://bugs.webkit.org/show_bug.cgi?id=119958
Patch by Arunprasad Rajkumar <arurajku@cisco.com> on 2013-08-27
Reviewed by Alexey Proskuryakov.
WTF::currentTime() is prone to NTP and manual adjustments, so use
WTF::monotonicallyIncreasingTime() to measure elapsed time.
It is a continuation of r154201.
Source/WebCore:
* history/CachedPage.cpp:
(WebCore::CachedPage::CachedPage):
(WebCore::CachedPage::hasExpired):
* html/parser/HTMLParserScheduler.h:
(WebCore::HTMLParserScheduler::checkForYieldBeforeToken):
* loader/CrossOriginPreflightResultCache.cpp:
(WebCore::CrossOriginPreflightResultCacheItem::parse):
(WebCore::CrossOriginPreflightResultCacheItem::allowsRequest):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setState):
* loader/ProgressTracker.cpp:
(WebCore::ProgressTracker::incrementProgress):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didDraw):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneLiveResourcesToSize):
* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::iconDatabaseSyncThread):
(WebCore::IconDatabase::syncThreadMainLoop):
(WebCore::IconDatabase::readFromDatabase):
(WebCore::IconDatabase::writeToDatabase):
(WebCore::IconDatabase::cleanupSyncThread):
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::freezeAtTime):
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::beginAnimationUpdateTime):
* platform/graphics/GraphicsLayerAnimation.cpp:
(WebCore::GraphicsLayerAnimation::computeTotalRunningTime):
(WebCore::GraphicsLayerAnimation::resume):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::AVFWrapper::createImageForTimeInRect):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::suspendAnimations):
* platform/graphics/ca/PlatformCALayer.h:
(WebCore::PlatformCALayer::currentTimeToMediaTime):
* platform/graphics/ca/mac/LayerPool.mm:
(WebCore::LayerPool::addLayer):
(WebCore::LayerPool::decayedCapacity):
(WebCore::LayerPool::pruneTimerFired):
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(mediaTimeToCurrentTime):
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::notifyAnimationsStarted):
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayer::printTree):
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::addAnimation):
* platform/graphics/texmap/TextureMapperFPSCounter.cpp:
(WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
(WebCore::TextureMapperFPSCounter::updateFPSAndDisplay):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::addAnimation):
* platform/network/DNSResolveQueue.cpp:
(WebCore::DNSResolveQueue::isUsingProxy):
* plugins/win/PluginMessageThrottlerWin.cpp:
(WebCore::PluginMessageThrottlerWin::appendMessage):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::didPaintBacking):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
* rendering/RenderProgress.cpp:
(WebCore::RenderProgress::animationProgress):
(WebCore::RenderProgress::updateAnimationState):
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::elapsed):
(WebCore::SMILTimeContainer::begin):
(WebCore::SMILTimeContainer::pause):
(WebCore::SMILTimeContainer::resume):
(WebCore::SMILTimeContainer::setElapsed):
Source/WTF:
* wtf/CurrentTime.h: Edited comment.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154706
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-08-27 Arunprasad Rajkumar <arurajku@cisco.com>
+
+ Replace currentTime() with monotonicallyIncreasingTime() in WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=119958
+
+ Reviewed by Alexey Proskuryakov.
+
+ WTF::currentTime() is prone to NTP and manual adjustments, so use
+ WTF::monotonicallyIncreasingTime() to measure elapsed time.
+
+ It is a continuation of r154201.
+
+ * wtf/CurrentTime.h: Edited comment.
+
2013-08-27 Andre Moreira Magalhaes <andre.magalhaes@collabora.co.uk>
[gstreamer] Make sure gstreamer source element is thread-safe
// Provides a monotonically increasing time in seconds since an arbitrary point in the past.
// On unsupported platforms, this function only guarantees the result will be non-decreasing.
// Result of this function increases monotonically even when clock time goes back due to
-// DST changes or NTP adjustments, so it better suits for elapsed time measurement.
+// NTP or manual adjustments, so it is better suited for elapsed time measurement.
WTF_EXPORT_PRIVATE double monotonicallyIncreasingTime();
inline double monotonicallyIncreasingTimeMS()
+2013-08-27 Arunprasad Rajkumar <arurajku@cisco.com>
+
+ Replace currentTime() with monotonicallyIncreasingTime() in WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=119958
+
+ Reviewed by Alexey Proskuryakov.
+
+ WTF::currentTime() is prone to NTP and manual adjustments, so use
+ WTF::monotonicallyIncreasingTime() to measure elapsed time.
+
+ It is a continuation of r154201.
+
+ * history/CachedPage.cpp:
+ (WebCore::CachedPage::CachedPage):
+ (WebCore::CachedPage::hasExpired):
+ * html/parser/HTMLParserScheduler.h:
+ (WebCore::HTMLParserScheduler::checkForYieldBeforeToken):
+ * loader/CrossOriginPreflightResultCache.cpp:
+ (WebCore::CrossOriginPreflightResultCacheItem::parse):
+ (WebCore::CrossOriginPreflightResultCacheItem::allowsRequest):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::setState):
+ * loader/ProgressTracker.cpp:
+ (WebCore::ProgressTracker::incrementProgress):
+ * loader/cache/CachedCSSStyleSheet.cpp:
+ (WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet):
+ * loader/cache/CachedImage.cpp:
+ (WebCore::CachedImage::didDraw):
+ * loader/cache/MemoryCache.cpp:
+ (WebCore::MemoryCache::pruneLiveResourcesToSize):
+ * loader/icon/IconDatabase.cpp:
+ (WebCore::IconDatabase::iconDatabaseSyncThread):
+ (WebCore::IconDatabase::syncThreadMainLoop):
+ (WebCore::IconDatabase::readFromDatabase):
+ (WebCore::IconDatabase::writeToDatabase):
+ (WebCore::IconDatabase::cleanupSyncThread):
+ * page/animation/AnimationBase.cpp:
+ (WebCore::AnimationBase::freezeAtTime):
+ * page/animation/AnimationController.cpp:
+ (WebCore::AnimationControllerPrivate::beginAnimationUpdateTime):
+ * platform/graphics/GraphicsLayerAnimation.cpp:
+ (WebCore::GraphicsLayerAnimation::computeTotalRunningTime):
+ (WebCore::GraphicsLayerAnimation::resume):
+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+ (WebCore::AVFWrapper::createImageForTimeInRect):
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer):
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::suspendAnimations):
+ * platform/graphics/ca/PlatformCALayer.h:
+ (WebCore::PlatformCALayer::currentTimeToMediaTime):
+ * platform/graphics/ca/mac/LayerPool.mm:
+ (WebCore::LayerPool::addLayer):
+ (WebCore::LayerPool::decayedCapacity):
+ (WebCore::LayerPool::pruneTimerFired):
+ * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+ (mediaTimeToCurrentTime):
+ * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
+ (WebCore::CACFLayerTreeHost::notifyAnimationsStarted):
+ * platform/graphics/ca/win/PlatformCALayerWin.cpp:
+ (PlatformCALayer::printTree):
+ * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
+ (WebCore::GraphicsLayerTextureMapper::addAnimation):
+ * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
+ (WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
+ (WebCore::TextureMapperFPSCounter::updateFPSAndDisplay):
+ * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+ (WebCore::CoordinatedGraphicsLayer::addAnimation):
+ * platform/network/DNSResolveQueue.cpp:
+ (WebCore::DNSResolveQueue::isUsingProxy):
+ * plugins/win/PluginMessageThrottlerWin.cpp:
+ (WebCore::PluginMessageThrottlerWin::appendMessage):
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::didPaintBacking):
+ (WebCore::RenderLayerCompositor::updateCompositingLayers):
+ * rendering/RenderProgress.cpp:
+ (WebCore::RenderProgress::animationProgress):
+ (WebCore::RenderProgress::updateAnimationState):
+ * svg/animation/SMILTimeContainer.cpp:
+ (WebCore::SMILTimeContainer::elapsed):
+ (WebCore::SMILTimeContainer::begin):
+ (WebCore::SMILTimeContainer::pause):
+ (WebCore::SMILTimeContainer::resume):
+ (WebCore::SMILTimeContainer::setElapsed):
+
2013-08-27 Robert Hogan <robert@webkit.org>
cell width / offsetTop incorrect
}
CachedPage::CachedPage(Page* page)
- : m_timeStamp(currentTime())
+ : m_timeStamp(monotonicallyIncreasingTime())
, m_expirationTime(m_timeStamp + page->settings().backForwardCacheExpirationInterval())
, m_cachedMainFrame(CachedFrame::create(&page->mainFrame()))
, m_needStyleRecalcForVisitedLinks(false)
bool CachedPage::hasExpired() const
{
- return currentTime() > m_expirationTime;
+ return monotonicallyIncreasingTime() > m_expirationTime;
}
} // namespace WebCore
void checkForYieldBeforeToken(PumpSession& session)
{
if (session.processedTokens > m_parserChunkSize || session.didSeeScript) {
- // currentTime() can be expensive. By delaying, we avoided calling
- // currentTime() when constructing non-yielding PumpSessions.
+ // monotonicallyIncreasingTime() can be expensive. By delaying, we avoided calling
+ // monotonicallyIncreasingTime() when constructing non-yielding PumpSessions.
if (!session.startTime)
session.startTime = monotonicallyIncreasingTime();
} else
expiryDelta = defaultPreflightCacheTimeoutSeconds;
- m_absoluteExpiryTime = currentTime() + expiryDelta;
+ m_absoluteExpiryTime = monotonicallyIncreasingTime() + expiryDelta;
return true;
}
bool CrossOriginPreflightResultCacheItem::allowsRequest(StoredCredentials includeCredentials, const String& method, const HTTPHeaderMap& requestHeaders) const
{
String ignoredExplanation;
- if (m_absoluteExpiryTime < currentTime())
+ if (m_absoluteExpiryTime < monotonicallyIncreasingTime())
return false;
if (includeCredentials == AllowStoredCredentials && m_credentials == DoNotAllowStoredCredentials)
return false;
provisionalLoadStarted();
else if (newState == FrameStateComplete) {
frameLoadCompleted();
- storedTimeOfLastCompletedLoad = currentTime();
+ storedTimeOfLastCompletedLoad = monotonicallyIncreasingTime();
if (m_documentLoader)
m_documentLoader->stopRecordingResponses();
}
m_totalBytesReceived += bytesReceived;
- double now = currentTime();
+ double now = monotonicallyIncreasingTime();
double notifiedProgressTimeDelta = now - m_lastNotifiedProgressTime;
LOG(Progress, "Progress incremented (%p) - value %f, tracked frames %d", this, m_progressValue, m_numProgressTrackedFrames);
if (m_parsedStyleSheetCache->parserContext() != context)
return 0;
- didAccessDecodedData(currentTime());
+ didAccessDecodedData(monotonicallyIncreasingTime());
return m_parsedStyleSheetCache;
}
double timeStamp = FrameView::currentPaintTimeStamp();
if (!timeStamp) // If didDraw is called outside of a Frame paint.
- timeStamp = currentTime();
+ timeStamp = monotonicallyIncreasingTime();
CachedResource::didAccessDecodedData(timeStamp);
}
double currentTime = FrameView::currentPaintTimeStamp();
if (!currentTime) // In case prune is called directly, outside of a Frame paint.
- currentTime = WTF::currentTime();
+ currentTime = monotonicallyIncreasingTime();
// Destroy any decoded data in live objects that we can.
// Start from the tail, since this is the least recently accessed of the objects.
LOG(IconDatabase, "(THREAD) IconDatabase sync thread started");
#if !LOG_DISABLED
- double startTime = currentTime();
+ double startTime = monotonicallyIncreasingTime();
#endif
// Need to create the database path if it doesn't already exist
}
#if !LOG_DISABLED
- double timeStamp = currentTime();
+ double timeStamp = monotonicallyIncreasingTime();
LOG(IconDatabase, "(THREAD) Open took %.4f seconds", timeStamp - startTime);
#endif
}
#if !LOG_DISABLED
- double newStamp = currentTime();
+ double newStamp = monotonicallyIncreasingTime();
LOG(IconDatabase, "(THREAD) performOpenInitialization() took %.4f seconds, now %.4f seconds from thread start", newStamp - timeStamp, newStamp - startTime);
timeStamp = newStamp;
#endif
// Uncomment the following line to simulate a long lasting URL import (*HUGE* icon databases, or network home directories)
- // while (currentTime() - timeStamp < 10);
+ // while (monotonicallyIncreasingTime() - timeStamp < 10);
// Read in URL mappings from the database
LOG(IconDatabase, "(THREAD) Starting iconURL import");
}
#if !LOG_DISABLED
- newStamp = currentTime();
+ newStamp = monotonicallyIncreasingTime();
LOG(IconDatabase, "(THREAD) performURLImport() took %.4f seconds. Entering main loop %.4f seconds from thread start", newStamp - timeStamp, newStamp - startTime);
#endif
m_syncLock.unlock();
#if !LOG_DISABLED
- double timeStamp = currentTime();
+ double timeStamp = monotonicallyIncreasingTime();
#endif
LOG(IconDatabase, "(THREAD) Main work loop starting");
static bool prunedUnretainedIcons = false;
if (didWrite && !m_privateBrowsingEnabled && !prunedUnretainedIcons && !databaseCleanupCounter) {
#if !LOG_DISABLED
- double time = currentTime();
+ double time = monotonicallyIncreasingTime();
#endif
LOG(IconDatabase, "(THREAD) Starting pruneUnretainedIcons()");
pruneUnretainedIcons();
- LOG(IconDatabase, "(THREAD) pruneUnretainedIcons() took %.4f seconds", currentTime() - time);
+ LOG(IconDatabase, "(THREAD) pruneUnretainedIcons() took %.4f seconds", monotonicallyIncreasingTime() - time);
// If pruneUnretainedIcons() returned early due to requested thread termination, its still okay
// to mark prunedUnretainedIcons true because we're about to terminate anyway
}
#if !LOG_DISABLED
- double newstamp = currentTime();
+ double newstamp = monotonicallyIncreasingTime();
LOG(IconDatabase, "(THREAD) Main work loop ran for %.4f seconds, %s requested to terminate", newstamp - timeStamp, shouldStopThreadActivity() ? "was" : "was not");
#endif
ASSERT_ICON_SYNC_THREAD();
#if !LOG_DISABLED
- double timeStamp = currentTime();
+ double timeStamp = monotonicallyIncreasingTime();
#endif
bool didAnyWork = false;
return didAnyWork;
}
- LOG(IconDatabase, "Reading from database took %.4f seconds", currentTime() - timeStamp);
+ LOG(IconDatabase, "Reading from database took %.4f seconds", monotonicallyIncreasingTime() - timeStamp);
return didAnyWork;
}
ASSERT_ICON_SYNC_THREAD();
#if !LOG_DISABLED
- double timeStamp = currentTime();
+ double timeStamp = monotonicallyIncreasingTime();
#endif
bool didAnyWork = false;
if (didAnyWork)
checkForDanglingPageURLs(false);
- LOG(IconDatabase, "Updating the database took %.4f seconds", currentTime() - timeStamp);
+ LOG(IconDatabase, "Updating the database took %.4f seconds", monotonicallyIncreasingTime() - timeStamp);
return didAnyWork;
}
ASSERT_ICON_SYNC_THREAD();
#if !LOG_DISABLED
- double timeStamp = currentTime();
+ double timeStamp = monotonicallyIncreasingTime();
#endif
// If the removeIcons flag is set, remove all icons from the db.
m_syncDB.close();
#if !LOG_DISABLED
- LOG(IconDatabase, "(THREAD) Final closure took %.4f seconds", currentTime() - timeStamp);
+ LOG(IconDatabase, "(THREAD) Final closure took %.4f seconds", monotonicallyIncreasingTime() - timeStamp);
#endif
m_syncThreadRunning = false;
// If we haven't started yet, make it as if we started.
LOG(Animations, "%p AnimationState %s -> StartWaitResponse", this, nameForState(m_animState));
m_animState = AnimationStateStartWaitResponse;
- onAnimationStartResponse(currentTime());
+ onAnimationStartResponse(monotonicallyIncreasingTime());
}
ASSERT(m_startTime); // if m_startTime is zero, we haven't started yet, so we'll get a bad pause time.
double AnimationControllerPrivate::beginAnimationUpdateTime()
{
if (m_beginAnimationUpdateTime == cBeginAnimationUpdateTimeNotSet)
- m_beginAnimationUpdateTime = currentTime();
+ m_beginAnimationUpdateTime = monotonicallyIncreasingTime();
return m_beginAnimationUpdateTime;
}
return m_pauseTime;
double oldLastRefreshedTime = m_lastRefreshedTime;
- m_lastRefreshedTime = WTF::currentTime();
+ m_lastRefreshedTime = monotonicallyIncreasingTime();
m_totalRunningTime += m_lastRefreshedTime - oldLastRefreshedTime;
return m_totalRunningTime;
}
{
setState(PlayingState);
m_totalRunningTime = m_pauseTime;
- m_lastRefreshedTime = WTF::currentTime();
+ m_lastRefreshedTime = monotonicallyIncreasingTime();
}
void GraphicsLayerAnimations::add(const GraphicsLayerAnimation& animation)
return 0;
#if !LOG_DISABLED
- double start = WTF::currentTime();
+ double start = monotonicallyIncreasingTime();
#endif
AVCFAssetImageGeneratorSetMaximumSize(m_imageGenerator.get(), CGSize(rect.size()));
CGImageRef image = AVCFAssetImageGeneratorCopyCGImageAtTime(m_imageGenerator.get(), CMTimeMakeWithSeconds(time, 600), 0, 0);
#if !LOG_DISABLED
- double duration = WTF::currentTime() - start;
+ double duration = monotonicallyIncreasingTime() - start;
LOG(Media, "AVFWrapper::createImageForTimeInRect(%p) - creating image took %.4f", this, narrowPrecisionToFloat(duration));
#endif
ASSERT(m_imageGenerator);
#if !LOG_DISABLED
- double start = WTF::currentTime();
+ double start = monotonicallyIncreasingTime();
#endif
[m_imageGenerator.get() setMaximumSize:CGSize(rect.size())];
RetainPtr<CGImageRef> image = adoptCF([m_imageGenerator.get() copyCGImageAtTime:CMTimeMakeWithSeconds(time, 600) actualTime:nil error:nil]);
#if !LOG_DISABLED
- double duration = WTF::currentTime() - start;
+ double duration = monotonicallyIncreasingTime() - start;
LOG(Media, "MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect(%p) - creating image took %.4f", this, narrowPrecisionToFloat(duration));
#endif
ASSERT(m_videoOutput);
#if !LOG_DISABLED
- double start = WTF::currentTime();
+ double start = monotonicallyIncreasingTime();
#endif
CMTime currentTime = [m_avPlayerItem.get() currentTime];
#endif
#if !LOG_DISABLED
- double duration = WTF::currentTime() - start;
+ double duration = monotonicallyIncreasingTime() - start;
LOG(Media, "MediaPlayerPrivateAVFoundationObjC::createPixelBuffer() - creating buffer took %.4f", this, narrowPrecisionToFloat(duration));
#endif
void GraphicsLayerCA::suspendAnimations(double time)
{
- double t = PlatformCALayer::currentTimeToMediaTime(time ? time : currentTime());
+ double t = PlatformCALayer::currentTimeToMediaTime(time ? time : monotonicallyIncreasingTime());
primaryLayer()->setSpeed(0);
primaryLayer()->setTimeOffset(t);
class PlatformCALayer : public RefCounted<PlatformCALayer> {
public:
- static CFTimeInterval currentTimeToMediaTime(double t) { return CACurrentMediaTime() + t - WTF::currentTime(); }
+ static CFTimeInterval currentTimeToMediaTime(double t) { return CACurrentMediaTime() + t - monotonicallyIncreasingTime(); }
// LayerTypeRootLayer is used on some platforms. It has no backing store, so setNeedsDisplay
// should not call CACFLayerSetNeedsDisplay, but rather just notify the renderer that it
listOfLayersWithSize(layerSize).prepend(layer);
m_totalBytes += backingStoreBytesForSize(layerSize);
- m_lastAddTime = currentTime();
+ m_lastAddTime = monotonicallyIncreasingTime();
schedulePrune();
}
unsigned LayerPool::decayedCapacity() const
{
// Decay to one quarter over capacityDecayTime
- double timeSinceLastAdd = currentTime() - m_lastAddTime;
+ double timeSinceLastAdd = monotonicallyIncreasingTime() - m_lastAddTime;
if (timeSinceLastAdd > capacityDecayTime)
return m_maxBytesForPool / 4;
float decayProgess = float(timeSinceLastAdd / capacityDecayTime);
// still have a backing store.
oldestReuseList.remove(--oldestReuseList.end());
}
- if (currentTime() - m_lastAddTime <= capacityDecayTime)
+ if (monotonicallyIncreasingTime() - m_lastAddTime <= capacityDecayTime)
schedulePrune();
}
static double mediaTimeToCurrentTime(CFTimeInterval t)
{
- return WTF::currentTime() + t - CACurrentMediaTime();
+ return monotonicallyIncreasingTime() + t - CACurrentMediaTime();
}
// Delegate for animationDidStart callback
// Send currentTime to the pending animations. This function is called by CACF in a callback
// which occurs after the drawInContext calls. So currentTime is very close to the time
// the animations actually start
- double currentTime = WTF::currentTime();
+ double currentTime = monotonicallyIncreasingTime();
HashSet<RefPtr<PlatformCALayer> >::iterator end = m_pendingAnimatedLayers.end();
for (HashSet<RefPtr<PlatformCALayer> >::iterator it = m_pendingAnimatedLayers.begin(); it != end; ++it)
// Print heading info
CGRect rootBounds = bounds();
fprintf(stderr, "\n\n** Render tree at time %g (bounds %g, %g %gx%g) **\n\n",
- currentTime(), rootBounds.origin.x, rootBounds.origin.y, rootBounds.size.width, rootBounds.size.height);
+ monotonicallyIncreasingTime(), rootBounds.origin.x, rootBounds.origin.y, rootBounds.size.width, rootBounds.size.height);
// Print layer tree from the root
printLayer(this, 0);
if (valueList.property() == AnimatedPropertyWebkitTransform)
listsMatch = validateTransformOperations(valueList, hasBigRotation) >= 0;
- const double currentTime = WTF::currentTime();
+ const double currentTime = monotonicallyIncreasingTime();
m_animations.add(GraphicsLayerAnimation(keyframesName, valueList, boxSize, anim, currentTime - timeOffset, listsMatch));
// m_animationStartTime is the time of the first real frame of animation, now or delayed by a negative offset.
if (timeOffset > 0)
m_fpsInterval = showFPSEnvironment.toDouble(&ok);
if (ok && m_fpsInterval) {
m_isShowingFPS = true;
- m_fpsTimestamp = WTF::currentTime();
+ m_fpsTimestamp = monotonicallyIncreasingTime();
}
}
return;
m_frameCount++;
- double delta = WTF::currentTime() - m_fpsTimestamp;
+ double delta = monotonicallyIncreasingTime() - m_fpsTimestamp;
if (delta >= m_fpsInterval) {
m_lastFPS = int(m_frameCount / delta);
m_frameCount = 0;
if (valueList.property() == AnimatedPropertyWebkitTransform)
listsMatch = validateTransformOperations(valueList, ignoredHasBigRotation) >= 0;
- m_lastAnimationStartTime = WTF::currentTime() - delayAsNegativeTimeOffset;
+ m_lastAnimationStartTime = monotonicallyIncreasingTime() - delayAsNegativeTimeOffset;
m_animations.add(GraphicsLayerAnimation(keyframesName, valueList, boxSize, anim, m_lastAnimationStartTime, listsMatch));
m_animationStartedTimer.startOneShot(0);
didChangeAnimations();
bool DNSResolveQueue::isUsingProxy()
{
- double time = currentTime();
+ double time = monotonicallyIncreasingTime();
static const double minimumProxyCheckDelay = 5;
if (time - m_lastProxyEnabledStatusCheckTime > minimumProxyCheckDelay) {
m_lastProxyEnabledStatusCheckTime = time;
// If it has been more than MessageDirectProcessingInterval between throttled messages,
// go ahead and process a message directly.
- double currentTime = WTF::currentTime();
+ double currentTime = monotonicallyIncreasingTime();
if (currentTime - m_lastMessageTime > MessageDirectProcessingInterval) {
processQueuedMessage();
m_lastMessageTime = currentTime;
void RenderLayerCompositor::didPaintBacking(RenderLayerBacking*)
{
FrameView& frameView = m_renderView.frameView();
- frameView.setLastPaintTime(currentTime());
+ frameView.setLastPaintTime(monotonicallyIncreasingTime());
if (frameView.milestonesPendingPaint() && !m_paintRelatedMilestonesTimer.isActive())
m_paintRelatedMilestonesTimer.startOneShot(0);
}
double startTime = 0;
if (compositingLogEnabled()) {
++m_rootLayerUpdateCount;
- startTime = currentTime();
+ startTime = monotonicallyIncreasingTime();
}
#endif
#if !LOG_DISABLED
if (compositingLogEnabled() && isFullUpdate && (needHierarchyUpdate || needGeometryUpdate)) {
- double endTime = currentTime();
+ double endTime = monotonicallyIncreasingTime();
LOG(Compositing, "Total layers primary secondary obligatory backing (KB) secondary backing(KB) total backing (KB) update time (ms)\n");
LOG(Compositing, "%8d %11d %9d %20.2f %22.2f %22.2f %18.2f\n",
double RenderProgress::animationProgress() const
{
- return m_animating ? (fmod((currentTime() - m_animationStartTime), m_animationDuration) / m_animationDuration) : 0;
+ return m_animating ? (fmod((monotonicallyIncreasingTime() - m_animationStartTime), m_animationDuration) / m_animationDuration) : 0;
}
bool RenderProgress::isDeterminate() const
m_animating = animating;
if (m_animating) {
- m_animationStartTime = currentTime();
+ m_animationStartTime = monotonicallyIncreasingTime();
m_animationTimer.startOneShot(m_animationRepeatInterval);
} else
m_animationTimer.stop();
{
if (!m_beginTime)
return 0;
- return currentTime() - m_beginTime - m_accumulatedPauseTime;
+ return monotonicallyIncreasingTime() - m_beginTime - m_accumulatedPauseTime;
}
bool SMILTimeContainer::isActive() const
void SMILTimeContainer::begin()
{
ASSERT(!m_beginTime);
- double now = currentTime();
+ double now = monotonicallyIncreasingTime();
// If 'm_presetStartTime' is set, the timeline was modified via setElapsed() before the document began.
// In this case pass on 'seekToTime=true' to updateAnimations().
void SMILTimeContainer::pause()
{
ASSERT(!isPaused());
- m_pauseTime = currentTime();
+ m_pauseTime = monotonicallyIncreasingTime();
if (m_beginTime)
m_timer.stop();
ASSERT(isPaused());
if (m_beginTime)
- m_accumulatedPauseTime += currentTime() - m_pauseTime;
+ m_accumulatedPauseTime += monotonicallyIncreasingTime() - m_pauseTime;
m_pauseTime = 0;
startTimer(0);
if (m_beginTime)
m_timer.stop();
- double now = currentTime();
+ double now = monotonicallyIncreasingTime();
m_beginTime = now - time.value();
m_accumulatedPauseTime = 0;