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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 498 // Called when a connection is determined to be no longer useful to us. We | 498 // Called when a connection is determined to be no longer useful to us. We |
| 499 // still keep it around in case the other side wants to use it. But we can | 499 // still keep it around in case the other side wants to use it. But we can |
| 500 // safely stop pinging on it and we can allow it to time out if the other | 500 // safely stop pinging on it and we can allow it to time out if the other |
| 501 // side stops using it as well. | 501 // side stops using it as well. |
| 502 bool pruned() const { return pruned_; } | 502 bool pruned() const { return pruned_; } |
| 503 void Prune(); | 503 void Prune(); |
| 504 | 504 |
| 505 bool use_candidate_attr() const { return use_candidate_attr_; } | 505 bool use_candidate_attr() const { return use_candidate_attr_; } |
| 506 void set_use_candidate_attr(bool enable); | 506 void set_use_candidate_attr(bool enable); |
| 507 | 507 |
| 508 bool received_use_candidate() const { return received_use_candidate_; } | |
| 509 void set_received_use_candidate(bool received) { | |
| 510 received_use_candidate_ = received; | |
|
pthatcher1
2015/08/06 01:41:42
I think nominated_ would be better.
honghaiz3
2015/08/06 18:22:57
Done.
| |
| 511 } | |
| 512 | |
| 508 void set_remote_ice_mode(IceMode mode) { | 513 void set_remote_ice_mode(IceMode mode) { |
| 509 remote_ice_mode_ = mode; | 514 remote_ice_mode_ = mode; |
| 510 } | 515 } |
| 511 | 516 |
| 512 // Makes the connection go away. | 517 // Makes the connection go away. |
| 513 void Destroy(); | 518 void Destroy(); |
| 514 | 519 |
| 515 // Checks that the state of this connection is up-to-date. The argument is | 520 // Checks that the state of this connection is up-to-date. The argument is |
| 516 // the current time, which is compared against various timeouts. | 521 // the current time, which is compared against various timeouts. |
| 517 void UpdateState(uint32 now); | 522 void UpdateState(uint32 now); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 591 void OnMessage(rtc::Message *pmsg); | 596 void OnMessage(rtc::Message *pmsg); |
| 592 | 597 |
| 593 Port* port_; | 598 Port* port_; |
| 594 size_t local_candidate_index_; | 599 size_t local_candidate_index_; |
| 595 Candidate remote_candidate_; | 600 Candidate remote_candidate_; |
| 596 ReadState read_state_; | 601 ReadState read_state_; |
| 597 WriteState write_state_; | 602 WriteState write_state_; |
| 598 bool connected_; | 603 bool connected_; |
| 599 bool pruned_; | 604 bool pruned_; |
| 600 // By default |use_candidate_attr_| flag will be true, | 605 // By default |use_candidate_attr_| flag will be true, |
| 601 // as we will be using agrressive nomination. | 606 // as we are still using aggressive nomination on the controlling side |
| 607 // although we are moving toward passive-aggressive nomination. | |
|
pthatcher1
2015/08/06 01:41:42
I don't think this comment change is necessary.
honghaiz3
2015/08/06 18:22:57
Done.
| |
| 602 // But when peer is ice-lite, this flag "must" be initialized to false and | 608 // But when peer is ice-lite, this flag "must" be initialized to false and |
| 603 // turn on when connection becomes "best connection". | 609 // turn on when connection becomes "best connection". |
| 604 bool use_candidate_attr_; | 610 bool use_candidate_attr_; |
| 611 // Whether this connection has received a stun request with use_candidate | |
| 612 // attribute. | |
| 613 bool received_use_candidate_; | |
| 605 IceMode remote_ice_mode_; | 614 IceMode remote_ice_mode_; |
| 606 StunRequestManager requests_; | 615 StunRequestManager requests_; |
| 607 uint32 rtt_; | 616 uint32 rtt_; |
| 608 uint32 last_ping_sent_; // last time we sent a ping to the other side | 617 uint32 last_ping_sent_; // last time we sent a ping to the other side |
| 609 uint32 last_ping_received_; // last time we received a ping from the other | 618 uint32 last_ping_received_; // last time we received a ping from the other |
| 610 // side | 619 // side |
| 611 uint32 last_data_received_; | 620 uint32 last_data_received_; |
| 612 uint32 last_ping_response_received_; | 621 uint32 last_ping_response_received_; |
| 613 std::vector<SentPing> pings_since_last_response_; | 622 std::vector<SentPing> pings_since_last_response_; |
| 614 | 623 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 637 const rtc::PacketOptions& options); | 646 const rtc::PacketOptions& options); |
| 638 virtual int GetError() { return error_; } | 647 virtual int GetError() { return error_; } |
| 639 | 648 |
| 640 private: | 649 private: |
| 641 int error_; | 650 int error_; |
| 642 }; | 651 }; |
| 643 | 652 |
| 644 } // namespace cricket | 653 } // namespace cricket |
| 645 | 654 |
| 646 #endif // WEBRTC_P2P_BASE_PORT_H_ | 655 #endif // WEBRTC_P2P_BASE_PORT_H_ |
| OLD | NEW |