RTCStatsCollector: timestamps updated.
Using a timestamp based on a timer that is monotonically increasing for
the cache, so that cache's freshness can be checked regardless of if
system clock is modified.
Using a system clock for the stats' timestamp, which needs to be
relative to UNIX epoch (Jan 1, 1970, UTC).
This CL removes the dependency on faketiming.h.
BUG=chromium:627816
NOTRY=True
Review-Url: https://codereview.webrtc.org/2299643002
Cr-Commit-Position: refs/heads/master@{#13997}
diff --git a/webrtc/stats/rtcstats_objects.cc b/webrtc/stats/rtcstats_objects.cc
index 1cfe85f..46962f2 100644
--- a/webrtc/stats/rtcstats_objects.cc
+++ b/webrtc/stats/rtcstats_objects.cc
@@ -15,13 +15,13 @@
const char RTCPeerConnectionStats::kType[] = "peer-connection";
RTCPeerConnectionStats::RTCPeerConnectionStats(
- const std::string& id, double timestamp)
- : RTCPeerConnectionStats(std::string(id), timestamp) {
+ const std::string& id, int64_t timestamp_us)
+ : RTCPeerConnectionStats(std::string(id), timestamp_us) {
}
RTCPeerConnectionStats::RTCPeerConnectionStats(
- std::string&& id, double timestamp)
- : RTCStats(std::move(id), timestamp),
+ std::string&& id, int64_t timestamp_us)
+ : RTCStats(std::move(id), timestamp_us),
data_channels_opened("dataChannelsOpened"),
data_channels_closed("dataChannelsClosed") {
}