Chromium Code Reviews| Index: webrtc/api/stats/rtcstats_objects.h | 
| diff --git a/webrtc/api/stats/rtcstats_objects.h b/webrtc/api/stats/rtcstats_objects.h | 
| index 6ff9f9949a4fa2e862d38fd1b1b086a86d571395..7242882ca209d17d97a9c2d7714a95867bae5ce6 100644 | 
| --- a/webrtc/api/stats/rtcstats_objects.h | 
| +++ b/webrtc/api/stats/rtcstats_objects.h | 
| @@ -17,6 +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_IMPL(RTCStats, RTCIceCandidateStats, | 
| + &ip, | 
| + &port, | 
| + &protocol, | 
| + &candidate_type, | 
| + &priority, | 
| + &url); | 
| + | 
| + 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 { return kType; } | 
| +}; | 
| +class RTCRemoteIceCandidateStats final : public RTCIceCandidateStats { | 
| 
 
hta-webrtc
2016/10/04 14:12:46
Blank line between top level constructs (such as c
 
hbos
2016/10/05 10:16:30
Done.
 
 | 
| + 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 { return kType; } | 
| +}; | 
| + | 
| // https://w3c.github.io/webrtc-stats/#certificatestats-dict* | 
| class RTCCertificateStats : public RTCStats { | 
| public: |