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* RTCStatsIceCandidatePairState::kFrozen = "frozen"; | 15 const char* RTCStatsIceCandidatePairState::kFrozen = "frozen"; |
16 const char* RTCStatsIceCandidatePairState::kWaiting = "waiting"; | 16 const char* RTCStatsIceCandidatePairState::kWaiting = "waiting"; |
17 const char* RTCStatsIceCandidatePairState::kInProgress = "inprogress"; | 17 const char* RTCStatsIceCandidatePairState::kInProgress = "inprogress"; |
18 const char* RTCStatsIceCandidatePairState::kFailed = "failed"; | 18 const char* RTCStatsIceCandidatePairState::kFailed = "failed"; |
19 const char* RTCStatsIceCandidatePairState::kSucceeded = "succeeded"; | 19 const char* RTCStatsIceCandidatePairState::kSucceeded = "succeeded"; |
20 const char* RTCStatsIceCandidatePairState::kCancelled = "cancelled"; | 20 const char* RTCStatsIceCandidatePairState::kCancelled = "cancelled"; |
21 | 21 |
22 // Strings defined in https://tools.ietf.org/html/rfc5245. | 22 // Strings defined in https://tools.ietf.org/html/rfc5245. |
23 const char* RTCIceCandidateType::kHost = "host"; | 23 const char* RTCIceCandidateType::kHost = "host"; |
24 const char* RTCIceCandidateType::kSrflx = "srflx"; | 24 const char* RTCIceCandidateType::kSrflx = "srflx"; |
25 const char* RTCIceCandidateType::kPrflx = "prflx"; | 25 const char* RTCIceCandidateType::kPrflx = "prflx"; |
26 const char* RTCIceCandidateType::kRelay = "relay"; | 26 const char* RTCIceCandidateType::kRelay = "relay"; |
27 | 27 |
| 28 WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate", |
| 29 &fingerprint, |
| 30 &fingerprint_algorithm, |
| 31 &base64_certificate, |
| 32 &issuer_certificate_id); |
| 33 |
| 34 RTCCertificateStats::RTCCertificateStats( |
| 35 const std::string& id, int64_t timestamp_us) |
| 36 : RTCCertificateStats(std::string(id), timestamp_us) { |
| 37 } |
| 38 |
| 39 RTCCertificateStats::RTCCertificateStats( |
| 40 std::string&& id, int64_t timestamp_us) |
| 41 : RTCStats(std::move(id), timestamp_us), |
| 42 fingerprint("fingerprint"), |
| 43 fingerprint_algorithm("fingerprintAlgorithm"), |
| 44 base64_certificate("base64Certificate"), |
| 45 issuer_certificate_id("issuerCertificateId") { |
| 46 } |
| 47 |
| 48 RTCCertificateStats::RTCCertificateStats( |
| 49 const RTCCertificateStats& other) |
| 50 : RTCStats(other.id(), other.timestamp_us()), |
| 51 fingerprint(other.fingerprint), |
| 52 fingerprint_algorithm(other.fingerprint_algorithm), |
| 53 base64_certificate(other.base64_certificate), |
| 54 issuer_certificate_id(other.issuer_certificate_id) { |
| 55 } |
| 56 |
| 57 RTCCertificateStats::~RTCCertificateStats() { |
| 58 } |
| 59 |
28 WEBRTC_RTCSTATS_IMPL(RTCIceCandidatePairStats, RTCStats, "candidate-pair", | 60 WEBRTC_RTCSTATS_IMPL(RTCIceCandidatePairStats, RTCStats, "candidate-pair", |
29 &transport_id, | 61 &transport_id, |
30 &local_candidate_id, | 62 &local_candidate_id, |
31 &remote_candidate_id, | 63 &remote_candidate_id, |
32 &state, | 64 &state, |
33 &priority, | 65 &priority, |
34 &nominated, | 66 &nominated, |
35 &writable, | 67 &writable, |
36 &readable, | 68 &readable, |
37 &bytes_sent, | 69 &bytes_sent, |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 211 |
180 RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats( | 212 RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats( |
181 std::string&& id, int64_t timestamp_us) | 213 std::string&& id, int64_t timestamp_us) |
182 : RTCIceCandidateStats(std::move(id), timestamp_us) { | 214 : RTCIceCandidateStats(std::move(id), timestamp_us) { |
183 } | 215 } |
184 | 216 |
185 const char* RTCRemoteIceCandidateStats::type() const { | 217 const char* RTCRemoteIceCandidateStats::type() const { |
186 return kType; | 218 return kType; |
187 } | 219 } |
188 | 220 |
189 WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate", | |
190 &fingerprint, | |
191 &fingerprint_algorithm, | |
192 &base64_certificate, | |
193 &issuer_certificate_id); | |
194 | |
195 RTCCertificateStats::RTCCertificateStats( | |
196 const std::string& id, int64_t timestamp_us) | |
197 : RTCCertificateStats(std::string(id), timestamp_us) { | |
198 } | |
199 | |
200 RTCCertificateStats::RTCCertificateStats( | |
201 std::string&& id, int64_t timestamp_us) | |
202 : RTCStats(std::move(id), timestamp_us), | |
203 fingerprint("fingerprint"), | |
204 fingerprint_algorithm("fingerprintAlgorithm"), | |
205 base64_certificate("base64Certificate"), | |
206 issuer_certificate_id("issuerCertificateId") { | |
207 } | |
208 | |
209 RTCCertificateStats::RTCCertificateStats( | |
210 const RTCCertificateStats& other) | |
211 : RTCStats(other.id(), other.timestamp_us()), | |
212 fingerprint(other.fingerprint), | |
213 fingerprint_algorithm(other.fingerprint_algorithm), | |
214 base64_certificate(other.base64_certificate), | |
215 issuer_certificate_id(other.issuer_certificate_id) { | |
216 } | |
217 | |
218 RTCCertificateStats::~RTCCertificateStats() { | |
219 } | |
220 | |
221 WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection", | 221 WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection", |
222 &data_channels_opened, | 222 &data_channels_opened, |
223 &data_channels_closed); | 223 &data_channels_closed); |
224 | 224 |
225 RTCPeerConnectionStats::RTCPeerConnectionStats( | 225 RTCPeerConnectionStats::RTCPeerConnectionStats( |
226 const std::string& id, int64_t timestamp_us) | 226 const std::string& id, int64_t timestamp_us) |
227 : RTCPeerConnectionStats(std::string(id), timestamp_us) { | 227 : RTCPeerConnectionStats(std::string(id), timestamp_us) { |
228 } | 228 } |
229 | 229 |
230 RTCPeerConnectionStats::RTCPeerConnectionStats( | 230 RTCPeerConnectionStats::RTCPeerConnectionStats( |
231 std::string&& id, int64_t timestamp_us) | 231 std::string&& id, int64_t timestamp_us) |
232 : RTCStats(std::move(id), timestamp_us), | 232 : RTCStats(std::move(id), timestamp_us), |
233 data_channels_opened("dataChannelsOpened"), | 233 data_channels_opened("dataChannelsOpened"), |
234 data_channels_closed("dataChannelsClosed") { | 234 data_channels_closed("dataChannelsClosed") { |
235 } | 235 } |
236 | 236 |
237 RTCPeerConnectionStats::RTCPeerConnectionStats( | 237 RTCPeerConnectionStats::RTCPeerConnectionStats( |
238 const RTCPeerConnectionStats& other) | 238 const RTCPeerConnectionStats& other) |
239 : RTCStats(other.id(), other.timestamp_us()), | 239 : RTCStats(other.id(), other.timestamp_us()), |
240 data_channels_opened(other.data_channels_opened), | 240 data_channels_opened(other.data_channels_opened), |
241 data_channels_closed(other.data_channels_closed) { | 241 data_channels_closed(other.data_channels_closed) { |
242 } | 242 } |
243 | 243 |
244 RTCPeerConnectionStats::~RTCPeerConnectionStats() { | 244 RTCPeerConnectionStats::~RTCPeerConnectionStats() { |
245 } | 245 } |
246 | 246 |
| 247 WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport", |
| 248 &bytes_sent, |
| 249 &bytes_received, |
| 250 &rtcp_transport_stats_id, |
| 251 &active_connection, |
| 252 &selected_candidate_pair_id, |
| 253 &local_certificate_id, |
| 254 &remote_certificate_id); |
| 255 |
| 256 RTCTransportStats::RTCTransportStats( |
| 257 const std::string& id, int64_t timestamp_us) |
| 258 : RTCTransportStats(std::string(id), timestamp_us) { |
| 259 } |
| 260 |
| 261 RTCTransportStats::RTCTransportStats( |
| 262 std::string&& id, int64_t timestamp_us) |
| 263 : RTCStats(std::move(id), timestamp_us), |
| 264 bytes_sent("bytesSent"), |
| 265 bytes_received("bytesReceived"), |
| 266 rtcp_transport_stats_id("rtcpTransportStatsId"), |
| 267 active_connection("activeConnection"), |
| 268 selected_candidate_pair_id("selectedCandidatePairId"), |
| 269 local_certificate_id("localCertificateId"), |
| 270 remote_certificate_id("remoteCertificateId") { |
| 271 } |
| 272 |
| 273 RTCTransportStats::RTCTransportStats( |
| 274 const RTCTransportStats& other) |
| 275 : RTCStats(other.id(), other.timestamp_us()), |
| 276 bytes_sent(other.bytes_sent), |
| 277 bytes_received(other.bytes_received), |
| 278 rtcp_transport_stats_id(other.rtcp_transport_stats_id), |
| 279 active_connection(other.active_connection), |
| 280 selected_candidate_pair_id(other.selected_candidate_pair_id), |
| 281 local_certificate_id(other.local_certificate_id), |
| 282 remote_certificate_id(other.remote_certificate_id) { |
| 283 } |
| 284 |
| 285 RTCTransportStats::~RTCTransportStats() { |
| 286 } |
| 287 |
247 } // namespace webrtc | 288 } // namespace webrtc |
OLD | NEW |