Title: [226495] trunk
Revision
226495
Author
[email protected]
Date
2018-01-07 17:22:20 -0800 (Sun, 07 Jan 2018)

Log Message

Reduce the precision of "high" resolution time to 1ms
https://bugs.webkit.org/show_bug.cgi?id=180910
<rdar://problem/36085943>

Reviewed by Saam Barati.

Source/WebCore:

Reduced the high prevision time's resolution to 1ms, the same precision as Date.now().

Also fixed the bug in fillRTCStats that we weren't reducing the time resolution in RTCStats dictionaries.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::fillRTCStats):
* page/Performance.cpp:
(WebCore::Performance::reduceTimeResolution):

LayoutTests:

Add a flaky test expectation to imported/w3c/web-platform-tests/workers/worker-performance.worker.html
due to a test bug. The test fix is tracked in https://github.com/w3c/web-platform-tests/pull/8711

* TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (226494 => 226495)


--- trunk/LayoutTests/ChangeLog	2018-01-07 22:50:14 UTC (rev 226494)
+++ trunk/LayoutTests/ChangeLog	2018-01-08 01:22:20 UTC (rev 226495)
@@ -1,3 +1,16 @@
+2018-01-07  Ryosuke Niwa  <[email protected]>
+
+        Reduce the precision of "high" resolution time to 1ms
+        https://bugs.webkit.org/show_bug.cgi?id=180910
+        <rdar://problem/36085943>
+
+        Reviewed by Saam Barati.
+
+        Add a flaky test expectation to imported/w3c/web-platform-tests/workers/worker-performance.worker.html
+        due to a test bug. The test fix is tracked in https://github.com/w3c/web-platform-tests/pull/8711
+
+        * TestExpectations:
+
 2018-01-06  Simon Fraser  <[email protected]>
 
         Possible crash computing event regions

Modified: trunk/LayoutTests/TestExpectations (226494 => 226495)


--- trunk/LayoutTests/TestExpectations	2018-01-07 22:50:14 UTC (rev 226494)
+++ trunk/LayoutTests/TestExpectations	2018-01-08 01:22:20 UTC (rev 226495)
@@ -1672,3 +1672,6 @@
 webkit.org/b/158205 applicationmanifest/ [ Skip ]
 
 webkit.org/b/178785 perf/object-keys.html [ Pass Failure ]
+
+# There is a bug in the test
+imported/w3c/web-platform-tests/workers/worker-performance.worker.html [ Pass Failure ]

Modified: trunk/Source/WebCore/ChangeLog (226494 => 226495)


--- trunk/Source/WebCore/ChangeLog	2018-01-07 22:50:14 UTC (rev 226494)
+++ trunk/Source/WebCore/ChangeLog	2018-01-08 01:22:20 UTC (rev 226495)
@@ -1,3 +1,20 @@
+2018-01-07  Ryosuke Niwa  <[email protected]>
+
+        Reduce the precision of "high" resolution time to 1ms
+        https://bugs.webkit.org/show_bug.cgi?id=180910
+        <rdar://problem/36085943>
+
+        Reviewed by Saam Barati.
+
+        Reduced the high prevision time's resolution to 1ms, the same precision as Date.now().
+
+        Also fixed the bug in fillRTCStats that we weren't reducing the time resolution in RTCStats dictionaries.
+
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+        (WebCore::fillRTCStats):
+        * page/Performance.cpp:
+        (WebCore::Performance::reduceTimeResolution):
+
 2018-01-06  Simon Fraser  <[email protected]>
 
         Possible crash computing event regions

Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp (226494 => 226495)


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp	2018-01-07 22:50:14 UTC (rev 226494)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp	2018-01-08 01:22:20 UTC (rev 226495)
@@ -35,6 +35,7 @@
 #include "Logging.h"
 #include "MediaStreamEvent.h"
 #include "NotImplemented.h"
+#include "Performance.h"
 #include "PlatformStrategies.h"
 #include "RTCDataChannel.h"
 #include "RTCDataChannelEvent.h"
@@ -50,6 +51,7 @@
 #include <webrtc/p2p/base/basicpacketsocketfactory.h>
 #include <webrtc/p2p/client/basicportallocator.h>
 #include <webrtc/pc/peerconnectionfactory.h>
+#include <wtf/CurrentTime.h>
 #include <wtf/MainThread.h>
 
 #include <pal/cf/CoreMediaSoftLink.h>
@@ -310,7 +312,7 @@
 
 static inline void fillRTCStats(RTCStatsReport::Stats& stats, const webrtc::RTCStats& rtcStats)
 {
-    stats.timestamp = rtcStats.timestamp_us() / 1000.0;
+    stats.timestamp = Performance::reduceTimeResolution(Seconds::fromMicroseconds(rtcStats.timestamp_us())).milliseconds();
     stats.id = fromStdString(rtcStats.id());
 }
 

Modified: trunk/Source/WebCore/page/Performance.cpp (226494 => 226495)


--- trunk/Source/WebCore/page/Performance.cpp	2018-01-07 22:50:14 UTC (rev 226494)
+++ trunk/Source/WebCore/page/Performance.cpp	2018-01-08 01:22:20 UTC (rev 226495)
@@ -75,7 +75,7 @@
 
 Seconds Performance::reduceTimeResolution(Seconds seconds)
 {
-    double resolution = (100_us).seconds();
+    double resolution = (1000_us).seconds();
     double reduced = std::floor(seconds.seconds() / resolution) * resolution;
     return Seconds(reduced);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to