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

Unified Diff: webrtc/stats/rtcstats_objects.cc

Issue 2420473002: RTCDataChannelStats added. (Closed)
Patch Set: ForTesting 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 side-by-side diff with in-line comments
Download patch
« webrtc/api/test/mock_datachannel.h ('K') | « webrtc/api/test/mock_datachannel.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/stats/rtcstats_objects.cc
diff --git a/webrtc/stats/rtcstats_objects.cc b/webrtc/stats/rtcstats_objects.cc
index 947b5647d7f46325748d1126623a3b38f9f1c06e..3d82d09e4a4ad1eff57acd390b48e531bccb4709 100644
--- a/webrtc/stats/rtcstats_objects.cc
+++ b/webrtc/stats/rtcstats_objects.cc
@@ -12,6 +12,11 @@
namespace webrtc {
+const char* RTCDataChannelState::kConnecting = "connecting";
+const char* RTCDataChannelState::kOpen = "open";
+const char* RTCDataChannelState::kClosing = "closing";
+const char* RTCDataChannelState::kClosed = "closed";
+
const char* RTCStatsIceCandidatePairState::kFrozen = "frozen";
const char* RTCStatsIceCandidatePairState::kWaiting = "waiting";
const char* RTCStatsIceCandidatePairState::kInProgress = "inprogress";
@@ -218,6 +223,50 @@ RTCCertificateStats::RTCCertificateStats(
RTCCertificateStats::~RTCCertificateStats() {
}
+WEBRTC_RTCSTATS_IMPL(RTCDataChannelStats, RTCStats, "data-channel",
+ &label,
+ &protocol,
+ &datachannelid,
+ &state,
+ &messages_sent,
+ &bytes_sent,
+ &messages_received,
+ &bytes_received);
+
+RTCDataChannelStats::RTCDataChannelStats(
+ const std::string& id, int64_t timestamp_us)
+ : RTCDataChannelStats(std::string(id), timestamp_us) {
+}
+
+RTCDataChannelStats::RTCDataChannelStats(
+ std::string&& id, int64_t timestamp_us)
+ : RTCStats(std::move(id), timestamp_us),
+ label("label"),
+ protocol("protocol"),
+ datachannelid("datachannelid"),
+ state("state"),
+ messages_sent("messagesSent"),
+ bytes_sent("bytesSent"),
+ messages_received("messagesReceived"),
+ bytes_received("bytesReceived") {
+}
+
+RTCDataChannelStats::RTCDataChannelStats(
+ const RTCDataChannelStats& other)
+ : RTCStats(other.id(), other.timestamp_us()),
+ label(other.label),
+ protocol(other.protocol),
+ datachannelid(other.datachannelid),
+ state(other.state),
+ messages_sent(other.messages_sent),
+ bytes_sent(other.bytes_sent),
+ messages_received(other.messages_received),
+ bytes_received(other.bytes_received) {
+}
+
+RTCDataChannelStats::~RTCDataChannelStats() {
+}
+
WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
&data_channels_opened,
&data_channels_closed);
« webrtc/api/test/mock_datachannel.h ('K') | « webrtc/api/test/mock_datachannel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698