Replace hostCandidate with address and port in RTCPeerConnectionIceErrorEvent
Bug: chromium:1013564
Change-Id: Ie1bb86ed6a2a7d73fe6ee666f973d809ed05a7ed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161084
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Eldar Rello <elrello@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#30004}
diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc
index 1339638..0d43da4 100644
--- a/pc/peer_connection.cc
+++ b/pc/peer_connection.cc
@@ -4736,14 +4736,17 @@
Observer()->OnIceCandidate(candidate.get());
}
-void PeerConnection::OnIceCandidateError(const std::string& host_candidate,
+void PeerConnection::OnIceCandidateError(const std::string& address,
+ int port,
const std::string& url,
int error_code,
const std::string& error_text) {
if (IsClosed()) {
return;
}
- Observer()->OnIceCandidateError(host_candidate, url, error_code, error_text);
+ Observer()->OnIceCandidateError(address, port, url, error_code, error_text);
+ // Leftover not to break wpt test during migration to the new API.
+ Observer()->OnIceCandidateError(address + ":", url, error_code, error_text);
}
void PeerConnection::OnIceCandidatesRemoved(
@@ -6348,7 +6351,7 @@
void PeerConnection::OnTransportControllerCandidateError(
const cricket::IceCandidateErrorEvent& event) {
- OnIceCandidateError(event.host_candidate, event.url, event.error_code,
+ OnIceCandidateError(event.address, event.port, event.url, event.error_code,
event.error_text);
}
diff --git a/pc/peer_connection.h b/pc/peer_connection.h
index 0e1a1f8..9065982 100644
--- a/pc/peer_connection.h
+++ b/pc/peer_connection.h
@@ -569,7 +569,8 @@
void OnIceCandidate(std::unique_ptr<IceCandidateInterface> candidate)
RTC_RUN_ON(signaling_thread());
// Gathering of an ICE candidate failed.
- void OnIceCandidateError(const std::string& host_candidate,
+ void OnIceCandidateError(const std::string& address,
+ int port,
const std::string& url,
int error_code,
const std::string& error_text)
diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc
index dd06b65..d68b058 100644
--- a/pc/peer_connection_integrationtest.cc
+++ b/pc/peer_connection_integrationtest.cc
@@ -977,11 +977,12 @@
SendIceMessage(candidate->sdp_mid(), candidate->sdp_mline_index(), ice_sdp);
last_candidate_gathered_ = candidate->candidate();
}
- void OnIceCandidateError(const std::string& host_candidate,
+ void OnIceCandidateError(const std::string& address,
+ int port,
const std::string& url,
int error_code,
const std::string& error_text) override {
- error_event_ = cricket::IceCandidateErrorEvent(host_candidate, url,
+ error_event_ = cricket::IceCandidateErrorEvent(address, port, url,
error_code, error_text);
}
void OnDataChannel(
@@ -5708,8 +5709,7 @@
EXPECT_EQ_WAIT(401, caller()->error_event().error_code, kDefaultTimeout);
EXPECT_EQ("Unauthorized", caller()->error_event().error_text);
EXPECT_EQ("turn:88.88.88.0:3478?transport=udp", caller()->error_event().url);
- EXPECT_NE(std::string::npos,
- caller()->error_event().host_candidate.find(":"));
+ EXPECT_NE(caller()->error_event().address, "");
}
TEST_F(PeerConnectionIntegrationTestUnifiedPlan,