| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  *  Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2  *  Copyright 2016 The WebRTC Project Authors. All rights reserved. | 
| 3  * | 3  * | 
| 4  *  Use of this source code is governed by a BSD-style license | 4  *  Use of this source code is governed by a BSD-style license | 
| 5  *  that can be found in the LICENSE file in the root of the source | 5  *  that can be found in the LICENSE file in the root of the source | 
| 6  *  tree. An additional intellectual property rights grant can be found | 6  *  tree. An additional intellectual property rights grant can be found | 
| 7  *  in the file PATENTS.  All contributing project authors may | 7  *  in the file PATENTS.  All contributing project authors may | 
| 8  *  be found in the AUTHORS file in the root of the source tree. | 8  *  be found in the AUTHORS file in the root of the source tree. | 
| 9  */ | 9  */ | 
| 10 | 10 | 
| 11 #include "webrtc/api/stats/rtcstats_objects.h" | 11 #include "webrtc/api/stats/rtcstats_objects.h" | 
| 12 | 12 | 
| 13 namespace webrtc { | 13 namespace webrtc { | 
| 14 | 14 | 
|  | 15 const char* RTCDataChannelState::kConnecting = "connecting"; | 
|  | 16 const char* RTCDataChannelState::kOpen = "open"; | 
|  | 17 const char* RTCDataChannelState::kClosing = "closing"; | 
|  | 18 const char* RTCDataChannelState::kClosed = "closed"; | 
|  | 19 | 
| 15 const char* RTCStatsIceCandidatePairState::kFrozen = "frozen"; | 20 const char* RTCStatsIceCandidatePairState::kFrozen = "frozen"; | 
| 16 const char* RTCStatsIceCandidatePairState::kWaiting = "waiting"; | 21 const char* RTCStatsIceCandidatePairState::kWaiting = "waiting"; | 
| 17 const char* RTCStatsIceCandidatePairState::kInProgress = "inprogress"; | 22 const char* RTCStatsIceCandidatePairState::kInProgress = "inprogress"; | 
| 18 const char* RTCStatsIceCandidatePairState::kFailed = "failed"; | 23 const char* RTCStatsIceCandidatePairState::kFailed = "failed"; | 
| 19 const char* RTCStatsIceCandidatePairState::kSucceeded = "succeeded"; | 24 const char* RTCStatsIceCandidatePairState::kSucceeded = "succeeded"; | 
| 20 const char* RTCStatsIceCandidatePairState::kCancelled = "cancelled"; | 25 const char* RTCStatsIceCandidatePairState::kCancelled = "cancelled"; | 
| 21 | 26 | 
| 22 // Strings defined in https://tools.ietf.org/html/rfc5245. | 27 // Strings defined in https://tools.ietf.org/html/rfc5245. | 
| 23 const char* RTCIceCandidateType::kHost = "host"; | 28 const char* RTCIceCandidateType::kHost = "host"; | 
| 24 const char* RTCIceCandidateType::kSrflx = "srflx"; | 29 const char* RTCIceCandidateType::kSrflx = "srflx"; | 
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 211     : RTCStats(other.id(), other.timestamp_us()), | 216     : RTCStats(other.id(), other.timestamp_us()), | 
| 212       fingerprint(other.fingerprint), | 217       fingerprint(other.fingerprint), | 
| 213       fingerprint_algorithm(other.fingerprint_algorithm), | 218       fingerprint_algorithm(other.fingerprint_algorithm), | 
| 214       base64_certificate(other.base64_certificate), | 219       base64_certificate(other.base64_certificate), | 
| 215       issuer_certificate_id(other.issuer_certificate_id) { | 220       issuer_certificate_id(other.issuer_certificate_id) { | 
| 216 } | 221 } | 
| 217 | 222 | 
| 218 RTCCertificateStats::~RTCCertificateStats() { | 223 RTCCertificateStats::~RTCCertificateStats() { | 
| 219 } | 224 } | 
| 220 | 225 | 
|  | 226 WEBRTC_RTCSTATS_IMPL(RTCDataChannelStats, RTCStats, "data-channel", | 
|  | 227     &label, | 
|  | 228     &protocol, | 
|  | 229     &datachannelid, | 
|  | 230     &state, | 
|  | 231     &messages_sent, | 
|  | 232     &bytes_sent, | 
|  | 233     &messages_received, | 
|  | 234     &bytes_received); | 
|  | 235 | 
|  | 236 RTCDataChannelStats::RTCDataChannelStats( | 
|  | 237     const std::string& id, int64_t timestamp_us) | 
|  | 238     : RTCDataChannelStats(std::string(id), timestamp_us) { | 
|  | 239 } | 
|  | 240 | 
|  | 241 RTCDataChannelStats::RTCDataChannelStats( | 
|  | 242     std::string&& id, int64_t timestamp_us) | 
|  | 243     : RTCStats(std::move(id), timestamp_us), | 
|  | 244       label("label"), | 
|  | 245       protocol("protocol"), | 
|  | 246       datachannelid("datachannelid"), | 
|  | 247       state("state"), | 
|  | 248       messages_sent("messagesSent"), | 
|  | 249       bytes_sent("bytesSent"), | 
|  | 250       messages_received("messagesReceived"), | 
|  | 251       bytes_received("bytesReceived") { | 
|  | 252 } | 
|  | 253 | 
|  | 254 RTCDataChannelStats::RTCDataChannelStats( | 
|  | 255     const RTCDataChannelStats& other) | 
|  | 256     : RTCStats(other.id(), other.timestamp_us()), | 
|  | 257       label(other.label), | 
|  | 258       protocol(other.protocol), | 
|  | 259       datachannelid(other.datachannelid), | 
|  | 260       state(other.state), | 
|  | 261       messages_sent(other.messages_sent), | 
|  | 262       bytes_sent(other.bytes_sent), | 
|  | 263       messages_received(other.messages_received), | 
|  | 264       bytes_received(other.bytes_received) { | 
|  | 265 } | 
|  | 266 | 
|  | 267 RTCDataChannelStats::~RTCDataChannelStats() { | 
|  | 268 } | 
|  | 269 | 
| 221 WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection", | 270 WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection", | 
| 222     &data_channels_opened, | 271     &data_channels_opened, | 
| 223     &data_channels_closed); | 272     &data_channels_closed); | 
| 224 | 273 | 
| 225 RTCPeerConnectionStats::RTCPeerConnectionStats( | 274 RTCPeerConnectionStats::RTCPeerConnectionStats( | 
| 226     const std::string& id, int64_t timestamp_us) | 275     const std::string& id, int64_t timestamp_us) | 
| 227     : RTCPeerConnectionStats(std::string(id), timestamp_us) { | 276     : RTCPeerConnectionStats(std::string(id), timestamp_us) { | 
| 228 } | 277 } | 
| 229 | 278 | 
| 230 RTCPeerConnectionStats::RTCPeerConnectionStats( | 279 RTCPeerConnectionStats::RTCPeerConnectionStats( | 
| 231     std::string&& id, int64_t timestamp_us) | 280     std::string&& id, int64_t timestamp_us) | 
| 232     : RTCStats(std::move(id), timestamp_us), | 281     : RTCStats(std::move(id), timestamp_us), | 
| 233       data_channels_opened("dataChannelsOpened"), | 282       data_channels_opened("dataChannelsOpened"), | 
| 234       data_channels_closed("dataChannelsClosed") { | 283       data_channels_closed("dataChannelsClosed") { | 
| 235 } | 284 } | 
| 236 | 285 | 
| 237 RTCPeerConnectionStats::RTCPeerConnectionStats( | 286 RTCPeerConnectionStats::RTCPeerConnectionStats( | 
| 238     const RTCPeerConnectionStats& other) | 287     const RTCPeerConnectionStats& other) | 
| 239     : RTCStats(other.id(), other.timestamp_us()), | 288     : RTCStats(other.id(), other.timestamp_us()), | 
| 240       data_channels_opened(other.data_channels_opened), | 289       data_channels_opened(other.data_channels_opened), | 
| 241       data_channels_closed(other.data_channels_closed) { | 290       data_channels_closed(other.data_channels_closed) { | 
| 242 } | 291 } | 
| 243 | 292 | 
| 244 RTCPeerConnectionStats::~RTCPeerConnectionStats() { | 293 RTCPeerConnectionStats::~RTCPeerConnectionStats() { | 
| 245 } | 294 } | 
| 246 | 295 | 
| 247 }  // namespace webrtc | 296 }  // namespace webrtc | 
| OLD | NEW | 
|---|