| 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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 connections_.find(conn->remote_candidate().address()); | 701 connections_.find(conn->remote_candidate().address()); |
| 702 ASSERT(iter != connections_.end()); | 702 ASSERT(iter != connections_.end()); |
| 703 connections_.erase(iter); | 703 connections_.erase(iter); |
| 704 HandleConnectionDestroyed(conn); | 704 HandleConnectionDestroyed(conn); |
| 705 | 705 |
| 706 // On the controlled side, ports time out after all connections fail. | 706 // On the controlled side, ports time out after all connections fail. |
| 707 // Note: If a new connection is added after this message is posted, but it | 707 // Note: If a new connection is added after this message is posted, but it |
| 708 // fails and is removed before kPortTimeoutDelay, then this message will | 708 // fails and is removed before kPortTimeoutDelay, then this message will |
| 709 // still cause the Port to be destroyed. | 709 // still cause the Port to be destroyed. |
| 710 if (dead()) { | 710 if (dead()) { |
| 711 thread_->PostDelayed(timeout_delay_, this, MSG_DEAD); | 711 thread_->PostDelayed(RTC_FROM_HERE, timeout_delay_, this, MSG_DEAD); |
| 712 } | 712 } |
| 713 } | 713 } |
| 714 | 714 |
| 715 void Port::Destroy() { | 715 void Port::Destroy() { |
| 716 ASSERT(connections_.empty()); | 716 ASSERT(connections_.empty()); |
| 717 LOG_J(LS_INFO, this) << "Port deleted"; | 717 LOG_J(LS_INFO, this) << "Port deleted"; |
| 718 SignalDestroyed(this); | 718 SignalDestroyed(this); |
| 719 delete this; | 719 delete this; |
| 720 } | 720 } |
| 721 | 721 |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1075 if (!pruned_ || active()) { | 1075 if (!pruned_ || active()) { |
| 1076 LOG_J(LS_INFO, this) << "Connection pruned"; | 1076 LOG_J(LS_INFO, this) << "Connection pruned"; |
| 1077 pruned_ = true; | 1077 pruned_ = true; |
| 1078 requests_.Clear(); | 1078 requests_.Clear(); |
| 1079 set_write_state(STATE_WRITE_TIMEOUT); | 1079 set_write_state(STATE_WRITE_TIMEOUT); |
| 1080 } | 1080 } |
| 1081 } | 1081 } |
| 1082 | 1082 |
| 1083 void Connection::Destroy() { | 1083 void Connection::Destroy() { |
| 1084 LOG_J(LS_VERBOSE, this) << "Connection destroyed"; | 1084 LOG_J(LS_VERBOSE, this) << "Connection destroyed"; |
| 1085 port_->thread()->Post(this, MSG_DELETE); | 1085 port_->thread()->Post(RTC_FROM_HERE, this, MSG_DELETE); |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 void Connection::FailAndDestroy() { | 1088 void Connection::FailAndDestroy() { |
| 1089 set_state(Connection::STATE_FAILED); | 1089 set_state(Connection::STATE_FAILED); |
| 1090 Destroy(); | 1090 Destroy(); |
| 1091 } | 1091 } |
| 1092 | 1092 |
| 1093 void Connection::PrintPingsSinceLastResponse(std::string* s, size_t max) { | 1093 void Connection::PrintPingsSinceLastResponse(std::string* s, size_t max) { |
| 1094 std::ostringstream oss; | 1094 std::ostringstream oss; |
| 1095 oss << std::boolalpha; | 1095 oss << std::boolalpha; |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1508 ASSERT(sent < 0); | 1508 ASSERT(sent < 0); |
| 1509 error_ = port_->GetError(); | 1509 error_ = port_->GetError(); |
| 1510 stats_.sent_discarded_packets++; | 1510 stats_.sent_discarded_packets++; |
| 1511 } else { | 1511 } else { |
| 1512 send_rate_tracker_.AddSamples(sent); | 1512 send_rate_tracker_.AddSamples(sent); |
| 1513 } | 1513 } |
| 1514 return sent; | 1514 return sent; |
| 1515 } | 1515 } |
| 1516 | 1516 |
| 1517 } // namespace cricket | 1517 } // namespace cricket |
| OLD | NEW |