Chromium Code Reviews| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 int flags) override; | 112 int flags) override; |
| 113 int SetOption(rtc::Socket::Option opt, int value) override; | 113 int SetOption(rtc::Socket::Option opt, int value) override; |
| 114 bool GetOption(rtc::Socket::Option opt, int* value) override; | 114 bool GetOption(rtc::Socket::Option opt, int* value) override; |
| 115 int GetError() override { return error_; } | 115 int GetError() override { return error_; } |
| 116 bool GetStats(std::vector<ConnectionInfo>* stats) override; | 116 bool GetStats(std::vector<ConnectionInfo>* stats) override; |
| 117 | 117 |
| 118 const Connection* best_connection() const { return best_connection_; } | 118 const Connection* best_connection() const { return best_connection_; } |
| 119 void set_incoming_only(bool value) { incoming_only_ = value; } | 119 void set_incoming_only(bool value) { incoming_only_ = value; } |
| 120 | 120 |
| 121 // Note: This is only for testing purpose. | 121 // Note: This is only for testing purpose. |
| 122 // |ports_| should not be changed from outside. | 122 // |active_ports_| should not be changed from outside. |
| 123 const std::vector<PortInterface*>& ports() { return ports_; } | 123 const std::vector<PortInterface*>& ports() { return active_ports_; } |
| 124 | 124 |
| 125 IceMode remote_ice_mode() const { return remote_ice_mode_; } | 125 IceMode remote_ice_mode() const { return remote_ice_mode_; } |
| 126 | 126 |
| 127 // DTLS methods. | 127 // DTLS methods. |
| 128 bool IsDtlsActive() const override { return false; } | 128 bool IsDtlsActive() const override { return false; } |
| 129 | 129 |
| 130 // Default implementation. | 130 // Default implementation. |
| 131 bool GetSslRole(rtc::SSLRole* role) const override { return false; } | 131 bool GetSslRole(rtc::SSLRole* role) const override { return false; } |
| 132 | 132 |
| 133 bool SetSslRole(rtc::SSLRole role) override { return false; } | 133 bool SetSslRole(rtc::SSLRole role) override { return false; } |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 290 return remote_ice_parameters_.empty() | 290 return remote_ice_parameters_.empty() |
| 291 ? 0 | 291 ? 0 |
| 292 : static_cast<uint32_t>(remote_ice_parameters_.size() - 1); | 292 : static_cast<uint32_t>(remote_ice_parameters_.size() - 1); |
| 293 } | 293 } |
| 294 | 294 |
| 295 PortAllocator* allocator_; | 295 PortAllocator* allocator_; |
| 296 rtc::Thread* worker_thread_; | 296 rtc::Thread* worker_thread_; |
| 297 bool incoming_only_; | 297 bool incoming_only_; |
| 298 int error_; | 298 int error_; |
| 299 std::vector<std::unique_ptr<PortAllocatorSession>> allocator_sessions_; | 299 std::vector<std::unique_ptr<PortAllocatorSession>> allocator_sessions_; |
| 300 std::vector<PortInterface *> ports_; | 300 // |active_ports_| contains ports that are used to form new connections when |
| 301 // new remote candidates are added. | |
| 302 std::vector<PortInterface*> active_ports_; | |
| 303 // |inactive_ports_| contains ports that aren't being used to form new | |
| 304 // connections, but that aren't yet destroyed. They may have existing | |
| 305 // connections, and they still fire signals such as SignalUnknownAddress. | |
| 306 std::vector<PortInterface*> inactive_ports_; | |
|
pthatcher1
2016/06/15 22:13:20
For names, how about ports_ and removed_ports_wait
Taylor Brandstetter
2016/06/16 00:53:33
I think removed_ports_ is sufficiently unambiguous
| |
| 301 | 307 |
| 302 // |connections_| is a sorted list with the first one always be the | 308 // |connections_| is a sorted list with the first one always be the |
| 303 // |best_connection_| when it's not nullptr. The combination of | 309 // |best_connection_| when it's not nullptr. The combination of |
| 304 // |pinged_connections_| and |unpinged_connections_| has the same | 310 // |pinged_connections_| and |unpinged_connections_| has the same |
| 305 // connections as |connections_|. These 2 sets maintain whether a | 311 // connections as |connections_|. These 2 sets maintain whether a |
| 306 // connection should be pinged next or not. | 312 // connection should be pinged next or not. |
| 307 std::vector<Connection *> connections_; | 313 std::vector<Connection *> connections_; |
| 308 std::set<Connection*> pinged_connections_; | 314 std::set<Connection*> pinged_connections_; |
| 309 std::set<Connection*> unpinged_connections_; | 315 std::set<Connection*> unpinged_connections_; |
| 310 | 316 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 332 TransportChannelState state_ = TransportChannelState::STATE_INIT; | 338 TransportChannelState state_ = TransportChannelState::STATE_INIT; |
| 333 IceConfig config_; | 339 IceConfig config_; |
| 334 int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before. | 340 int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before. |
| 335 | 341 |
| 336 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); | 342 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); |
| 337 }; | 343 }; |
| 338 | 344 |
| 339 } // namespace cricket | 345 } // namespace cricket |
| 340 | 346 |
| 341 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ | 347 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ |
| OLD | NEW |