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

Unified Diff: webrtc/p2p/base/p2ptransportchannel.cc

Issue 2111663003: Revert of Add config to prune TURN ports (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel.h ('k') | webrtc/p2p/base/p2ptransportchannel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/p2ptransportchannel.cc
diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc
index be4bfcc928c59134e3f93e01150eab48d181860f..a4bde05d80cb9cac890e8aeaf81f76e3bd31611f 100644
--- a/webrtc/p2p/base/p2ptransportchannel.cc
+++ b/webrtc/p2p/base/p2ptransportchannel.cc
@@ -125,7 +125,6 @@
session->set_generation(static_cast<uint32_t>(allocator_sessions_.size()));
session->SignalPortReady.connect(this, &P2PTransportChannel::OnPortReady);
- session->SignalPortPruned.connect(this, &P2PTransportChannel::OnPortPruned);
session->SignalCandidatesReady.connect(
this, &P2PTransportChannel::OnCandidatesReady);
session->SignalCandidatesAllocationDone.connect(
@@ -1606,7 +1605,7 @@
std::remove(removed_ports_.begin(), removed_ports_.end(), port),
removed_ports_.end());
- LOG(INFO) << "Removed port because it is destroyed: "
+ LOG(INFO) << "Removed port from p2p socket: "
<< static_cast<int>(ports_.size()) << " remaining";
}
@@ -1616,35 +1615,20 @@
if (!config_.gather_continually) {
return;
}
- if (!RemovePort(port)) {
+ auto it = std::find(ports_.begin(), ports_.end(), port);
+ // Don't need to do anything if the port has been deleted from the port list.
+ if (it == ports_.end()) {
return;
}
- LOG(INFO) << "Removed port because its network is inactive : "
- << port->ToString() << " " << ports_.size() << " remaining";
+ removed_ports_.push_back(*it);
+ ports_.erase(it);
+ LOG(INFO) << "Removed port due to inactive networks: " << ports_.size()
+ << " remaining";
std::vector<Candidate> candidates = port->Candidates();
for (Candidate& candidate : candidates) {
candidate.set_transport_name(transport_name());
}
SignalCandidatesRemoved(this, candidates);
-}
-
-void P2PTransportChannel::OnPortPruned(PortAllocatorSession* session,
- PortInterface* port) {
- if (RemovePort(port)) {
- LOG(INFO) << "Removed port because it is pruned: " << port->ToString()
- << " " << ports_.size() << " remaining";
- }
-}
-
-bool P2PTransportChannel::RemovePort(PortInterface* port) {
- auto it = std::find(ports_.begin(), ports_.end(), port);
- // Don't need to do anything if the port has been deleted from the port list.
- if (it == ports_.end()) {
- return false;
- }
- ports_.erase(it);
- removed_ports_.push_back(port);
- return true;
}
// We data is available, let listeners know
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel.h ('k') | webrtc/p2p/base/p2ptransportchannel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698