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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 virtual ~PortAllocatorSession() {} | 135 virtual ~PortAllocatorSession() {} |
136 | 136 |
137 uint32_t flags() const { return flags_; } | 137 uint32_t flags() const { return flags_; } |
138 void set_flags(uint32_t flags) { flags_ = flags; } | 138 void set_flags(uint32_t flags) { flags_ = flags; } |
139 std::string content_name() const { return content_name_; } | 139 std::string content_name() const { return content_name_; } |
140 int component() const { return component_; } | 140 int component() const { return component_; } |
141 const std::string& ice_ufrag() const { return ice_ufrag_; } | 141 const std::string& ice_ufrag() const { return ice_ufrag_; } |
142 const std::string& ice_pwd() const { return ice_pwd_; } | 142 const std::string& ice_pwd() const { return ice_pwd_; } |
143 bool pooled() const { return ice_ufrag_.empty(); } | 143 bool pooled() const { return ice_ufrag_.empty(); } |
144 | 144 |
145 // Setting this filter should affect not only candidates gathered in the | |
146 // future, but candidates returned by ReadyCandidates() and ports returned | |
147 // by ReadyPorts(). | |
148 // | |
149 // Default filter should be CF_ALL. | |
150 virtual void SetCandidateFilter(uint32_t filter) = 0; | |
151 | |
145 // Starts gathering STUN and Relay configurations. | 152 // Starts gathering STUN and Relay configurations. |
146 virtual void StartGettingPorts() = 0; | 153 virtual void StartGettingPorts() = 0; |
147 virtual void StopGettingPorts() = 0; | 154 virtual void StopGettingPorts() = 0; |
148 // Only stop the existing gathering process but may start new ones if needed. | 155 // Only stop the existing gathering process but may start new ones if needed. |
149 virtual void ClearGettingPorts() = 0; | 156 virtual void ClearGettingPorts() = 0; |
150 // Whether the process of getting ports has been stopped. | 157 // Whether the process of getting ports has been stopped. |
151 virtual bool IsGettingPorts() = 0; | 158 virtual bool IsGettingPorts() = 0; |
152 | 159 |
153 // Another way of getting the information provided by the signals below. | 160 // Another way of getting the information provided by the signals below. |
154 // | 161 // |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 uint32_t step_delay() const { return step_delay_; } | 301 uint32_t step_delay() const { return step_delay_; } |
295 void set_step_delay(uint32_t delay) { step_delay_ = delay; } | 302 void set_step_delay(uint32_t delay) { step_delay_ = delay; } |
296 | 303 |
297 bool allow_tcp_listen() const { return allow_tcp_listen_; } | 304 bool allow_tcp_listen() const { return allow_tcp_listen_; } |
298 void set_allow_tcp_listen(bool allow_tcp_listen) { | 305 void set_allow_tcp_listen(bool allow_tcp_listen) { |
299 allow_tcp_listen_ = allow_tcp_listen; | 306 allow_tcp_listen_ = allow_tcp_listen; |
300 } | 307 } |
301 | 308 |
302 uint32_t candidate_filter() { return candidate_filter_; } | 309 uint32_t candidate_filter() { return candidate_filter_; } |
303 void set_candidate_filter(uint32_t filter) { | 310 void set_candidate_filter(uint32_t filter) { |
304 // TODO(mallinath) - Do transition check? | |
Taylor Brandstetter
2016/05/19 22:11:45
Transition check now done (in BasicPortAllocatorSe
| |
305 candidate_filter_ = filter; | 311 candidate_filter_ = filter; |
306 } | 312 } |
307 | 313 |
308 // Gets/Sets the Origin value used for WebRTC STUN requests. | 314 // Gets/Sets the Origin value used for WebRTC STUN requests. |
309 const std::string& origin() const { return origin_; } | 315 const std::string& origin() const { return origin_; } |
310 void set_origin(const std::string& origin) { origin_ = origin; } | 316 void set_origin(const std::string& origin) { origin_ = origin; } |
311 | 317 |
312 protected: | 318 protected: |
313 virtual PortAllocatorSession* CreateSessionInternal( | 319 virtual PortAllocatorSession* CreateSessionInternal( |
314 const std::string& content_name, | 320 const std::string& content_name, |
(...skipping 18 matching lines...) Expand all Loading... | |
333 int target_pooled_session_count_ = 0; | 339 int target_pooled_session_count_ = 0; |
334 // This variable represents the total number of pooled sessions | 340 // This variable represents the total number of pooled sessions |
335 // both owned by this class and taken by TakePooledSession. | 341 // both owned by this class and taken by TakePooledSession. |
336 int allocated_pooled_session_count_ = 0; | 342 int allocated_pooled_session_count_ = 0; |
337 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; | 343 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; |
338 }; | 344 }; |
339 | 345 |
340 } // namespace cricket | 346 } // namespace cricket |
341 | 347 |
342 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ | 348 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ |
OLD | NEW |