Changeset 154706 in webkit


Ignore:
Timestamp:
Aug 27, 2013 1:47:27 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Replace currentTime() with monotonicallyIncreasingTime() in WebCore
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.
Location:
trunk/Source
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r154683 r154706  
     12013-08-27  Arunprasad Rajkumar  <arurajku@cisco.com>
     2
     3        Replace currentTime() with monotonicallyIncreasingTime() in WebCore
     4        https://bugs.webkit.org/show_bug.cgi?id=119958
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        WTF::currentTime() is prone to NTP and manual adjustments, so use
     9        WTF::monotonicallyIncreasingTime() to measure elapsed time.
     10
     11        It is a continuation of r154201.
     12
     13        * wtf/CurrentTime.h: Edited comment.
     14
    1152013-08-27  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
    216
  • trunk/Source/WTF/wtf/CurrentTime.h

    r154201 r154706  
    5353// On unsupported platforms, this function only guarantees the result will be non-decreasing.
    5454// Result of this function increases monotonically even when clock time goes back due to
    55 // DST changes or NTP adjustments, so it better suits for elapsed time measurement.
     55// NTP or manual adjustments, so it is better suited for elapsed time measurement.
    5656WTF_EXPORT_PRIVATE double monotonicallyIncreasingTime();
    5757
  • trunk/Source/WebCore/ChangeLog

    r154702 r154706  
     12013-08-27  Arunprasad Rajkumar  <arurajku@cisco.com>
     2
     3        Replace currentTime() with monotonicallyIncreasingTime() in WebCore
     4        https://bugs.webkit.org/show_bug.cgi?id=119958
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        WTF::currentTime() is prone to NTP and manual adjustments, so use
     9        WTF::monotonicallyIncreasingTime() to measure elapsed time.
     10
     11        It is a continuation of r154201.
     12
     13        * history/CachedPage.cpp:
     14        (WebCore::CachedPage::CachedPage):
     15        (WebCore::CachedPage::hasExpired):
     16        * html/parser/HTMLParserScheduler.h:
     17        (WebCore::HTMLParserScheduler::checkForYieldBeforeToken):
     18        * loader/CrossOriginPreflightResultCache.cpp:
     19        (WebCore::CrossOriginPreflightResultCacheItem::parse):
     20        (WebCore::CrossOriginPreflightResultCacheItem::allowsRequest):
     21        * loader/FrameLoader.cpp:
     22        (WebCore::FrameLoader::setState):
     23        * loader/ProgressTracker.cpp:
     24        (WebCore::ProgressTracker::incrementProgress):
     25        * loader/cache/CachedCSSStyleSheet.cpp:
     26        (WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet):
     27        * loader/cache/CachedImage.cpp:
     28        (WebCore::CachedImage::didDraw):
     29        * loader/cache/MemoryCache.cpp:
     30        (WebCore::MemoryCache::pruneLiveResourcesToSize):
     31        * loader/icon/IconDatabase.cpp:
     32        (WebCore::IconDatabase::iconDatabaseSyncThread):
     33        (WebCore::IconDatabase::syncThreadMainLoop):
     34        (WebCore::IconDatabase::readFromDatabase):
     35        (WebCore::IconDatabase::writeToDatabase):
     36        (WebCore::IconDatabase::cleanupSyncThread):
     37        * page/animation/AnimationBase.cpp:
     38        (WebCore::AnimationBase::freezeAtTime):
     39        * page/animation/AnimationController.cpp:
     40        (WebCore::AnimationControllerPrivate::beginAnimationUpdateTime):
     41        * platform/graphics/GraphicsLayerAnimation.cpp:
     42        (WebCore::GraphicsLayerAnimation::computeTotalRunningTime):
     43        (WebCore::GraphicsLayerAnimation::resume):
     44        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
     45        (WebCore::AVFWrapper::createImageForTimeInRect):
     46        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
     47        (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
     48        (WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer):
     49        * platform/graphics/ca/GraphicsLayerCA.cpp:
     50        (WebCore::GraphicsLayerCA::suspendAnimations):
     51        * platform/graphics/ca/PlatformCALayer.h:
     52        (WebCore::PlatformCALayer::currentTimeToMediaTime):
     53        * platform/graphics/ca/mac/LayerPool.mm:
     54        (WebCore::LayerPool::addLayer):
     55        (WebCore::LayerPool::decayedCapacity):
     56        (WebCore::LayerPool::pruneTimerFired):
     57        * platform/graphics/ca/mac/PlatformCALayerMac.mm:
     58        (mediaTimeToCurrentTime):
     59        * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
     60        (WebCore::CACFLayerTreeHost::notifyAnimationsStarted):
     61        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
     62        (PlatformCALayer::printTree):
     63        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
     64        (WebCore::GraphicsLayerTextureMapper::addAnimation):
     65        * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
     66        (WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
     67        (WebCore::TextureMapperFPSCounter::updateFPSAndDisplay):
     68        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
     69        (WebCore::CoordinatedGraphicsLayer::addAnimation):
     70        * platform/network/DNSResolveQueue.cpp:
     71        (WebCore::DNSResolveQueue::isUsingProxy):
     72        * plugins/win/PluginMessageThrottlerWin.cpp:
     73        (WebCore::PluginMessageThrottlerWin::appendMessage):
     74        * rendering/RenderLayerCompositor.cpp:
     75        (WebCore::RenderLayerCompositor::didPaintBacking):
     76        (WebCore::RenderLayerCompositor::updateCompositingLayers):
     77        * rendering/RenderProgress.cpp:
     78        (WebCore::RenderProgress::animationProgress):
     79        (WebCore::RenderProgress::updateAnimationState):
     80        * svg/animation/SMILTimeContainer.cpp:
     81        (WebCore::SMILTimeContainer::elapsed):
     82        (WebCore::SMILTimeContainer::begin):
     83        (WebCore::SMILTimeContainer::pause):
     84        (WebCore::SMILTimeContainer::resume):
     85        (WebCore::SMILTimeContainer::setElapsed):
     86
    1872013-08-27  Robert Hogan  <robert@webkit.org>
    288
  • trunk/Source/WebCore/history/CachedPage.cpp

    r154678 r154706  
    5252
    5353CachedPage::CachedPage(Page* page)
    54     : m_timeStamp(currentTime())
     54    : m_timeStamp(monotonicallyIncreasingTime())
    5555    , m_expirationTime(m_timeStamp + page->settings().backForwardCacheExpirationInterval())
    5656    , m_cachedMainFrame(CachedFrame::create(&page->mainFrame()))
     
    130130bool CachedPage::hasExpired() const
    131131{
    132     return currentTime() > m_expirationTime;
     132    return monotonicallyIncreasingTime() > m_expirationTime;
    133133}
    134134
  • trunk/Source/WebCore/html/parser/HTMLParserScheduler.h

    r154201 r154706  
    7171    {
    7272        if (session.processedTokens > m_parserChunkSize || session.didSeeScript) {
    73             // currentTime() can be expensive. By delaying, we avoided calling
    74             // currentTime() when constructing non-yielding PumpSessions.
     73            // monotonicallyIncreasingTime() can be expensive. By delaying, we avoided calling
     74            // monotonicallyIncreasingTime() when constructing non-yielding PumpSessions.
    7575            if (!session.startTime)
    7676                session.startTime = monotonicallyIncreasingTime();
  • trunk/Source/WebCore/loader/CrossOriginPreflightResultCache.cpp

    r130612 r154706  
    109109        expiryDelta = defaultPreflightCacheTimeoutSeconds;
    110110
    111     m_absoluteExpiryTime = currentTime() + expiryDelta;
     111    m_absoluteExpiryTime = monotonicallyIncreasingTime() + expiryDelta;
    112112    return true;
    113113}
     
    137137{
    138138    String ignoredExplanation;
    139     if (m_absoluteExpiryTime < currentTime())
     139    if (m_absoluteExpiryTime < monotonicallyIncreasingTime())
    140140        return false;
    141141    if (includeCredentials == AllowStoredCredentials && m_credentials == DoNotAllowStoredCredentials)
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r154658 r154706  
    16841684    else if (newState == FrameStateComplete) {
    16851685        frameLoadCompleted();
    1686         storedTimeOfLastCompletedLoad = currentTime();
     1686        storedTimeOfLastCompletedLoad = monotonicallyIncreasingTime();
    16871687        if (m_documentLoader)
    16881688            m_documentLoader->stopRecordingResponses();
  • trunk/Source/WebCore/loader/ProgressTracker.cpp

    r154558 r154706  
    242242    m_totalBytesReceived += bytesReceived;
    243243   
    244     double now = currentTime();
     244    double now = monotonicallyIncreasingTime();
    245245    double notifiedProgressTimeDelta = now - m_lastNotifiedProgressTime;
    246246   
  • trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp

    r151586 r154706  
    174174        return 0;
    175175
    176     didAccessDecodedData(currentTime());
     176    didAccessDecodedData(monotonicallyIncreasingTime());
    177177
    178178    return m_parsedStyleSheetCache;
  • trunk/Source/WebCore/loader/cache/CachedImage.cpp

    r154449 r154706  
    469469    double timeStamp = FrameView::currentPaintTimeStamp();
    470470    if (!timeStamp) // If didDraw is called outside of a Frame paint.
    471         timeStamp = currentTime();
     471        timeStamp = monotonicallyIncreasingTime();
    472472   
    473473    CachedResource::didAccessDecodedData(timeStamp);
  • trunk/Source/WebCore/loader/cache/MemoryCache.cpp

    r152080 r154706  
    244244    double currentTime = FrameView::currentPaintTimeStamp();
    245245    if (!currentTime) // In case prune is called directly, outside of a Frame paint.
    246         currentTime = WTF::currentTime();
     246        currentTime = monotonicallyIncreasingTime();
    247247   
    248248    // Destroy any decoded data in live objects that we can.
  • trunk/Source/WebCore/loader/icon/IconDatabase.cpp

    r154023 r154706  
    990990
    991991#if !LOG_DISABLED
    992     double startTime = currentTime();
     992    double startTime = monotonicallyIncreasingTime();
    993993#endif
    994994
     
    10181018       
    10191019#if !LOG_DISABLED
    1020     double timeStamp = currentTime();
     1020    double timeStamp = monotonicallyIncreasingTime();
    10211021    LOG(IconDatabase, "(THREAD) Open took %.4f seconds", timeStamp - startTime);
    10221022#endif   
     
    10291029       
    10301030#if !LOG_DISABLED
    1031     double newStamp = currentTime();
     1031    double newStamp = monotonicallyIncreasingTime();
    10321032    LOG(IconDatabase, "(THREAD) performOpenInitialization() took %.4f seconds, now %.4f seconds from thread start", newStamp - timeStamp, newStamp - startTime);
    10331033    timeStamp = newStamp;
     
    10351035       
    10361036    // Uncomment the following line to simulate a long lasting URL import (*HUGE* icon databases, or network home directories)
    1037     // while (currentTime() - timeStamp < 10);
     1037    // while (monotonicallyIncreasingTime() - timeStamp < 10);
    10381038
    10391039    // Read in URL mappings from the database         
     
    10471047
    10481048#if !LOG_DISABLED
    1049     newStamp = currentTime();
     1049    newStamp = monotonicallyIncreasingTime();
    10501050    LOG(IconDatabase, "(THREAD) performURLImport() took %.4f seconds.  Entering main loop %.4f seconds from thread start", newStamp - timeStamp, newStamp - startTime);
    10511051#endif
     
    13751375
    13761376#if !LOG_DISABLED
    1377         double timeStamp = currentTime();
     1377        double timeStamp = monotonicallyIncreasingTime();
    13781378#endif
    13791379        LOG(IconDatabase, "(THREAD) Main work loop starting");
     
    14131413            if (didWrite && !m_privateBrowsingEnabled && !prunedUnretainedIcons && !databaseCleanupCounter) {
    14141414#if !LOG_DISABLED
    1415                 double time = currentTime();
     1415                double time = monotonicallyIncreasingTime();
    14161416#endif
    14171417                LOG(IconDatabase, "(THREAD) Starting pruneUnretainedIcons()");
     
    14191419                pruneUnretainedIcons();
    14201420               
    1421                 LOG(IconDatabase, "(THREAD) pruneUnretainedIcons() took %.4f seconds", currentTime() - time);
     1421                LOG(IconDatabase, "(THREAD) pruneUnretainedIcons() took %.4f seconds", monotonicallyIncreasingTime() - time);
    14221422               
    14231423                // If pruneUnretainedIcons() returned early due to requested thread termination, its still okay
     
    14321432       
    14331433#if !LOG_DISABLED
    1434         double newstamp = currentTime();
     1434        double newstamp = monotonicallyIncreasingTime();
    14351435        LOG(IconDatabase, "(THREAD) Main work loop ran for %.4f seconds, %s requested to terminate", newstamp - timeStamp, shouldStopThreadActivity() ? "was" : "was not");
    14361436#endif
     
    15141514   
    15151515#if !LOG_DISABLED
    1516     double timeStamp = currentTime();
     1516    double timeStamp = monotonicallyIncreasingTime();
    15171517#endif
    15181518
     
    16081608    }
    16091609
    1610     LOG(IconDatabase, "Reading from database took %.4f seconds", currentTime() - timeStamp);
     1610    LOG(IconDatabase, "Reading from database took %.4f seconds", monotonicallyIncreasingTime() - timeStamp);
    16111611
    16121612    return didAnyWork;
     
    16181618
    16191619#if !LOG_DISABLED
    1620     double timeStamp = currentTime();
     1620    double timeStamp = monotonicallyIncreasingTime();
    16211621#endif
    16221622
     
    16681668        checkForDanglingPageURLs(false);
    16691669
    1670     LOG(IconDatabase, "Updating the database took %.4f seconds", currentTime() - timeStamp);
     1670    LOG(IconDatabase, "Updating the database took %.4f seconds", monotonicallyIncreasingTime() - timeStamp);
    16711671
    16721672    return didAnyWork;
     
    18231823   
    18241824#if !LOG_DISABLED
    1825     double timeStamp = currentTime();
     1825    double timeStamp = monotonicallyIncreasingTime();
    18261826#endif
    18271827
     
    18431843   
    18441844#if !LOG_DISABLED
    1845     LOG(IconDatabase, "(THREAD) Final closure took %.4f seconds", currentTime() - timeStamp);
     1845    LOG(IconDatabase, "(THREAD) Final closure took %.4f seconds", monotonicallyIncreasingTime() - timeStamp);
    18461846#endif
    18471847   
  • trunk/Source/WebCore/page/animation/AnimationBase.cpp

    r149576 r154706  
    651651        LOG(Animations, "%p AnimationState %s -> StartWaitResponse", this, nameForState(m_animState));
    652652        m_animState = AnimationStateStartWaitResponse;
    653         onAnimationStartResponse(currentTime());
     653        onAnimationStartResponse(monotonicallyIncreasingTime());
    654654    }
    655655
  • trunk/Source/WebCore/page/animation/AnimationController.cpp

    r154580 r154706  
    366366{
    367367    if (m_beginAnimationUpdateTime == cBeginAnimationUpdateTimeNotSet)
    368         m_beginAnimationUpdateTime = currentTime();
     368        m_beginAnimationUpdateTime = monotonicallyIncreasingTime();
    369369    return m_beginAnimationUpdateTime;
    370370}
  • trunk/Source/WebCore/platform/graphics/GraphicsLayerAnimation.cpp

    r149694 r154706  
    324324
    325325    double oldLastRefreshedTime = m_lastRefreshedTime;
    326     m_lastRefreshedTime = WTF::currentTime();
     326    m_lastRefreshedTime = monotonicallyIncreasingTime();
    327327    m_totalRunningTime += m_lastRefreshedTime - oldLastRefreshedTime;
    328328    return m_totalRunningTime;
     
    339339    setState(PlayingState);
    340340    m_totalRunningTime = m_pauseTime;
    341     m_lastRefreshedTime = WTF::currentTime();
     341    m_lastRefreshedTime = monotonicallyIncreasingTime();
    342342}
    343343
  • trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp

    r154694 r154706  
    16331633
    16341634#if !LOG_DISABLED
    1635     double start = WTF::currentTime();
     1635    double start = monotonicallyIncreasingTime();
    16361636#endif
    16371637
     
    16401640
    16411641#if !LOG_DISABLED
    1642     double duration = WTF::currentTime() - start;
     1642    double duration = monotonicallyIncreasingTime() - start;
    16431643    LOG(Media, "AVFWrapper::createImageForTimeInRect(%p) - creating image took %.4f", this, narrowPrecisionToFloat(duration));
    16441644#endif
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r154647 r154706  
    851851
    852852#if !LOG_DISABLED
    853     double start = WTF::currentTime();
     853    double start = monotonicallyIncreasingTime();
    854854#endif
    855855
     
    858858
    859859#if !LOG_DISABLED
    860     double duration = WTF::currentTime() - start;
     860    double duration = monotonicallyIncreasingTime() - start;
    861861    LOG(Media, "MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect(%p) - creating image took %.4f", this, narrowPrecisionToFloat(duration));
    862862#endif
     
    11401140
    11411141#if !LOG_DISABLED
    1142     double start = WTF::currentTime();
     1142    double start = monotonicallyIncreasingTime();
    11431143#endif
    11441144
     
    11671167
    11681168#if !LOG_DISABLED
    1169     double duration = WTF::currentTime() - start;
     1169    double duration = monotonicallyIncreasingTime() - start;
    11701170    LOG(Media, "MediaPlayerPrivateAVFoundationObjC::createPixelBuffer() - creating buffer took %.4f", this, narrowPrecisionToFloat(duration));
    11711171#endif
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r154470 r154706  
    25322532void GraphicsLayerCA::suspendAnimations(double time)
    25332533{
    2534     double t = PlatformCALayer::currentTimeToMediaTime(time ? time : currentTime());
     2534    double t = PlatformCALayer::currentTimeToMediaTime(time ? time : monotonicallyIncreasingTime());
    25352535    primaryLayer()->setSpeed(0);
    25362536    primaryLayer()->setTimeOffset(t);
  • trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h

    r154314 r154706  
    5252class PlatformCALayer : public RefCounted<PlatformCALayer> {
    5353public:
    54     static CFTimeInterval currentTimeToMediaTime(double t) { return CACurrentMediaTime() + t - WTF::currentTime(); }
     54    static CFTimeInterval currentTimeToMediaTime(double t) { return CACurrentMediaTime() + t - monotonicallyIncreasingTime(); }
    5555
    5656    // LayerTypeRootLayer is used on some platforms. It has no backing store, so setNeedsDisplay
  • trunk/Source/WebCore/platform/graphics/ca/mac/LayerPool.mm

    r136298 r154706  
    7676    m_totalBytes += backingStoreBytesForSize(layerSize);
    7777   
    78     m_lastAddTime = currentTime();
     78    m_lastAddTime = monotonicallyIncreasingTime();
    7979    schedulePrune();
    8080}
     
    9494{
    9595    // Decay to one quarter over capacityDecayTime
    96     double timeSinceLastAdd = currentTime() - m_lastAddTime;
     96    double timeSinceLastAdd = monotonicallyIncreasingTime() - m_lastAddTime;
    9797    if (timeSinceLastAdd > capacityDecayTime)
    9898        return m_maxBytesForPool / 4;
     
    126126        oldestReuseList.remove(--oldestReuseList.end());
    127127    }
    128     if (currentTime() - m_lastAddTime <= capacityDecayTime)
     128    if (monotonicallyIncreasingTime() - m_lastAddTime <= capacityDecayTime)
    129129        schedulePrune();
    130130}
  • trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm

    r154314 r154706  
    6262static double mediaTimeToCurrentTime(CFTimeInterval t)
    6363{
    64     return WTF::currentTime() + t - CACurrentMediaTime();
     64    return monotonicallyIncreasingTime() + t - CACurrentMediaTime();
    6565}
    6666
  • trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp

    r107603 r154706  
    310310    // which occurs after the drawInContext calls. So currentTime is very close to the time
    311311    // the animations actually start
    312     double currentTime = WTF::currentTime();
     312    double currentTime = monotonicallyIncreasingTime();
    313313
    314314    HashSet<RefPtr<PlatformCALayer> >::iterator end = m_pendingAnimatedLayers.end();
  • trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp

    r154180 r154706  
    772772    CGRect rootBounds = bounds();
    773773    fprintf(stderr, "\n\n** Render tree at time %g (bounds %g, %g %gx%g) **\n\n",
    774         currentTime(), rootBounds.origin.x, rootBounds.origin.y, rootBounds.size.width, rootBounds.size.height);
     774        monotonicallyIncreasingTime(), rootBounds.origin.x, rootBounds.origin.y, rootBounds.size.width, rootBounds.size.height);
    775775
    776776    // Print layer tree from the root
  • trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp

    r153408 r154706  
    639639        listsMatch = validateTransformOperations(valueList, hasBigRotation) >= 0;
    640640
    641     const double currentTime = WTF::currentTime();
     641    const double currentTime = monotonicallyIncreasingTime();
    642642    m_animations.add(GraphicsLayerAnimation(keyframesName, valueList, boxSize, anim, currentTime - timeOffset, listsMatch));
    643643    // m_animationStartTime is the time of the first real frame of animation, now or delayed by a negative offset.
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperFPSCounter.cpp

    r149813 r154706  
    4343    if (ok && m_fpsInterval) {
    4444        m_isShowingFPS = true;
    45         m_fpsTimestamp = WTF::currentTime();
     45        m_fpsTimestamp = monotonicallyIncreasingTime();
    4646    }
    4747}
     
    5353
    5454    m_frameCount++;
    55     double delta = WTF::currentTime() - m_fpsTimestamp;
     55    double delta = monotonicallyIncreasingTime() - m_fpsTimestamp;
    5656    if (delta >= m_fpsInterval) {
    5757        m_lastFPS = int(m_frameCount / delta);
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp

    r152390 r154706  
    12171217        listsMatch = validateTransformOperations(valueList, ignoredHasBigRotation) >= 0;
    12181218
    1219     m_lastAnimationStartTime = WTF::currentTime() - delayAsNegativeTimeOffset;
     1219    m_lastAnimationStartTime = monotonicallyIncreasingTime() - delayAsNegativeTimeOffset;
    12201220    m_animations.add(GraphicsLayerAnimation(keyframesName, valueList, boxSize, anim, m_lastAnimationStartTime, listsMatch));
    12211221    m_animationStartedTimer.startOneShot(0);
  • trunk/Source/WebCore/platform/network/DNSResolveQueue.cpp

    r132664 r154706  
    5959bool DNSResolveQueue::isUsingProxy()
    6060{
    61     double time = currentTime();
     61    double time = monotonicallyIncreasingTime();
    6262    static const double minimumProxyCheckDelay = 5;
    6363    if (time - m_lastProxyEnabledStatusCheckTime > minimumProxyCheckDelay) {
  • trunk/Source/WebCore/plugins/win/PluginMessageThrottlerWin.cpp

    r95901 r154706  
    8787    // If it has been more than MessageDirectProcessingInterval between throttled messages,
    8888    // go ahead and process a message directly.
    89     double currentTime = WTF::currentTime();
     89    double currentTime = monotonicallyIncreasingTime();
    9090    if (currentTime - m_lastMessageTime > MessageDirectProcessingInterval) {
    9191        processQueuedMessage();
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r154686 r154706  
    416416{
    417417    FrameView& frameView = m_renderView.frameView();
    418     frameView.setLastPaintTime(currentTime());
     418    frameView.setLastPaintTime(monotonicallyIncreasingTime());
    419419    if (frameView.milestonesPendingPaint() && !m_paintRelatedMilestonesTimer.isActive())
    420420        m_paintRelatedMilestonesTimer.startOneShot(0);
     
    547547    if (compositingLogEnabled()) {
    548548        ++m_rootLayerUpdateCount;
    549         startTime = currentTime();
     549        startTime = monotonicallyIncreasingTime();
    550550    }
    551551#endif
     
    599599#if !LOG_DISABLED
    600600    if (compositingLogEnabled() && isFullUpdate && (needHierarchyUpdate || needGeometryUpdate)) {
    601         double endTime = currentTime();
     601        double endTime = monotonicallyIncreasingTime();
    602602        LOG(Compositing, "Total layers   primary   secondary   obligatory backing (KB)   secondary backing(KB)   total backing (KB)  update time (ms)\n");
    603603
  • trunk/Source/WebCore/rendering/RenderProgress.cpp

    r142248 r154706  
    6868double RenderProgress::animationProgress() const
    6969{
    70     return m_animating ? (fmod((currentTime() - m_animationStartTime), m_animationDuration) / m_animationDuration) : 0;
     70    return m_animating ? (fmod((monotonicallyIncreasingTime() - m_animationStartTime), m_animationDuration) / m_animationDuration) : 0;
    7171}
    7272
     
    9595    m_animating = animating;
    9696    if (m_animating) {
    97         m_animationStartTime = currentTime();
     97        m_animationStartTime = monotonicallyIncreasingTime();
    9898        m_animationTimer.startOneShot(m_animationRepeatInterval);
    9999    } else
  • trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp

    r154679 r154706  
    111111    if (!m_beginTime)
    112112        return 0;
    113     return currentTime() - m_beginTime - m_accumulatedPauseTime;
     113    return monotonicallyIncreasingTime() - m_beginTime - m_accumulatedPauseTime;
    114114}
    115115
     
    132132{
    133133    ASSERT(!m_beginTime);
    134     double now = currentTime();
     134    double now = monotonicallyIncreasingTime();
    135135
    136136    // If 'm_presetStartTime' is set, the timeline was modified via setElapsed() before the document began.
     
    149149{
    150150    ASSERT(!isPaused());
    151     m_pauseTime = currentTime();
     151    m_pauseTime = monotonicallyIncreasingTime();
    152152
    153153    if (m_beginTime)
     
    160160
    161161    if (m_beginTime)
    162         m_accumulatedPauseTime += currentTime() - m_pauseTime;
     162        m_accumulatedPauseTime += monotonicallyIncreasingTime() - m_pauseTime;
    163163
    164164    m_pauseTime = 0;
     
    177177        m_timer.stop();
    178178
    179     double now = currentTime();
     179    double now = monotonicallyIncreasingTime();
    180180    m_beginTime = now - time.value();
    181181
Note: See TracChangeset for help on using the changeset viewer.