| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 PortAllocatorSession* allocator_session() { | 189 PortAllocatorSession* allocator_session() { |
| 190 return allocator_sessions_.back().get(); | 190 return allocator_sessions_.back().get(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 // Public for unit tests. | 193 // Public for unit tests. |
| 194 const std::vector<RemoteCandidate>& remote_candidates() const { | 194 const std::vector<RemoteCandidate>& remote_candidates() const { |
| 195 return remote_candidates_; | 195 return remote_candidates_; |
| 196 } | 196 } |
| 197 | 197 |
| 198 private: | 198 private: |
| 199 rtc::Thread* thread() const { return worker_thread_; } | 199 rtc::Thread* thread() const { return network_thread_; } |
| 200 bool IsGettingPorts() { return allocator_session()->IsGettingPorts(); } | 200 bool IsGettingPorts() { return allocator_session()->IsGettingPorts(); } |
| 201 | 201 |
| 202 // A transport channel is weak if the current best connection is either | 202 // A transport channel is weak if the current best connection is either |
| 203 // not receiving or not writable, or if there is no best connection at all. | 203 // not receiving or not writable, or if there is no best connection at all. |
| 204 bool weak() const; | 204 bool weak() const; |
| 205 // Returns true if it's possible to send packets on |connection|. | 205 // Returns true if it's possible to send packets on |connection|. |
| 206 bool ReadyToSend(Connection* connection) const; | 206 bool ReadyToSend(Connection* connection) const; |
| 207 void UpdateConnectionStates(); | 207 void UpdateConnectionStates(); |
| 208 void RequestSortAndStateUpdate(); | 208 void RequestSortAndStateUpdate(); |
| 209 // Start pinging if we haven't already started, and we now have a connection | 209 // Start pinging if we haven't already started, and we now have a connection |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 uint32_t* generation); | 340 uint32_t* generation); |
| 341 // Returns the index of the latest remote ICE parameters, or 0 if no remote | 341 // Returns the index of the latest remote ICE parameters, or 0 if no remote |
| 342 // ICE parameters have been received. | 342 // ICE parameters have been received. |
| 343 uint32_t remote_ice_generation() { | 343 uint32_t remote_ice_generation() { |
| 344 return remote_ice_parameters_.empty() | 344 return remote_ice_parameters_.empty() |
| 345 ? 0 | 345 ? 0 |
| 346 : static_cast<uint32_t>(remote_ice_parameters_.size() - 1); | 346 : static_cast<uint32_t>(remote_ice_parameters_.size() - 1); |
| 347 } | 347 } |
| 348 | 348 |
| 349 PortAllocator* allocator_; | 349 PortAllocator* allocator_; |
| 350 rtc::Thread* worker_thread_; | 350 rtc::Thread* network_thread_; |
| 351 bool incoming_only_; | 351 bool incoming_only_; |
| 352 int error_; | 352 int error_; |
| 353 std::vector<std::unique_ptr<PortAllocatorSession>> allocator_sessions_; | 353 std::vector<std::unique_ptr<PortAllocatorSession>> allocator_sessions_; |
| 354 // |ports_| contains ports that are used to form new connections when | 354 // |ports_| contains ports that are used to form new connections when |
| 355 // new remote candidates are added. | 355 // new remote candidates are added. |
| 356 std::vector<PortInterface*> ports_; | 356 std::vector<PortInterface*> ports_; |
| 357 // |pruned_ports_| contains ports that have been removed from |ports_| and | 357 // |pruned_ports_| contains ports that have been removed from |ports_| and |
| 358 // are not being used to form new connections, but that aren't yet destroyed. | 358 // are not being used to form new connections, but that aren't yet destroyed. |
| 359 // They may have existing connections, and they still fire signals such as | 359 // They may have existing connections, and they still fire signals such as |
| 360 // SignalUnknownAddress. | 360 // SignalUnknownAddress. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 // The value put in the "nomination" attribute for the next nominated | 393 // The value put in the "nomination" attribute for the next nominated |
| 394 // connection. A zero-value indicates the connection will not be nominated. | 394 // connection. A zero-value indicates the connection will not be nominated. |
| 395 uint32_t nomination_ = 0; | 395 uint32_t nomination_ = 0; |
| 396 | 396 |
| 397 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); | 397 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); |
| 398 }; | 398 }; |
| 399 | 399 |
| 400 } // namespace cricket | 400 } // namespace cricket |
| 401 | 401 |
| 402 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ | 402 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ |
| OLD | NEW |