Changeset 163536 in webkit


Ignore:
Timestamp:
Feb 6, 2014 9:03:16 AM (10 years ago)
Author:
andersca@apple.com
Message:

Use std::chrono functions in dispatchFunctionsFromMainThread()
https://bugs.webkit.org/show_bug.cgi?id=128308

Reviewed by Antti Koivisto.

  • wtf/MainThread.cpp:

(WTF::dispatchFunctionsFromMainThread):

Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r163519 r163536  
     12014-02-06  Anders Carlsson  <andersca@apple.com>
     2
     3        Use std::chrono functions in dispatchFunctionsFromMainThread()
     4        https://bugs.webkit.org/show_bug.cgi?id=128308
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * wtf/MainThread.cpp:
     9        (WTF::dispatchFunctionsFromMainThread):
     10
    1112014-02-05  Zan Dobersek  <zdobersek@igalia.com>
    212
  • trunk/Source/WTF/wtf/MainThread.cpp

    r163288 r163536  
    143143
    144144// 0.1 sec delays in UI is approximate threshold when they become noticeable. Have a limit that's half of that.
    145 static const double maxRunLoopSuspensionTime = 0.05;
     145static const auto maxRunLoopSuspensionTime = std::chrono::milliseconds(50);
    146146
    147147void dispatchFunctionsFromMainThread()
     
    152152        return;
    153153
    154     double startTime = monotonicallyIncreasingTime();
     154    auto startTime = std::chrono::steady_clock::now();
    155155
    156156    FunctionWithContext invocation;
     
    169169        // This code has effect only in case the scheduleDispatchFunctionsOnMainThread() is implemented in a way that
    170170        // allows input events to be processed before we are back here.
    171         if (monotonicallyIncreasingTime() - startTime > maxRunLoopSuspensionTime) {
     171        if (std::chrono::steady_clock::now() - startTime > maxRunLoopSuspensionTime) {
    172172            scheduleDispatchFunctionsOnMainThread();
    173173            break;
Note: See TracChangeset for help on using the changeset viewer.