Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: webrtc/api/stats/rtcstats_objects.h

Issue 2384143002: RTCIceCandidateStats added. (Closed)
Patch Set: Addressed comments Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/rtcstatscollector_unittest.cc ('k') | webrtc/stats/rtcstats_objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/stats/rtcstats_objects.h
diff --git a/webrtc/api/stats/rtcstats_objects.h b/webrtc/api/stats/rtcstats_objects.h
index f816d48b55e62c5a9783b3fd35dcda10979b3eac..e827d011ea9499b3eff8fead60d3c03d8de5d1f8 100644
--- a/webrtc/api/stats/rtcstats_objects.h
+++ b/webrtc/api/stats/rtcstats_objects.h
@@ -17,8 +17,57 @@
namespace webrtc {
+// https://www.w3.org/TR/webrtc/#rtcicecandidatetype-enum
+struct RTCIceCandidateType {
+ static const char* kHost;
+ static const char* kSrflx;
+ static const char* kPrflx;
+ static const char* kRelay;
+};
+
+// https://w3c.github.io/webrtc-stats/#icecandidate-dict*
+class RTCIceCandidateStats : public RTCStats {
+ public:
+ WEBRTC_RTCSTATS_DECL();
+
+ RTCIceCandidateStats(const RTCIceCandidateStats& other);
+ ~RTCIceCandidateStats() override;
+
+ RTCStatsMember<std::string> ip;
+ RTCStatsMember<int32_t> port;
+ RTCStatsMember<std::string> protocol;
+ // TODO(hbos): Support enum types? "RTCStatsMember<RTCIceCandidateType>"?
+ RTCStatsMember<std::string> candidate_type;
+ RTCStatsMember<int32_t> priority;
+ RTCStatsMember<std::string> url;
+
+ protected:
+ RTCIceCandidateStats(const std::string& id, int64_t timestamp_us);
+ RTCIceCandidateStats(std::string&& id, int64_t timestamp_us);
+};
+
+// In the spec both local and remote varieties are of type RTCIceCandidateStats.
+// But here we define them as subclasses of |RTCIceCandidateStats| because the
+// |kType| need to be different ("RTCStatsType type") in the local/remote case.
+// https://w3c.github.io/webrtc-stats/#rtcstatstype-str*
+class RTCLocalIceCandidateStats final : public RTCIceCandidateStats {
+ public:
+ static const char kType[];
+ RTCLocalIceCandidateStats(const std::string& id, int64_t timestamp_us);
+ RTCLocalIceCandidateStats(std::string&& id, int64_t timestamp_us);
+ const char* type() const override;
+};
+
+class RTCRemoteIceCandidateStats final : public RTCIceCandidateStats {
+ public:
+ static const char kType[];
+ RTCRemoteIceCandidateStats(const std::string& id, int64_t timestamp_us);
+ RTCRemoteIceCandidateStats(std::string&& id, int64_t timestamp_us);
+ const char* type() const override;
+};
+
// https://w3c.github.io/webrtc-stats/#certificatestats-dict*
-class RTCCertificateStats : public RTCStats {
+class RTCCertificateStats final : public RTCStats {
public:
WEBRTC_RTCSTATS_DECL();
@@ -35,7 +84,7 @@ class RTCCertificateStats : public RTCStats {
// https://w3c.github.io/webrtc-stats/#pcstats-dict*
// TODO(hbos): Tracking bug crbug.com/636818
-class RTCPeerConnectionStats : public RTCStats {
+class RTCPeerConnectionStats final : public RTCStats {
public:
WEBRTC_RTCSTATS_DECL();
« no previous file with comments | « webrtc/api/rtcstatscollector_unittest.cc ('k') | webrtc/stats/rtcstats_objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698