stats: add address as alias for ip
this was renamed in https://github.com/w3c/webrtc-pc/issues/1913 and https://github.com/w3c/webrtc-stats/pull/381
Spec: https://w3c.github.io/webrtc-stats/#dom-rtcicecandidatestats-address
BUG=chromium:968203
Change-Id: If75849fe1dc87ada6850e7b64aa8569e13baf0d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212681
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/master@{#33534}
diff --git a/api/stats/rtcstats_objects.h b/api/stats/rtcstats_objects.h
index a4e8ead..3b92419 100644
--- a/api/stats/rtcstats_objects.h
+++ b/api/stats/rtcstats_objects.h
@@ -211,6 +211,7 @@
RTCStatsMember<bool> is_remote;
RTCStatsMember<std::string> network_type;
RTCStatsMember<std::string> ip;
+ RTCStatsMember<std::string> address;
RTCStatsMember<int32_t> port;
RTCStatsMember<std::string> protocol;
RTCStatsMember<std::string> relay_protocol;
diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc
index 6f5f035..c14f414 100644
--- a/pc/rtc_stats_collector.cc
+++ b/pc/rtc_stats_collector.cc
@@ -652,6 +652,7 @@
RTC_DCHECK_EQ(rtc::ADAPTER_TYPE_UNKNOWN, candidate.network_type());
}
candidate_stats->ip = candidate.address().ipaddr().ToString();
+ candidate_stats->address = candidate.address().ipaddr().ToString();
candidate_stats->port = static_cast<int32_t>(candidate.address().port());
candidate_stats->protocol = candidate.protocol();
candidate_stats->candidate_type =
diff --git a/pc/rtc_stats_collector_unittest.cc b/pc/rtc_stats_collector_unittest.cc
index 1516bba..35ff48c 100644
--- a/pc/rtc_stats_collector_unittest.cc
+++ b/pc/rtc_stats_collector_unittest.cc
@@ -1083,6 +1083,7 @@
expected_a_local_host.transport_id = "RTCTransport_a_0";
expected_a_local_host.network_type = "vpn";
expected_a_local_host.ip = "1.2.3.4";
+ expected_a_local_host.address = "1.2.3.4";
expected_a_local_host.port = 5;
expected_a_local_host.protocol = "a_local_host's protocol";
expected_a_local_host.candidate_type = "host";
@@ -1096,6 +1097,7 @@
"RTCIceCandidate_" + a_remote_srflx->id(), 0);
expected_a_remote_srflx.transport_id = "RTCTransport_a_0";
expected_a_remote_srflx.ip = "6.7.8.9";
+ expected_a_remote_srflx.address = "6.7.8.9";
expected_a_remote_srflx.port = 10;
expected_a_remote_srflx.protocol = "remote_srflx's protocol";
expected_a_remote_srflx.candidate_type = "srflx";
@@ -1111,6 +1113,7 @@
expected_a_local_prflx.transport_id = "RTCTransport_a_0";
expected_a_local_prflx.network_type = "cellular";
expected_a_local_prflx.ip = "11.12.13.14";
+ expected_a_local_prflx.address = "11.12.13.14";
expected_a_local_prflx.port = 15;
expected_a_local_prflx.protocol = "a_local_prflx's protocol";
expected_a_local_prflx.candidate_type = "prflx";
@@ -1125,6 +1128,7 @@
"RTCIceCandidate_" + a_remote_relay->id(), 0);
expected_a_remote_relay.transport_id = "RTCTransport_a_0";
expected_a_remote_relay.ip = "16.17.18.19";
+ expected_a_remote_relay.address = "16.17.18.19";
expected_a_remote_relay.port = 20;
expected_a_remote_relay.protocol = "a_remote_relay's protocol";
expected_a_remote_relay.candidate_type = "relay";
@@ -1141,6 +1145,7 @@
"RTCIceCandidate_" + a_local_relay->id(), 0);
expected_a_local_relay.transport_id = "RTCTransport_a_0";
expected_a_local_relay.ip = "16.17.18.19";
+ expected_a_local_relay.address = "16.17.18.19";
expected_a_local_relay.port = 21;
expected_a_local_relay.protocol = "a_local_relay's protocol";
expected_a_local_relay.relay_protocol = "tcp";
@@ -1158,6 +1163,7 @@
expected_b_local.transport_id = "RTCTransport_b_0";
expected_b_local.network_type = "wifi";
expected_b_local.ip = "42.42.42.42";
+ expected_b_local.address = "42.42.42.42";
expected_b_local.port = 42;
expected_b_local.protocol = "b_local's protocol";
expected_b_local.candidate_type = "host";
@@ -1172,6 +1178,7 @@
"RTCIceCandidate_" + b_remote->id(), 0);
expected_b_remote.transport_id = "RTCTransport_b_0";
expected_b_remote.ip = "42.42.42.42";
+ expected_b_remote.address = "42.42.42.42";
expected_b_remote.port = 42;
expected_b_remote.protocol = "b_remote's protocol";
expected_b_remote.candidate_type = "host";
@@ -1373,6 +1380,7 @@
expected_local_candidate.transport_id = *expected_pair.transport_id;
expected_local_candidate.network_type = "wifi";
expected_local_candidate.ip = "42.42.42.42";
+ expected_local_candidate.address = "42.42.42.42";
expected_local_candidate.port = 42;
expected_local_candidate.protocol = "protocol";
expected_local_candidate.candidate_type = "host";
@@ -1388,6 +1396,7 @@
*expected_pair.remote_candidate_id, report->timestamp_us());
expected_remote_candidate.transport_id = *expected_pair.transport_id;
expected_remote_candidate.ip = "42.42.42.42";
+ expected_remote_candidate.address = "42.42.42.42";
expected_remote_candidate.port = 42;
expected_remote_candidate.protocol = "protocol";
expected_remote_candidate.candidate_type = "host";
diff --git a/pc/rtc_stats_integrationtest.cc b/pc/rtc_stats_integrationtest.cc
index 68dd17b..456ca72 100644
--- a/pc/rtc_stats_integrationtest.cc
+++ b/pc/rtc_stats_integrationtest.cc
@@ -528,6 +528,7 @@
verifier.TestMemberIsDefined(candidate.network_type);
}
verifier.TestMemberIsDefined(candidate.ip);
+ verifier.TestMemberIsDefined(candidate.address);
verifier.TestMemberIsNonNegative<int32_t>(candidate.port);
verifier.TestMemberIsDefined(candidate.protocol);
verifier.TestMemberIsDefined(candidate.candidate_type);
diff --git a/stats/rtcstats_objects.cc b/stats/rtcstats_objects.cc
index 8e9f047..33492e7 100644
--- a/stats/rtcstats_objects.cc
+++ b/stats/rtcstats_objects.cc
@@ -259,6 +259,7 @@
&is_remote,
&network_type,
&ip,
+ &address,
&port,
&protocol,
&relay_protocol,
@@ -281,6 +282,7 @@
is_remote("isRemote", is_remote),
network_type("networkType"),
ip("ip"),
+ address("address"),
port("port"),
protocol("protocol"),
relay_protocol("relayProtocol"),
@@ -295,6 +297,7 @@
is_remote(other.is_remote),
network_type(other.network_type),
ip(other.ip),
+ address(other.address),
port(other.port),
protocol(other.protocol),
relay_protocol(other.relay_protocol),