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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 PortInterface* origin_port); | 269 PortInterface* origin_port); |
| 270 bool IsPingable(const Connection* conn, int64_t now) const; | 270 bool IsPingable(const Connection* conn, int64_t now) const; |
| 271 bool IsSelectedConnectionPingable(int64_t now); | 271 bool IsSelectedConnectionPingable(int64_t now); |
| 272 int CalculateActiveWritablePingInterval(const Connection* conn, | 272 int CalculateActiveWritablePingInterval(const Connection* conn, |
| 273 int64_t now) const; | 273 int64_t now) const; |
| 274 void PingConnection(Connection* conn); | 274 void PingConnection(Connection* conn); |
| 275 void AddAllocatorSession(std::unique_ptr<PortAllocatorSession> session); | 275 void AddAllocatorSession(std::unique_ptr<PortAllocatorSession> session); |
| 276 void AddConnection(Connection* connection); | 276 void AddConnection(Connection* connection); |
| 277 | 277 |
| 278 void OnPortReady(PortAllocatorSession *session, PortInterface* port); | 278 void OnPortReady(PortAllocatorSession *session, PortInterface* port); |
| 279 // TODO(honghaiz): Merge the two methods OnPortsRemoved and OnPortPruned but | |
| 280 // still log the reason of removing. | |
| 281 void OnPortsRemoved(PortAllocatorSession* session, | 279 void OnPortsRemoved(PortAllocatorSession* session, |
| 282 const std::vector<PortInterface*>& ports); | 280 const std::vector<PortInterface*>& ports); |
|
pthatcher1
2016/07/27 18:38:11
I like the merging. Can we call it OnPortsPruned?
honghaiz3
2016/07/27 21:31:26
Done.
| |
| 283 void OnPortPruned(PortAllocatorSession* session, PortInterface* port); | |
| 284 void OnCandidatesReady(PortAllocatorSession *session, | 281 void OnCandidatesReady(PortAllocatorSession *session, |
| 285 const std::vector<Candidate>& candidates); | 282 const std::vector<Candidate>& candidates); |
| 286 void OnCandidatesRemoved(PortAllocatorSession* session, | 283 void OnCandidatesRemoved(PortAllocatorSession* session, |
| 287 const std::vector<Candidate>& candidates); | 284 const std::vector<Candidate>& candidates); |
| 288 void OnCandidatesAllocationDone(PortAllocatorSession* session); | 285 void OnCandidatesAllocationDone(PortAllocatorSession* session); |
| 289 void OnUnknownAddress(PortInterface* port, | 286 void OnUnknownAddress(PortInterface* port, |
| 290 const rtc::SocketAddress& addr, | 287 const rtc::SocketAddress& addr, |
| 291 ProtocolType proto, | 288 ProtocolType proto, |
| 292 IceMessage* stun_msg, | 289 IceMessage* stun_msg, |
| 293 const std::string& remote_username, | 290 const std::string& remote_username, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 363 bool incoming_only_; | 360 bool incoming_only_; |
| 364 int error_; | 361 int error_; |
| 365 std::vector<std::unique_ptr<PortAllocatorSession>> allocator_sessions_; | 362 std::vector<std::unique_ptr<PortAllocatorSession>> allocator_sessions_; |
| 366 // |ports_| contains ports that are used to form new connections when | 363 // |ports_| contains ports that are used to form new connections when |
| 367 // new remote candidates are added. | 364 // new remote candidates are added. |
| 368 std::vector<PortInterface*> ports_; | 365 std::vector<PortInterface*> ports_; |
| 369 // |removed_ports_| contains ports that have been removed from |ports_| and | 366 // |removed_ports_| contains ports that have been removed from |ports_| and |
| 370 // are not being used to form new connections, but that aren't yet destroyed. | 367 // are not being used to form new connections, but that aren't yet destroyed. |
| 371 // They may have existing connections, and they still fire signals such as | 368 // They may have existing connections, and they still fire signals such as |
| 372 // SignalUnknownAddress. | 369 // SignalUnknownAddress. |
| 373 std::vector<PortInterface*> removed_ports_; | 370 std::vector<PortInterface*> removed_ports_; |
|
pthatcher1
2016/07/27 18:38:11
Can we rename removed_ports_ to pruned_ports_?
honghaiz3
2016/07/27 21:31:26
Done.
| |
| 374 | 371 |
| 375 // |connections_| is a sorted list with the first one always be the | 372 // |connections_| is a sorted list with the first one always be the |
| 376 // |selected_connection_| when it's not nullptr. The combination of | 373 // |selected_connection_| when it's not nullptr. The combination of |
| 377 // |pinged_connections_| and |unpinged_connections_| has the same | 374 // |pinged_connections_| and |unpinged_connections_| has the same |
| 378 // connections as |connections_|. These 2 sets maintain whether a | 375 // connections as |connections_|. These 2 sets maintain whether a |
| 379 // connection should be pinged next or not. | 376 // connection should be pinged next or not. |
| 380 std::vector<Connection *> connections_; | 377 std::vector<Connection *> connections_; |
| 381 std::set<Connection*> pinged_connections_; | 378 std::set<Connection*> pinged_connections_; |
| 382 std::set<Connection*> unpinged_connections_; | 379 std::set<Connection*> unpinged_connections_; |
| 383 | 380 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 403 IceConfig config_; | 400 IceConfig config_; |
| 404 int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before. | 401 int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before. |
| 405 bool started_pinging_ = false; | 402 bool started_pinging_ = false; |
| 406 | 403 |
| 407 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); | 404 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); |
| 408 }; | 405 }; |
| 409 | 406 |
| 410 } // namespace cricket | 407 } // namespace cricket |
| 411 | 408 |
| 412 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ | 409 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ |
| OLD | NEW |