Title: [88745] trunk/Source
Revision
88745
Author
[email protected]
Date
2011-06-13 18:13:56 -0700 (Mon, 13 Jun 2011)

Log Message

2011-06-13  James Simonsen  <[email protected]>

        Reviewed by James Robinson.

        [Chromium] Implement monotonicallyIncreasingClock()
        https://bugs.webkit.org/show_bug.cgi?id=62162

        * platform/chromium/PlatformBridge.h:
        * platform/chromium/SystemTimeChromium.cpp:
        (WebCore::monotonicallyIncreasingTime): Use Chrome's implementation.
2011-06-13  James Simonsen  <[email protected]>

        Reviewed by James Robinson.

        [Chromium] Implement monotonicallyIncreasingClock()
        https://bugs.webkit.org/show_bug.cgi?id=62162

        * public/WebKitClient.h:
        (WebKit::WebKitClient::monotonicallyIncreasingTime): Added.
        * src/PlatformBridge.cpp:
        (WebCore::PlatformBridge::monotonicallyIncreasingTime): Added.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (88744 => 88745)


--- trunk/Source/WebCore/ChangeLog	2011-06-14 01:10:31 UTC (rev 88744)
+++ trunk/Source/WebCore/ChangeLog	2011-06-14 01:13:56 UTC (rev 88745)
@@ -1,3 +1,14 @@
+2011-06-13  James Simonsen  <[email protected]>
+
+        Reviewed by James Robinson.
+
+        [Chromium] Implement monotonicallyIncreasingClock()
+        https://bugs.webkit.org/show_bug.cgi?id=62162
+
+        * platform/chromium/PlatformBridge.h:
+        * platform/chromium/SystemTimeChromium.cpp:
+        (WebCore::monotonicallyIncreasingTime): Use Chrome's implementation.
+
 2011-06-13  Steve Block  <[email protected]>
 
         Reviewed by Darin Adler.

Modified: trunk/Source/WebCore/platform/chromium/PlatformBridge.h (88744 => 88745)


--- trunk/Source/WebCore/platform/chromium/PlatformBridge.h	2011-06-14 01:10:31 UTC (rev 88744)
+++ trunk/Source/WebCore/platform/chromium/PlatformBridge.h	2011-06-14 01:13:56 UTC (rev 88745)
@@ -246,6 +246,7 @@
 
     // SystemTime ---------------------------------------------------------
     static double currentTime();
+    static double monotonicallyIncreasingTime();
 
     // Theming ------------------------------------------------------------
 #if OS(WINDOWS)

Modified: trunk/Source/WebCore/platform/chromium/SystemTimeChromium.cpp (88744 => 88745)


--- trunk/Source/WebCore/platform/chromium/SystemTimeChromium.cpp	2011-06-14 01:10:31 UTC (rev 88744)
+++ trunk/Source/WebCore/platform/chromium/SystemTimeChromium.cpp	2011-06-14 01:13:56 UTC (rev 88745)
@@ -45,12 +45,7 @@
 
 double monotonicallyIncreasingTime()
 {
-    static double lastTime = 0;
-    double currentTimeNow = currentTime();
-    if (currentTimeNow < lastTime)
-        return lastTime;
-    lastTime = currentTimeNow;
-    return currentTimeNow;
+    return PlatformBridge::monotonicallyIncreasingTime();
 }
 
 float userIdleTime()

Modified: trunk/Source/WebKit/chromium/ChangeLog (88744 => 88745)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-06-14 01:10:31 UTC (rev 88744)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-06-14 01:13:56 UTC (rev 88745)
@@ -1,3 +1,15 @@
+2011-06-13  James Simonsen  <[email protected]>
+
+        Reviewed by James Robinson.
+
+        [Chromium] Implement monotonicallyIncreasingClock()
+        https://bugs.webkit.org/show_bug.cgi?id=62162
+
+        * public/WebKitClient.h:
+        (WebKit::WebKitClient::monotonicallyIncreasingTime): Added.
+        * src/PlatformBridge.cpp:
+        (WebCore::PlatformBridge::monotonicallyIncreasingTime): Added.
+
 2011-06-13  Jian Li  <[email protected]>
 
         Reviewed by David Levin.

Modified: trunk/Source/WebKit/chromium/public/WebKitClient.h (88744 => 88745)


--- trunk/Source/WebKit/chromium/public/WebKitClient.h	2011-06-14 01:10:31 UTC (rev 88744)
+++ trunk/Source/WebKit/chromium/public/WebKitClient.h	2011-06-14 01:13:56 UTC (rev 88745)
@@ -266,6 +266,11 @@
     // Wall clock time in seconds since the epoch.
     virtual double currentTime() { return 0; }
 
+    // Monotonically increasing time in seconds from an arbitrary fixed point in the past.
+    // This function is expected to return at least millisecond-precision values. For this reason,
+    // it is recommended that the fixed point be no further in the past than the epoch.
+    virtual double monotonicallyIncreasingTime() { return 0; }
+
     virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length)
     {
         // WebKit clients must implement this funcion if they use cryptographic randomness.

Modified: trunk/Source/WebKit/chromium/src/PlatformBridge.cpp (88744 => 88745)


--- trunk/Source/WebKit/chromium/src/PlatformBridge.cpp	2011-06-14 01:10:31 UTC (rev 88744)
+++ trunk/Source/WebKit/chromium/src/PlatformBridge.cpp	2011-06-14 01:13:56 UTC (rev 88745)
@@ -701,6 +701,11 @@
     return webKitClient()->currentTime();
 }
 
+double PlatformBridge::monotonicallyIncreasingTime()
+{
+    return webKitClient()->monotonicallyIncreasingTime();
+}
+
 // Theming --------------------------------------------------------------------
 
 #if OS(WINDOWS)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to