stats: use Timestamp instead of uint64_t

making it clear what unit is being used.

BUG=webrtc:13756

Change-Id: I6354d35a8e02bb93a905ccf32cb0b294b4813e41
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/289460
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39008}
diff --git a/api/stats/rtcstats_objects.h b/api/stats/rtcstats_objects.h
index 9d3e697..1647989 100644
--- a/api/stats/rtcstats_objects.h
+++ b/api/stats/rtcstats_objects.h
@@ -120,6 +120,7 @@
  public:
   WEBRTC_RTCSTATS_DECL();
 
+  RTCCertificateStats(std::string id, Timestamp timestamp);
   RTCCertificateStats(std::string id, int64_t timestamp_us);
   RTCCertificateStats(const RTCCertificateStats& other);
   ~RTCCertificateStats() override;
@@ -149,6 +150,7 @@
  public:
   WEBRTC_RTCSTATS_DECL();
 
+  RTCCodecStats(std::string id, Timestamp timestamp);
   RTCCodecStats(std::string id, int64_t timestamp_us);
   RTCCodecStats(const RTCCodecStats& other);
   ~RTCCodecStats() override;
@@ -166,6 +168,7 @@
  public:
   WEBRTC_RTCSTATS_DECL();
 
+  RTCDataChannelStats(std::string id, Timestamp timestamp);
   RTCDataChannelStats(std::string id, int64_t timestamp_us);
   RTCDataChannelStats(const RTCDataChannelStats& other);
   ~RTCDataChannelStats() override;
@@ -186,6 +189,7 @@
  public:
   WEBRTC_RTCSTATS_DECL();
 
+  RTCIceCandidatePairStats(std::string id, Timestamp timestamp);
   RTCIceCandidatePairStats(std::string id, int64_t timestamp_us);
   RTCIceCandidatePairStats(const RTCIceCandidatePairStats& other);
   ~RTCIceCandidatePairStats() override;
@@ -254,6 +258,7 @@
   RTCNonStandardStatsMember<std::string> network_adapter_type;
 
  protected:
+  RTCIceCandidateStats(std::string id, Timestamp timestamp, bool is_remote);
   RTCIceCandidateStats(std::string id, int64_t timestamp_us, bool is_remote);
 };
 
@@ -265,6 +270,7 @@
 class RTC_EXPORT RTCLocalIceCandidateStats final : public RTCIceCandidateStats {
  public:
   static const char kType[];
+  RTCLocalIceCandidateStats(std::string id, Timestamp timestamp);
   RTCLocalIceCandidateStats(std::string id, int64_t timestamp_us);
   std::unique_ptr<RTCStats> copy() const override;
   const char* type() const override;
@@ -274,6 +280,7 @@
     : public RTCIceCandidateStats {
  public:
   static const char kType[];
+  RTCRemoteIceCandidateStats(std::string id, Timestamp timestamp);
   RTCRemoteIceCandidateStats(std::string id, int64_t timestamp_us);
   std::unique_ptr<RTCStats> copy() const override;
   const char* type() const override;
@@ -284,6 +291,7 @@
  public:
   WEBRTC_RTCSTATS_DECL();
 
+  DEPRECATED_RTCMediaStreamStats(std::string id, Timestamp timestamp);
   DEPRECATED_RTCMediaStreamStats(std::string id, int64_t timestamp_us);
   DEPRECATED_RTCMediaStreamStats(const DEPRECATED_RTCMediaStreamStats& other);
   ~DEPRECATED_RTCMediaStreamStats() override;
@@ -300,6 +308,9 @@
   WEBRTC_RTCSTATS_DECL();
 
   DEPRECATED_RTCMediaStreamTrackStats(std::string id,
+                                      Timestamp timestamp,
+                                      const char* kind);
+  DEPRECATED_RTCMediaStreamTrackStats(std::string id,
                                       int64_t timestamp_us,
                                       const char* kind);
   DEPRECATED_RTCMediaStreamTrackStats(
@@ -345,6 +356,7 @@
  public:
   WEBRTC_RTCSTATS_DECL();
 
+  RTCPeerConnectionStats(std::string id, Timestamp timestamp);
   RTCPeerConnectionStats(std::string id, int64_t timestamp_us);
   RTCPeerConnectionStats(const RTCPeerConnectionStats& other);
   ~RTCPeerConnectionStats() override;
@@ -372,6 +384,7 @@
   RTCStatsMember<std::string> media_type;  // renamed to kind.
 
  protected:
+  RTCRTPStreamStats(std::string id, Timestamp timestamp);
   RTCRTPStreamStats(std::string id, int64_t timestamp_us);
 };
 
@@ -387,6 +400,7 @@
   RTCStatsMember<int32_t> packets_lost;  // Signed per RFC 3550
 
  protected:
+  RTCReceivedRtpStreamStats(std::string id, Timestamp timestamp);
   RTCReceivedRtpStreamStats(std::string id, int64_t timestamp_us);
 };
 
@@ -402,6 +416,7 @@
   RTCStatsMember<uint64_t> bytes_sent;
 
  protected:
+  RTCSentRtpStreamStats(std::string id, Timestamp timestamp);
   RTCSentRtpStreamStats(std::string id, int64_t timestamp_us);
 };
 
