| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 158   // Default filter should be CF_ALL. | 158   // Default filter should be CF_ALL. | 
| 159   virtual void SetCandidateFilter(uint32_t filter) = 0; | 159   virtual void SetCandidateFilter(uint32_t filter) = 0; | 
| 160 | 160 | 
| 161   // Starts gathering STUN and Relay configurations. | 161   // Starts gathering STUN and Relay configurations. | 
| 162   virtual void StartGettingPorts() = 0; | 162   virtual void StartGettingPorts() = 0; | 
| 163   virtual void StopGettingPorts() = 0; | 163   virtual void StopGettingPorts() = 0; | 
| 164   // Only stop the existing gathering process but may start new ones if needed. | 164   // Only stop the existing gathering process but may start new ones if needed. | 
| 165   virtual void ClearGettingPorts() = 0; | 165   virtual void ClearGettingPorts() = 0; | 
| 166   // Whether the process of getting ports has been stopped. | 166   // Whether the process of getting ports has been stopped. | 
| 167   virtual bool IsGettingPorts() = 0; | 167   virtual bool IsGettingPorts() = 0; | 
|  | 168   // Re-gathers candidates on networks that do not have any connections. More | 
|  | 169   // precisely, a network interface may have more than one IP addresses (e.g., | 
|  | 170   // IPv4 and IPv6 addresses). Each address subnet will be used to create a | 
|  | 171   // network. Only if all networks of an interface has no connection, | 
|  | 172   // we will start re-gather on all networks of that interface. | 
|  | 173   virtual void RegatherOnFailedNetworks() {} | 
|  | 174   // Re-gathers candidates on all networks. | 
|  | 175   // TODO(honghaiz): Implement this in BasicPortAllocator. | 
|  | 176   virtual void RegatherOnAllNetworks() {} | 
| 168 | 177 | 
| 169   // Another way of getting the information provided by the signals below. | 178   // Another way of getting the information provided by the signals below. | 
| 170   // | 179   // | 
| 171   // Ports and candidates are not guaranteed to be in the same order as the | 180   // Ports and candidates are not guaranteed to be in the same order as the | 
| 172   // signals were emitted in. | 181   // signals were emitted in. | 
| 173   virtual std::vector<PortInterface*> ReadyPorts() const = 0; | 182   virtual std::vector<PortInterface*> ReadyPorts() const = 0; | 
| 174   virtual std::vector<Candidate> ReadyCandidates() const = 0; | 183   virtual std::vector<Candidate> ReadyCandidates() const = 0; | 
| 175   virtual bool CandidatesAllocationDone() const = 0; | 184   virtual bool CandidatesAllocationDone() const = 0; | 
| 176 | 185 | 
| 177   sigslot::signal2<PortAllocatorSession*, PortInterface*> SignalPortReady; | 186   sigslot::signal2<PortAllocatorSession*, PortInterface*> SignalPortReady; | 
|  | 187   sigslot::signal2<PortAllocatorSession*, const std::vector<PortInterface*>&> | 
|  | 188       SignalPortsRemoved; | 
| 178   sigslot::signal2<PortAllocatorSession*, | 189   sigslot::signal2<PortAllocatorSession*, | 
| 179                    const std::vector<Candidate>&> SignalCandidatesReady; | 190                    const std::vector<Candidate>&> SignalCandidatesReady; | 
|  | 191   sigslot::signal2<PortAllocatorSession*, const std::vector<Candidate>&> | 
|  | 192       SignalCandidatesRemoved; | 
| 180   sigslot::signal1<PortAllocatorSession*> SignalCandidatesAllocationDone; | 193   sigslot::signal1<PortAllocatorSession*> SignalCandidatesAllocationDone; | 
| 181 | 194 | 
| 182   virtual uint32_t generation() { return generation_; } | 195   virtual uint32_t generation() { return generation_; } | 
| 183   virtual void set_generation(uint32_t generation) { generation_ = generation; } | 196   virtual void set_generation(uint32_t generation) { generation_ = generation; } | 
| 184   sigslot::signal1<PortAllocatorSession*> SignalDestroyed; | 197   sigslot::signal1<PortAllocatorSession*> SignalDestroyed; | 
| 185 | 198 | 
| 186  protected: | 199  protected: | 
| 187   // This method is called when a pooled session (which doesn't have these | 200   // This method is called when a pooled session (which doesn't have these | 
| 188   // properties initially) is returned by PortAllocator::TakePooledSession, | 201   // properties initially) is returned by PortAllocator::TakePooledSession, | 
| 189   // and the content name, component, and ICE ufrag/pwd are updated. | 202   // and the content name, component, and ICE ufrag/pwd are updated. | 
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 355   int target_pooled_session_count_ = 0; | 368   int target_pooled_session_count_ = 0; | 
| 356   // This variable represents the total number of pooled sessions | 369   // This variable represents the total number of pooled sessions | 
| 357   // both owned by this class and taken by TakePooledSession. | 370   // both owned by this class and taken by TakePooledSession. | 
| 358   int allocated_pooled_session_count_ = 0; | 371   int allocated_pooled_session_count_ = 0; | 
| 359   std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; | 372   std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; | 
| 360 }; | 373 }; | 
| 361 | 374 | 
| 362 }  // namespace cricket | 375 }  // namespace cricket | 
| 363 | 376 | 
| 364 #endif  // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ | 377 #endif  // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ | 
| OLD | NEW | 
|---|