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

Side by Side Diff: webrtc/api/stats/rtcstats_objects.h

Issue 2408363002: RTCTransportStats added. (Closed)
Patch Set: nits and rebase with master Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « webrtc/api/rtcstatscollector_unittest.cc ('k') | webrtc/stats/rtcstats_objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
(...skipping 25 matching lines...) Expand all
36 }; 36 };
37 37
38 // https://w3c.github.io/webrtc-pc/#rtcicecandidatetype-enum 38 // https://w3c.github.io/webrtc-pc/#rtcicecandidatetype-enum
39 struct RTCIceCandidateType { 39 struct RTCIceCandidateType {
40 static const char* kHost; 40 static const char* kHost;
41 static const char* kSrflx; 41 static const char* kSrflx;
42 static const char* kPrflx; 42 static const char* kPrflx;
43 static const char* kRelay; 43 static const char* kRelay;
44 }; 44 };
45 45
46 // https://w3c.github.io/webrtc-stats/#certificatestats-dict*
47 class RTCCertificateStats final : public RTCStats {
48 public:
49 WEBRTC_RTCSTATS_DECL();
50
51 RTCCertificateStats(const std::string& id, int64_t timestamp_us);
52 RTCCertificateStats(std::string&& id, int64_t timestamp_us);
53 RTCCertificateStats(const RTCCertificateStats& other);
54 ~RTCCertificateStats() override;
55
56 RTCStatsMember<std::string> fingerprint;
57 RTCStatsMember<std::string> fingerprint_algorithm;
58 RTCStatsMember<std::string> base64_certificate;
59 RTCStatsMember<std::string> issuer_certificate_id;
60 };
61
62 // https://w3c.github.io/webrtc-stats/#dcstats-dict*
63 class RTCDataChannelStats final : public RTCStats {
64 public:
65 WEBRTC_RTCSTATS_DECL();
66
67 RTCDataChannelStats(const std::string& id, int64_t timestamp_us);
68 RTCDataChannelStats(std::string&& id, int64_t timestamp_us);
69 RTCDataChannelStats(const RTCDataChannelStats& other);
70 ~RTCDataChannelStats() override;
71
72 RTCStatsMember<std::string> label;
73 RTCStatsMember<std::string> protocol;
74 RTCStatsMember<int32_t> datachannelid;
75 // TODO(hbos): Support enum types? "RTCStatsMember<RTCDataChannelState>"?
76 RTCStatsMember<std::string> state;
77 RTCStatsMember<uint32_t> messages_sent;
78 RTCStatsMember<uint64_t> bytes_sent;
79 RTCStatsMember<uint32_t> messages_received;
80 RTCStatsMember<uint64_t> bytes_received;
81 };
82
83 // https://w3c.github.io/webrtc-stats/#candidatepair-dict*
84 // TODO(hbos): Finish implementation. Tracking bug crbug.com/633550
46 class RTCIceCandidatePairStats : public RTCStats { 85 class RTCIceCandidatePairStats : public RTCStats {
47 public: 86 public:
48 WEBRTC_RTCSTATS_DECL(); 87 WEBRTC_RTCSTATS_DECL();
49 88
50 RTCIceCandidatePairStats(const std::string& id, int64_t timestamp_us); 89 RTCIceCandidatePairStats(const std::string& id, int64_t timestamp_us);
51 RTCIceCandidatePairStats(std::string&& id, int64_t timestamp_us); 90 RTCIceCandidatePairStats(std::string&& id, int64_t timestamp_us);
52 RTCIceCandidatePairStats(const RTCIceCandidatePairStats& other); 91 RTCIceCandidatePairStats(const RTCIceCandidatePairStats& other);
53 ~RTCIceCandidatePairStats() override; 92 ~RTCIceCandidatePairStats() override;
54 93
55 RTCStatsMember<std::string> transport_id; 94 RTCStatsMember<std::string> transport_id;
(...skipping 18 matching lines...) Expand all
74 RTCStatsMember<uint64_t> responses_sent; 113 RTCStatsMember<uint64_t> responses_sent;
75 RTCStatsMember<uint64_t> retransmissions_received; 114 RTCStatsMember<uint64_t> retransmissions_received;
76 RTCStatsMember<uint64_t> retransmissions_sent; 115 RTCStatsMember<uint64_t> retransmissions_sent;
77 RTCStatsMember<uint64_t> consent_requests_received; 116 RTCStatsMember<uint64_t> consent_requests_received;
78 RTCStatsMember<uint64_t> consent_requests_sent; 117 RTCStatsMember<uint64_t> consent_requests_sent;
79 RTCStatsMember<uint64_t> consent_responses_received; 118 RTCStatsMember<uint64_t> consent_responses_received;
80 RTCStatsMember<uint64_t> consent_responses_sent; 119 RTCStatsMember<uint64_t> consent_responses_sent;
81 }; 120 };
82 121
83 // https://w3c.github.io/webrtc-stats/#icecandidate-dict* 122 // https://w3c.github.io/webrtc-stats/#icecandidate-dict*
123 // TODO(hbos): Finish implementation. Tracking bug crbug.com/632723
84 class RTCIceCandidateStats : public RTCStats { 124 class RTCIceCandidateStats : public RTCStats {
85 public: 125 public:
86 WEBRTC_RTCSTATS_DECL(); 126 WEBRTC_RTCSTATS_DECL();
87 127
88 RTCIceCandidateStats(const RTCIceCandidateStats& other); 128 RTCIceCandidateStats(const RTCIceCandidateStats& other);
89 ~RTCIceCandidateStats() override; 129 ~RTCIceCandidateStats() override;
90 130
91 RTCStatsMember<std::string> ip; 131 RTCStatsMember<std::string> ip;
92 RTCStatsMember<int32_t> port; 132 RTCStatsMember<int32_t> port;
93 RTCStatsMember<std::string> protocol; 133 RTCStatsMember<std::string> protocol;
(...skipping 20 matching lines...) Expand all
114 }; 154 };
115 155
116 class RTCRemoteIceCandidateStats final : public RTCIceCandidateStats { 156 class RTCRemoteIceCandidateStats final : public RTCIceCandidateStats {
117 public: 157 public:
118 static const char kType[]; 158 static const char kType[];
119 RTCRemoteIceCandidateStats(const std::string& id, int64_t timestamp_us); 159 RTCRemoteIceCandidateStats(const std::string& id, int64_t timestamp_us);
120 RTCRemoteIceCandidateStats(std::string&& id, int64_t timestamp_us); 160 RTCRemoteIceCandidateStats(std::string&& id, int64_t timestamp_us);
121 const char* type() const override; 161 const char* type() const override;
122 }; 162 };
123 163
124 // https://w3c.github.io/webrtc-stats/#certificatestats-dict*
125 class RTCCertificateStats final : public RTCStats {
126 public:
127 WEBRTC_RTCSTATS_DECL();
128
129 RTCCertificateStats(const std::string& id, int64_t timestamp_us);
130 RTCCertificateStats(std::string&& id, int64_t timestamp_us);
131 RTCCertificateStats(const RTCCertificateStats& other);
132 ~RTCCertificateStats() override;
133
134 RTCStatsMember<std::string> fingerprint;
135 RTCStatsMember<std::string> fingerprint_algorithm;
136 RTCStatsMember<std::string> base64_certificate;
137 RTCStatsMember<std::string> issuer_certificate_id;
138 };
139
140 // https://w3c.github.io/webrtc-stats/#dcstats-dict*
141 class RTCDataChannelStats final : public RTCStats {
142 public:
143 WEBRTC_RTCSTATS_DECL();
144
145 RTCDataChannelStats(const std::string& id, int64_t timestamp_us);
146 RTCDataChannelStats(std::string&& id, int64_t timestamp_us);
147 RTCDataChannelStats(const RTCDataChannelStats& other);
148 ~RTCDataChannelStats() override;
149
150 RTCStatsMember<std::string> label;
151 RTCStatsMember<std::string> protocol;
152 RTCStatsMember<int32_t> datachannelid;
153 // TODO(hbos): Support enum types? "RTCStatsMember<RTCDataChannelState>"?
154 RTCStatsMember<std::string> state;
155 RTCStatsMember<uint32_t> messages_sent;
156 RTCStatsMember<uint64_t> bytes_sent;
157 RTCStatsMember<uint32_t> messages_received;
158 RTCStatsMember<uint64_t> bytes_received;
159 };
160
161 // https://w3c.github.io/webrtc-stats/#pcstats-dict* 164 // https://w3c.github.io/webrtc-stats/#pcstats-dict*
162 // TODO(hbos): Tracking bug crbug.com/636818 165 // TODO(hbos): Finish implementation. Tracking bug crbug.com/636818
163 class RTCPeerConnectionStats final : public RTCStats { 166 class RTCPeerConnectionStats final : public RTCStats {
164 public: 167 public:
165 WEBRTC_RTCSTATS_DECL(); 168 WEBRTC_RTCSTATS_DECL();
166 169
167 RTCPeerConnectionStats(const std::string& id, int64_t timestamp_us); 170 RTCPeerConnectionStats(const std::string& id, int64_t timestamp_us);
168 RTCPeerConnectionStats(std::string&& id, int64_t timestamp_us); 171 RTCPeerConnectionStats(std::string&& id, int64_t timestamp_us);
169 RTCPeerConnectionStats(const RTCPeerConnectionStats& other); 172 RTCPeerConnectionStats(const RTCPeerConnectionStats& other);
170 ~RTCPeerConnectionStats() override; 173 ~RTCPeerConnectionStats() override;
171 174
172 RTCStatsMember<uint32_t> data_channels_opened; 175 RTCStatsMember<uint32_t> data_channels_opened;
173 RTCStatsMember<uint32_t> data_channels_closed; 176 RTCStatsMember<uint32_t> data_channels_closed;
174 }; 177 };
175 178
179 // https://w3c.github.io/webrtc-stats/#transportstats-dict*
180 class RTCTransportStats final : public RTCStats {
181 public:
182 WEBRTC_RTCSTATS_DECL();
183
184 RTCTransportStats(const std::string& id, int64_t timestamp_us);
185 RTCTransportStats(std::string&& id, int64_t timestamp_us);
186 RTCTransportStats(const RTCTransportStats& other);
187 ~RTCTransportStats() override;
188
189 RTCStatsMember<uint64_t> bytes_sent;
190 RTCStatsMember<uint64_t> bytes_received;
191 RTCStatsMember<std::string> rtcp_transport_stats_id;
192 RTCStatsMember<bool> active_connection;
193 RTCStatsMember<std::string> selected_candidate_pair_id;
194 RTCStatsMember<std::string> local_certificate_id;
195 RTCStatsMember<std::string> remote_certificate_id;
196 };
197
176 } // namespace webrtc 198 } // namespace webrtc
177 199
178 #endif // WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ 200 #endif // WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_
OLDNEW
« 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