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

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

Issue 2420473002: RTCDataChannelStats added. (Closed)
Patch Set: 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 unified diff | Download patch
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
11 #ifndef WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ 11 #ifndef WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_
12 #define WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ 12 #define WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_
13 13
14 #include <string> 14 #include <string>
15 15
16 #include "webrtc/api/stats/rtcstats.h" 16 #include "webrtc/api/stats/rtcstats.h"
17 17
18 namespace webrtc { 18 namespace webrtc {
19 19
20 // https://w3c.github.io/webrtc-pc/#idl-def-rtcdatachannelstate
21 struct RTCDataChannelState {
22 static const char* kConnecting;
23 static const char* kOpen;
24 static const char* kClosing;
25 static const char* kClosed;
26 };
27
20 // https://w3c.github.io/webrtc-stats/#dom-rtcstatsicecandidatepairstate 28 // https://w3c.github.io/webrtc-stats/#dom-rtcstatsicecandidatepairstate
21 struct RTCStatsIceCandidatePairState { 29 struct RTCStatsIceCandidatePairState {
22 static const char* kFrozen; 30 static const char* kFrozen;
23 static const char* kWaiting; 31 static const char* kWaiting;
24 static const char* kInProgress; 32 static const char* kInProgress;
25 static const char* kFailed; 33 static const char* kFailed;
26 static const char* kSucceeded; 34 static const char* kSucceeded;
27 static const char* kCancelled; 35 static const char* kCancelled;
28 }; 36 };
29 37
30 // https://www.w3.org/TR/webrtc/#rtcicecandidatetype-enum 38 // https://w3c.github.io/webrtc-pc/#rtcicecandidatetype-enum
31 struct RTCIceCandidateType { 39 struct RTCIceCandidateType {
32 static const char* kHost; 40 static const char* kHost;
33 static const char* kSrflx; 41 static const char* kSrflx;
34 static const char* kPrflx; 42 static const char* kPrflx;
35 static const char* kRelay; 43 static const char* kRelay;
36 }; 44 };
37 45
38 class RTCIceCandidatePairStats : public RTCStats { 46 class RTCIceCandidatePairStats : public RTCStats {
39 public: 47 public:
40 WEBRTC_RTCSTATS_DECL(); 48 WEBRTC_RTCSTATS_DECL();
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 RTCCertificateStats(std::string&& id, int64_t timestamp_us); 130 RTCCertificateStats(std::string&& id, int64_t timestamp_us);
123 RTCCertificateStats(const RTCCertificateStats& other); 131 RTCCertificateStats(const RTCCertificateStats& other);
124 ~RTCCertificateStats() override; 132 ~RTCCertificateStats() override;
125 133
126 RTCStatsMember<std::string> fingerprint; 134 RTCStatsMember<std::string> fingerprint;
127 RTCStatsMember<std::string> fingerprint_algorithm; 135 RTCStatsMember<std::string> fingerprint_algorithm;
128 RTCStatsMember<std::string> base64_certificate; 136 RTCStatsMember<std::string> base64_certificate;
129 RTCStatsMember<std::string> issuer_certificate_id; 137 RTCStatsMember<std::string> issuer_certificate_id;
130 }; 138 };
131 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
132 // https://w3c.github.io/webrtc-stats/#pcstats-dict* 161 // https://w3c.github.io/webrtc-stats/#pcstats-dict*
133 // TODO(hbos): Tracking bug crbug.com/636818 162 // TODO(hbos): Tracking bug crbug.com/636818
134 class RTCPeerConnectionStats final : public RTCStats { 163 class RTCPeerConnectionStats final : public RTCStats {
135 public: 164 public:
136 WEBRTC_RTCSTATS_DECL(); 165 WEBRTC_RTCSTATS_DECL();
137 166
138 RTCPeerConnectionStats(const std::string& id, int64_t timestamp_us); 167 RTCPeerConnectionStats(const std::string& id, int64_t timestamp_us);
139 RTCPeerConnectionStats(std::string&& id, int64_t timestamp_us); 168 RTCPeerConnectionStats(std::string&& id, int64_t timestamp_us);
140 RTCPeerConnectionStats(const RTCPeerConnectionStats& other); 169 RTCPeerConnectionStats(const RTCPeerConnectionStats& other);
141 ~RTCPeerConnectionStats() override; 170 ~RTCPeerConnectionStats() override;
142 171
143 RTCStatsMember<uint32_t> data_channels_opened; 172 RTCStatsMember<uint32_t> data_channels_opened;
144 RTCStatsMember<uint32_t> data_channels_closed; 173 RTCStatsMember<uint32_t> data_channels_closed;
145 }; 174 };
146 175
147 } // namespace webrtc 176 } // namespace webrtc
148 177
149 #endif // WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ 178 #endif // WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698