@@ -411,6 +426,7 @@
  public:
   WEBRTC_RTCSTATS_DECL();
 
+  RTCInboundRTPStreamStats(std::string id, Timestamp timestamp);
   RTCInboundRTPStreamStats(std::string id, int64_t timestamp_us);
   RTCInboundRTPStreamStats(const RTCInboundRTPStreamStats& other);
   ~RTCInboundRTPStreamStats() override;
@@ -498,6 +514,7 @@
  public:
   WEBRTC_RTCSTATS_DECL();
 
+  RTCOutboundRTPStreamStats(std::string id, Timestamp timestamp);
   RTCOutboundRTPStreamStats(std::string id, int64_t timestamp_us);
   RTCOutboundRTPStreamStats(const RTCOutboundRTPStreamStats& other);
   ~RTCOutboundRTPStreamStats() override;
@@ -551,6 +568,7 @@
  public:
   WEBRTC_RTCSTATS_DECL();
 
+  RTCRemoteInboundRtpStreamStats(std::string id, Timestamp timestamp);
   RTCRemoteInboundRtpStreamStats(std::string id, int64_t timestamp_us);
   RTCRemoteInboundRtpStreamStats(const RTCRemoteInboundRtpStreamStats& other);
   ~RTCRemoteInboundRtpStreamStats() override;
@@ -568,6 +586,7 @@
  public:
   WEBRTC_RTCSTATS_DECL();
 
+  RTCRemoteOutboundRtpStreamStats(std::string id, Timestamp timestamp);
   RTCRemoteOutboundRtpStreamStats(std::string id, int64_t timestamp_us);
   RTCRemoteOutboundRtpStreamStats(const RTCRemoteOutboundRtpStreamStats& other);
   ~RTCRemoteOutboundRtpStreamStats() override;
@@ -592,6 +611,7 @@
   RTCStatsMember<std::string> kind;
 
  protected:
+  RTCMediaSourceStats(std::string id, Timestamp timestamp);
   RTCMediaSourceStats(std::string id, int64_t timestamp_us);
 };
 
@@ -600,6 +620,7 @@
  public:
   WEBRTC_RTCSTATS_DECL();
 
+  RTCAudioSourceStats(std::string id, Timestamp timestamp);
   RTCAudioSourceStats(std::string id, int64_t timestamp_us);
   RTCAudioSourceStats(const RTCAudioSourceStats& other);
   ~RTCAudioSourceStats() override;
@@ -616,6 +637,7 @@
  public:
   WEBRTC_RTCSTATS_DECL();
 
+  RTCVideoSourceStats(std::string id, Timestamp timestamp);
   RTCVideoSourceStats(std::string id, int64_t timestamp_us);
   RTCVideoSourceStats(const RTCVideoSourceStats& other);
   ~RTCVideoSourceStats() override;
@@ -631,6 +653,7 @@
  public:
   WEBRTC_RTCSTATS_DECL();
 
+  RTCTransportStats(std::string id, Timestamp timestamp);
   RTCTransportStats(std::string id, int64_t timestamp_us);
   RTCTransportStats(const RTCTransportStats& other);
   ~RTCTransportStats() override;