| Index: webrtc/p2p/base/transport.cc
|
| diff --git a/webrtc/p2p/base/transport.cc b/webrtc/p2p/base/transport.cc
|
| index b8d98100cf3af1f8b93b98e0362c15132ece9cd2..17d05adc23216ecf5b5644a55da2dfa346c414e2 100644
|
| --- a/webrtc/p2p/base/transport.cc
|
| +++ b/webrtc/p2p/base/transport.cc
|
| @@ -294,22 +294,6 @@
|
| }
|
| }
|
|
|
| - if (!HasChannel(cand.component())) {
|
| - *error = "Candidate has an unknown component: " + cand.ToString() +
|
| - " for content: " + name();
|
| - return false;
|
| - }
|
| -
|
| - return true;
|
| -}
|
| -
|
| -bool Transport::VerifyCandidates(const Candidates& candidates,
|
| - std::string* error) {
|
| - for (const Candidate& candidate : candidates) {
|
| - if (!VerifyCandidate(candidate, error)) {
|
| - return false;
|
| - }
|
| - }
|
| return true;
|
| }
|
|
|
| @@ -334,32 +318,22 @@
|
| bool Transport::AddRemoteCandidates(const std::vector<Candidate>& candidates,
|
| std::string* error) {
|
| ASSERT(!channels_destroyed_);
|
| - // Verify each candidate before passing down to the transport layer.
|
| - if (!VerifyCandidates(candidates, error)) {
|
| - return false;
|
| + // Verify each candidate before passing down to transport layer.
|
| + for (const Candidate& cand : candidates) {
|
| + if (!VerifyCandidate(cand, error)) {
|
| + return false;
|
| + }
|
| + if (!HasChannel(cand.component())) {
|
| + *error = "Candidate has unknown component: " + cand.ToString() +
|
| + " for content: " + name();
|
| + return false;
|
| + }
|
| }
|
|
|
| for (const Candidate& candidate : candidates) {
|
| TransportChannelImpl* channel = GetChannel(candidate.component());
|
| if (channel != nullptr) {
|
| channel->AddRemoteCandidate(candidate);
|
| - }
|
| - }
|
| - return true;
|
| -}
|
| -
|
| -bool Transport::RemoveRemoteCandidates(const std::vector<Candidate>& candidates,
|
| - std::string* error) {
|
| - ASSERT(!channels_destroyed_);
|
| - // Verify each candidate before passing down to the transport layer.
|
| - if (!VerifyCandidates(candidates, error)) {
|
| - return false;
|
| - }
|
| -
|
| - for (const Candidate& candidate : candidates) {
|
| - TransportChannelImpl* channel = GetChannel(candidate.component());
|
| - if (channel != nullptr) {
|
| - channel->RemoveRemoteCandidate(candidate);
|
| }
|
| }
|
| return true;
|
|
|