Removing "candidates" attribute from TransportDescription.
It's never used anywhere, so it only causes confusion between
itself and SessionDescriptionInterface::candidates.
Review URL: https://codereview.webrtc.org/1642733002
Cr-Commit-Position: refs/heads/master@{#11420}
diff --git a/talk/app/webrtc/jsepsessiondescription_unittest.cc b/talk/app/webrtc/jsepsessiondescription_unittest.cc
index a609114..d00617b 100644
--- a/talk/app/webrtc/jsepsessiondescription_unittest.cc
+++ b/talk/app/webrtc/jsepsessiondescription_unittest.cc
@@ -73,23 +73,16 @@
desc->AddContent(cricket::CN_VIDEO, cricket::NS_JINGLE_RTP,
video.release());
- EXPECT_TRUE(desc->AddTransportInfo(
- cricket::TransportInfo(
- cricket::CN_AUDIO,
- cricket::TransportDescription(
- std::vector<std::string>(),
- kCandidateUfragVoice, kCandidatePwdVoice,
- cricket::ICEMODE_FULL,
- cricket::CONNECTIONROLE_NONE,
- NULL, cricket::Candidates()))));
- EXPECT_TRUE(desc->AddTransportInfo(
- cricket::TransportInfo(cricket::CN_VIDEO,
- cricket::TransportDescription(
- std::vector<std::string>(),
- kCandidateUfragVideo, kCandidatePwdVideo,
- cricket::ICEMODE_FULL,
- cricket::CONNECTIONROLE_NONE,
- NULL, cricket::Candidates()))));
+ EXPECT_TRUE(desc->AddTransportInfo(cricket::TransportInfo(
+ cricket::CN_AUDIO,
+ cricket::TransportDescription(
+ std::vector<std::string>(), kCandidateUfragVoice, kCandidatePwdVoice,
+ cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_NONE, NULL))));
+ EXPECT_TRUE(desc->AddTransportInfo(cricket::TransportInfo(
+ cricket::CN_VIDEO,
+ cricket::TransportDescription(
+ std::vector<std::string>(), kCandidateUfragVideo, kCandidatePwdVideo,
+ cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_NONE, NULL))));
return desc;
}
diff --git a/talk/app/webrtc/webrtcsdp.cc b/talk/app/webrtc/webrtcsdp.cc
index e287e90..f5fb7f7 100644
--- a/talk/app/webrtc/webrtcsdp.cc
+++ b/talk/app/webrtc/webrtcsdp.cc
@@ -2207,13 +2207,10 @@
// Make a temporary TransportDescription based on |session_td|.
// Some of this gets overwritten by ParseContent.
- TransportDescription transport(session_td.transport_options,
- session_td.ice_ufrag,
- session_td.ice_pwd,
- session_td.ice_mode,
- session_td.connection_role,
- session_td.identity_fingerprint.get(),
- Candidates());
+ TransportDescription transport(
+ session_td.transport_options, session_td.ice_ufrag, session_td.ice_pwd,
+ session_td.ice_mode, session_td.connection_role,
+ session_td.identity_fingerprint.get());
rtc::scoped_ptr<MediaContentDescription> content;
std::string content_name;
diff --git a/talk/app/webrtc/webrtcsdp_unittest.cc b/talk/app/webrtc/webrtcsdp_unittest.cc
index 15fc808..70e0f36 100644
--- a/talk/app/webrtc/webrtcsdp_unittest.cc
+++ b/talk/app/webrtc/webrtcsdp_unittest.cc
@@ -898,26 +898,12 @@
}
EXPECT_EQ(transport1.description.transport_options,
transport2.description.transport_options);
- EXPECT_TRUE(CompareCandidates(transport1.description.candidates,
- transport2.description.candidates));
}
// global attributes
EXPECT_EQ(desc1.msid_supported(), desc2.msid_supported());
}
- bool CompareCandidates(const Candidates& cs1, const Candidates& cs2) {
- EXPECT_EQ(cs1.size(), cs2.size());
- if (cs1.size() != cs2.size())
- return false;
- for (size_t i = 0; i< cs1.size(); ++i) {
- const Candidate c1 = cs1.at(i);
- const Candidate c2 = cs2.at(i);
- EXPECT_TRUE(c1.IsEquivalent(c2));
- }
- return true;
- }
-
bool CompareSessionDescription(
const JsepSessionDescription& desc1,
const JsepSessionDescription& desc2) {
@@ -1015,22 +1001,16 @@
rtc::SSLFingerprint fingerprint(rtc::DIGEST_SHA_1,
kIdentityDigest,
sizeof(kIdentityDigest));
- EXPECT_TRUE(desc_.AddTransportInfo(
- TransportInfo(kAudioContentName,
- TransportDescription(std::vector<std::string>(),
- kCandidateUfragVoice,
- kCandidatePwdVoice,
- cricket::ICEMODE_FULL,
- cricket::CONNECTIONROLE_NONE,
- &fingerprint, Candidates()))));
- EXPECT_TRUE(desc_.AddTransportInfo(
- TransportInfo(kVideoContentName,
- TransportDescription(std::vector<std::string>(),
- kCandidateUfragVideo,
- kCandidatePwdVideo,
- cricket::ICEMODE_FULL,
- cricket::CONNECTIONROLE_NONE,
- &fingerprint, Candidates()))));
+ EXPECT_TRUE(desc_.AddTransportInfo(TransportInfo(
+ kAudioContentName,
+ TransportDescription(std::vector<std::string>(), kCandidateUfragVoice,
+ kCandidatePwdVoice, cricket::ICEMODE_FULL,
+ cricket::CONNECTIONROLE_NONE, &fingerprint))));
+ EXPECT_TRUE(desc_.AddTransportInfo(TransportInfo(
+ kVideoContentName,
+ TransportDescription(std::vector<std::string>(), kCandidateUfragVideo,
+ kCandidatePwdVideo, cricket::ICEMODE_FULL,
+ cricket::CONNECTIONROLE_NONE, &fingerprint))));
}
void AddExtmap() {
diff --git a/webrtc/p2p/base/dtlstransportchannel_unittest.cc b/webrtc/p2p/base/dtlstransportchannel_unittest.cc
index efbdba0..0cf500f 100644
--- a/webrtc/p2p/base/dtlstransportchannel_unittest.cc
+++ b/webrtc/p2p/base/dtlstransportchannel_unittest.cc
@@ -162,12 +162,11 @@
// without any fingerprint.
(action == cricket::CA_ANSWER && !remote_cert)
? nullptr
- : local_fingerprint.get(),
- cricket::Candidates());
+ : local_fingerprint.get());
cricket::TransportDescription remote_desc(
std::vector<std::string>(), kIceUfrag1, kIcePwd1, cricket::ICEMODE_FULL,
- remote_role, remote_fingerprint.get(), cricket::Candidates());
+ remote_role, remote_fingerprint.get());
bool expect_success = (flags & NF_EXPECT_FAILURE) ? false : true;
// If |expect_success| is false, expect SRTD or SLTD to fail when
diff --git a/webrtc/p2p/base/transport.cc b/webrtc/p2p/base/transport.cc
index eff10aa..bac695d 100644
--- a/webrtc/p2p/base/transport.cc
+++ b/webrtc/p2p/base/transport.cc
@@ -236,10 +236,10 @@
// initiate request initiated by the remote.
LOG(LS_INFO) << "Transport::ConnectChannels: No local description has "
<< "been set. Will generate one.";
- TransportDescription desc(
- std::vector<std::string>(), rtc::CreateRandomString(ICE_UFRAG_LENGTH),
- rtc::CreateRandomString(ICE_PWD_LENGTH), ICEMODE_FULL,
- CONNECTIONROLE_NONE, nullptr, Candidates());
+ TransportDescription desc(std::vector<std::string>(),
+ rtc::CreateRandomString(ICE_UFRAG_LENGTH),
+ rtc::CreateRandomString(ICE_PWD_LENGTH),
+ ICEMODE_FULL, CONNECTIONROLE_NONE, nullptr);
SetLocalTransportDescription(desc, CA_OFFER, nullptr);
}
diff --git a/webrtc/p2p/base/transport_unittest.cc b/webrtc/p2p/base/transport_unittest.cc
index 1f66a47..96ebc5e 100644
--- a/webrtc/p2p/base/transport_unittest.cc
+++ b/webrtc/p2p/base/transport_unittest.cc
@@ -14,8 +14,6 @@
#include "webrtc/p2p/base/faketransportcontroller.h"
#include "webrtc/p2p/base/p2ptransport.h"
-using cricket::Candidate;
-using cricket::Candidates;
using cricket::Transport;
using cricket::FakeTransport;
using cricket::TransportChannel;
@@ -155,9 +153,8 @@
NULL));
cricket::TransportDescription remote_desc(
- std::vector<std::string>(),
- kIceUfrag1, kIcePwd1, cricket::ICEMODE_LITE,
- cricket::CONNECTIONROLE_NONE, NULL, cricket::Candidates());
+ std::vector<std::string>(), kIceUfrag1, kIcePwd1, cricket::ICEMODE_LITE,
+ cricket::CONNECTIONROLE_NONE, NULL);
ASSERT_TRUE(transport_->SetRemoteTransportDescription(remote_desc,
cricket::CA_ANSWER,
NULL));
@@ -176,9 +173,8 @@
TEST_F(TransportTest, TestSetRemoteIceLiteInOffer) {
transport_->SetIceRole(cricket::ICEROLE_CONTROLLED);
cricket::TransportDescription remote_desc(
- std::vector<std::string>(),
- kIceUfrag1, kIcePwd1, cricket::ICEMODE_LITE,
- cricket::CONNECTIONROLE_ACTPASS, NULL, cricket::Candidates());
+ std::vector<std::string>(), kIceUfrag1, kIcePwd1, cricket::ICEMODE_LITE,
+ cricket::CONNECTIONROLE_ACTPASS, NULL);
ASSERT_TRUE(transport_->SetRemoteTransportDescription(remote_desc,
cricket::CA_OFFER,
NULL));
@@ -205,9 +201,8 @@
// Channels will be created in ICEFULL_MODE.
EXPECT_EQ(cricket::ICEMODE_FULL, channel_->remote_ice_mode());
cricket::TransportDescription remote_desc(
- std::vector<std::string>(),
- kIceUfrag1, kIcePwd1, cricket::ICEMODE_LITE,
- cricket::CONNECTIONROLE_NONE, NULL, cricket::Candidates());
+ std::vector<std::string>(), kIceUfrag1, kIcePwd1, cricket::ICEMODE_LITE,
+ cricket::CONNECTIONROLE_NONE, NULL);
ASSERT_TRUE(transport_->SetRemoteTransportDescription(remote_desc,
cricket::CA_ANSWER,
NULL));
diff --git a/webrtc/p2p/base/transportcontroller_unittest.cc b/webrtc/p2p/base/transportcontroller_unittest.cc
index 6ff158e..96d0e98 100644
--- a/webrtc/p2p/base/transportcontroller_unittest.cc
+++ b/webrtc/p2p/base/transportcontroller_unittest.cc
@@ -111,9 +111,9 @@
FakeTransportChannel* channel2 = CreateChannel("video", 1);
ASSERT_NE(nullptr, channel2);
- TransportDescription local_desc(
- std::vector<std::string>(), kIceUfrag1, kIcePwd1, cricket::ICEMODE_FULL,
- cricket::CONNECTIONROLE_ACTPASS, nullptr, Candidates());
+ TransportDescription local_desc(std::vector<std::string>(), kIceUfrag1,
+ kIcePwd1, cricket::ICEMODE_FULL,
+ cricket::CONNECTIONROLE_ACTPASS, nullptr);
std::string err;
transport_controller_->SetLocalTransportDescription(
"audio", local_desc, cricket::CA_OFFER, &err);
@@ -322,9 +322,9 @@
TEST_F(TransportControllerTest, TestSetLocalTransportDescription) {
FakeTransportChannel* channel = CreateChannel("audio", 1);
ASSERT_NE(nullptr, channel);
- TransportDescription local_desc(
- std::vector<std::string>(), kIceUfrag1, kIcePwd1, cricket::ICEMODE_FULL,
- cricket::CONNECTIONROLE_ACTPASS, nullptr, Candidates());
+ TransportDescription local_desc(std::vector<std::string>(), kIceUfrag1,
+ kIcePwd1, cricket::ICEMODE_FULL,
+ cricket::CONNECTIONROLE_ACTPASS, nullptr);
std::string err;
EXPECT_TRUE(transport_controller_->SetLocalTransportDescription(
"audio", local_desc, cricket::CA_OFFER, &err));
@@ -341,9 +341,9 @@
TEST_F(TransportControllerTest, TestSetRemoteTransportDescription) {
FakeTransportChannel* channel = CreateChannel("audio", 1);
ASSERT_NE(nullptr, channel);
- TransportDescription remote_desc(
- std::vector<std::string>(), kIceUfrag1, kIcePwd1, cricket::ICEMODE_FULL,
- cricket::CONNECTIONROLE_ACTPASS, nullptr, Candidates());
+ TransportDescription remote_desc(std::vector<std::string>(), kIceUfrag1,
+ kIcePwd1, cricket::ICEMODE_FULL,
+ cricket::CONNECTIONROLE_ACTPASS, nullptr);
std::string err;
EXPECT_TRUE(transport_controller_->SetRemoteTransportDescription(
"audio", remote_desc, cricket::CA_OFFER, &err));
@@ -371,16 +371,16 @@
EXPECT_FALSE(transport_controller_->ReadyForRemoteCandidates("audio"));
std::string err;
- TransportDescription remote_desc(
- std::vector<std::string>(), kIceUfrag1, kIcePwd1, cricket::ICEMODE_FULL,
- cricket::CONNECTIONROLE_ACTPASS, nullptr, Candidates());
+ TransportDescription remote_desc(std::vector<std::string>(), kIceUfrag1,
+ kIcePwd1, cricket::ICEMODE_FULL,
+ cricket::CONNECTIONROLE_ACTPASS, nullptr);
EXPECT_TRUE(transport_controller_->SetRemoteTransportDescription(
"audio", remote_desc, cricket::CA_OFFER, &err));
EXPECT_FALSE(transport_controller_->ReadyForRemoteCandidates("audio"));
- TransportDescription local_desc(
- std::vector<std::string>(), kIceUfrag2, kIcePwd2, cricket::ICEMODE_FULL,
- cricket::CONNECTIONROLE_ACTPASS, nullptr, Candidates());
+ TransportDescription local_desc(std::vector<std::string>(), kIceUfrag2,
+ kIcePwd2, cricket::ICEMODE_FULL,
+ cricket::CONNECTIONROLE_ACTPASS, nullptr);
EXPECT_TRUE(transport_controller_->SetLocalTransportDescription(
"audio", local_desc, cricket::CA_ANSWER, &err));
EXPECT_TRUE(transport_controller_->ReadyForRemoteCandidates("audio"));
@@ -650,9 +650,9 @@
ASSERT_NE(nullptr, channel);
// Transport won't signal candidates until it has a local description.
- TransportDescription local_desc(
- std::vector<std::string>(), kIceUfrag1, kIcePwd1, cricket::ICEMODE_FULL,
- cricket::CONNECTIONROLE_ACTPASS, nullptr, Candidates());
+ TransportDescription local_desc(std::vector<std::string>(), kIceUfrag1,
+ kIcePwd1, cricket::ICEMODE_FULL,
+ cricket::CONNECTIONROLE_ACTPASS, nullptr);
std::string err;
EXPECT_TRUE(transport_controller_->SetLocalTransportDescription(
"audio", local_desc, cricket::CA_OFFER, &err));
diff --git a/webrtc/p2p/base/transportdescription.h b/webrtc/p2p/base/transportdescription.h
index 8ea1f4b..79fecc7 100644
--- a/webrtc/p2p/base/transportdescription.h
+++ b/webrtc/p2p/base/transportdescription.h
@@ -15,7 +15,6 @@
#include <string>
#include <vector>
-#include "webrtc/p2p/base/candidate.h"
#include "webrtc/p2p/base/constants.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/sslfingerprint.h"
@@ -69,8 +68,6 @@
bool StringToConnectionRole(const std::string& role_str, ConnectionRole* role);
bool ConnectionRoleToString(const ConnectionRole& role, std::string* role_str);
-typedef std::vector<Candidate> Candidates;
-
struct TransportDescription {
TransportDescription()
: ice_mode(ICEMODE_FULL),
@@ -81,15 +78,13 @@
const std::string& ice_pwd,
IceMode ice_mode,
ConnectionRole role,
- const rtc::SSLFingerprint* identity_fingerprint,
- const Candidates& candidates)
+ const rtc::SSLFingerprint* identity_fingerprint)
: transport_options(transport_options),
ice_ufrag(ice_ufrag),
ice_pwd(ice_pwd),
ice_mode(ice_mode),
connection_role(role),
- identity_fingerprint(CopyFingerprint(identity_fingerprint)),
- candidates(candidates) {}
+ identity_fingerprint(CopyFingerprint(identity_fingerprint)) {}
TransportDescription(const std::string& ice_ufrag,
const std::string& ice_pwd)
: ice_ufrag(ice_ufrag),
@@ -102,8 +97,8 @@
ice_pwd(from.ice_pwd),
ice_mode(from.ice_mode),
connection_role(from.connection_role),
- identity_fingerprint(CopyFingerprint(from.identity_fingerprint.get())),
- candidates(from.candidates) {}
+ identity_fingerprint(CopyFingerprint(from.identity_fingerprint.get())) {
+ }
TransportDescription& operator=(const TransportDescription& from) {
// Self-assignment
@@ -118,7 +113,6 @@
identity_fingerprint.reset(CopyFingerprint(
from.identity_fingerprint.get()));
- candidates = from.candidates;
return *this;
}
@@ -146,7 +140,6 @@
ConnectionRole connection_role;
rtc::scoped_ptr<rtc::SSLFingerprint> identity_fingerprint;
- Candidates candidates;
};
} // namespace cricket