Title: [163536] trunk/Source/WTF
Revision
163536
Author
[email protected]
Date
2014-02-06 09:03:16 -0800 (Thu, 06 Feb 2014)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (163535 => 163536)


--- trunk/Source/WTF/ChangeLog	2014-02-06 16:50:47 UTC (rev 163535)
+++ trunk/Source/WTF/ChangeLog	2014-02-06 17:03:16 UTC (rev 163536)
@@ -1,3 +1,13 @@
+2014-02-06  Anders Carlsson  <[email protected]>
+
+        Use std::chrono functions in dispatchFunctionsFromMainThread()
+        https://bugs.webkit.org/show_bug.cgi?id=128308
+
+        Reviewed by Antti Koivisto.
+
+        * wtf/MainThread.cpp:
+        (WTF::dispatchFunctionsFromMainThread):
+
 2014-02-05  Zan Dobersek  <[email protected]>
 
         Remove the WTF_COMPILER_SUPPORTS_CXX_GENERALIZED_INITIALIZERS macro

Modified: trunk/Source/WTF/wtf/MainThread.cpp (163535 => 163536)


--- trunk/Source/WTF/wtf/MainThread.cpp	2014-02-06 16:50:47 UTC (rev 163535)
+++ trunk/Source/WTF/wtf/MainThread.cpp	2014-02-06 17:03:16 UTC (rev 163536)
@@ -142,7 +142,7 @@
 #endif
 
 // 0.1 sec delays in UI is approximate threshold when they become noticeable. Have a limit that's half of that.
-static const double maxRunLoopSuspensionTime = 0.05;
+static const auto maxRunLoopSuspensionTime = std::chrono::milliseconds(50);
 
 void dispatchFunctionsFromMainThread()
 {
@@ -151,7 +151,7 @@
     if (callbacksPaused)
         return;
 
-    double startTime = monotonicallyIncreasingTime();
+    auto startTime = std::chrono::steady_clock::now();
 
     FunctionWithContext invocation;
     while (true) {
@@ -168,7 +168,7 @@
         // yield so the user input can be processed. Otherwise user may not be able to even close the window.
         // This code has effect only in case the scheduleDispatchFunctionsOnMainThread() is implemented in a way that
         // allows input events to be processed before we are back here.
-        if (monotonicallyIncreasingTime() - startTime > maxRunLoopSuspensionTime) {
+        if (std::chrono::steady_clock::now() - startTime > maxRunLoopSuspensionTime) {
             scheduleDispatchFunctionsOnMainThread();
             break;
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to