| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 // TODO(honghaiz): Implement this in BasicPortAllocator. | 182 // TODO(honghaiz): Implement this in BasicPortAllocator. |
| 183 virtual void RegatherOnAllNetworks() {} | 183 virtual void RegatherOnAllNetworks() {} |
| 184 | 184 |
| 185 // Another way of getting the information provided by the signals below. | 185 // Another way of getting the information provided by the signals below. |
| 186 // | 186 // |
| 187 // Ports and candidates are not guaranteed to be in the same order as the | 187 // Ports and candidates are not guaranteed to be in the same order as the |
| 188 // signals were emitted in. | 188 // signals were emitted in. |
| 189 virtual std::vector<PortInterface*> ReadyPorts() const = 0; | 189 virtual std::vector<PortInterface*> ReadyPorts() const = 0; |
| 190 virtual std::vector<Candidate> ReadyCandidates() const = 0; | 190 virtual std::vector<Candidate> ReadyCandidates() const = 0; |
| 191 virtual bool CandidatesAllocationDone() const = 0; | 191 virtual bool CandidatesAllocationDone() const = 0; |
| 192 // Marks all ports in the current session as "pruned" so that they may be |
| 193 // destroyed if no connection is using them. |
| 194 virtual void PruneAllPorts() {} |
| 192 | 195 |
| 193 sigslot::signal2<PortAllocatorSession*, PortInterface*> SignalPortReady; | 196 sigslot::signal2<PortAllocatorSession*, PortInterface*> SignalPortReady; |
| 194 // Fires this signal when the network of the ports failed (either because the | 197 // Fires this signal when the network of the ports failed (either because the |
| 195 // interface is down, or because there is no connection on the interface), | 198 // interface is down, or because there is no connection on the interface), |
| 196 // or when TURN ports are pruned because a higher-priority TURN port becomes | 199 // or when TURN ports are pruned because a higher-priority TURN port becomes |
| 197 // ready(pairable). | 200 // ready(pairable). |
| 198 sigslot::signal2<PortAllocatorSession*, const std::vector<PortInterface*>&> | 201 sigslot::signal2<PortAllocatorSession*, const std::vector<PortInterface*>&> |
| 199 SignalPortsPruned; | 202 SignalPortsPruned; |
| 200 sigslot::signal2<PortAllocatorSession*, | 203 sigslot::signal2<PortAllocatorSession*, |
| 201 const std::vector<Candidate>&> SignalCandidatesReady; | 204 const std::vector<Candidate>&> SignalCandidatesReady; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 // This variable represents the total number of pooled sessions | 388 // This variable represents the total number of pooled sessions |
| 386 // both owned by this class and taken by TakePooledSession. | 389 // both owned by this class and taken by TakePooledSession. |
| 387 int allocated_pooled_session_count_ = 0; | 390 int allocated_pooled_session_count_ = 0; |
| 388 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; | 391 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; |
| 389 bool prune_turn_ports_ = false; | 392 bool prune_turn_ports_ = false; |
| 390 }; | 393 }; |
| 391 | 394 |
| 392 } // namespace cricket | 395 } // namespace cricket |
| 393 | 396 |
| 394 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ | 397 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ |
| OLD | NEW |