Chromium Code Reviews| Index: webrtc/p2p/client/basicportallocator.cc |
| diff --git a/webrtc/p2p/client/basicportallocator.cc b/webrtc/p2p/client/basicportallocator.cc |
| index 5e4930c1cb39a29ec4ff15b9dfae84d10e3ccb3a..719e5fc7b7a0227c812bcfeb0eee0194c2353dde 100644 |
| --- a/webrtc/p2p/client/basicportallocator.cc |
| +++ b/webrtc/p2p/client/basicportallocator.cc |
| @@ -745,7 +745,6 @@ Port* BasicPortAllocatorSession::GetBestTurnPortForNetwork( |
| } |
| bool BasicPortAllocatorSession::PruneTurnPorts(Port* newly_pairable_turn_port) { |
| - bool pruned_port = false; |
| // Note: We determine the same network based only on their network names. So |
| // if an IPv4 address and an IPv6 address have the same network name, they |
| // are considered the same network here. |
| @@ -754,6 +753,8 @@ bool BasicPortAllocatorSession::PruneTurnPorts(Port* newly_pairable_turn_port) { |
| // |port| is already in the list of ports, so the best port cannot be nullptr. |
| RTC_CHECK(best_turn_port != nullptr); |
| + bool pruned_port = false; |
| + std::vector<PortInterface*> ports_pruned; |
|
pthatcher1
2016/07/27 18:38:12
I'd rename these to:
pruned_port => ports_pruned
honghaiz3
2016/07/27 21:31:26
They appears confusing. Change pruned_port to prun
|
| for (PortData& data : ports_) { |
| if (data.port()->Network()->name() == network_name && |
| data.port()->Type() == RELAY_PORT_TYPE && !data.pruned() && |
| @@ -761,10 +762,14 @@ bool BasicPortAllocatorSession::PruneTurnPorts(Port* newly_pairable_turn_port) { |
| data.set_pruned(); |
| pruned_port = true; |
| if (data.port() != newly_pairable_turn_port) { |
| - SignalPortPruned(this, data.port()); |
| + ports_pruned.push_back(data.port()); |
| } |
| } |
| } |
| + if (!ports_pruned.empty()) { |
| + LOG(LS_INFO) << "Pruned " << ports_pruned.size() << " ports"; |
| + SignalPortsRemoved(this, ports_pruned); |
| + } |
| return pruned_port; |
| } |
| @@ -946,6 +951,7 @@ void BasicPortAllocatorSession::RemovePortsAndCandidates( |
| } |
| } |
| if (!ports_to_remove.empty()) { |
| + LOG(LS_INFO) << "Removed " << ports_to_remove.size() << " ports"; |
| SignalPortsRemoved(this, ports_to_remove); |
| } |
| if (!candidates_to_remove.empty()) { |