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 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1150 Connection* old_best_connection = best_connection_; | 1150 Connection* old_best_connection = best_connection_; |
| 1151 best_connection_ = conn; | 1151 best_connection_ = conn; |
| 1152 if (best_connection_) { | 1152 if (best_connection_) { |
| 1153 if (old_best_connection) { | 1153 if (old_best_connection) { |
| 1154 LOG_J(LS_INFO, this) << "Previous best connection: " | 1154 LOG_J(LS_INFO, this) << "Previous best connection: " |
| 1155 << old_best_connection->ToString(); | 1155 << old_best_connection->ToString(); |
| 1156 } | 1156 } |
| 1157 LOG_J(LS_INFO, this) << "New best connection: " | 1157 LOG_J(LS_INFO, this) << "New best connection: " |
| 1158 << best_connection_->ToString(); | 1158 << best_connection_->ToString(); |
| 1159 SignalRouteChange(this, best_connection_->remote_candidate()); | 1159 SignalRouteChange(this, best_connection_->remote_candidate()); |
| 1160 | |
|
stefan-webrtc
2016/03/17 12:48:19
Remove empty line
honghaiz3
2016/03/23 19:55:40
Done.
| |
| 1160 } else { | 1161 } else { |
| 1161 LOG_J(LS_INFO, this) << "No best connection"; | 1162 LOG_J(LS_INFO, this) << "No best connection"; |
| 1162 } | 1163 } |
| 1164 SignalBestConnectionChanged(this, best_connection_); | |
| 1163 } | 1165 } |
| 1164 | 1166 |
| 1165 // Warning: UpdateState should eventually be called whenever a connection | 1167 // Warning: UpdateState should eventually be called whenever a connection |
| 1166 // is added, deleted, or the write state of any connection changes so that the | 1168 // is added, deleted, or the write state of any connection changes so that the |
| 1167 // transport controller will get the up-to-date channel state. However it | 1169 // transport controller will get the up-to-date channel state. However it |
| 1168 // should not be called too often; in the case that multiple connection states | 1170 // should not be called too often; in the case that multiple connection states |
| 1169 // change, it should be called after all the connection states have changed. For | 1171 // change, it should be called after all the connection states have changed. For |
| 1170 // example, we call this at the end of SortConnections. | 1172 // example, we call this at the end of SortConnections. |
| 1171 void P2PTransportChannel::UpdateState() { | 1173 void P2PTransportChannel::UpdateState() { |
| 1172 state_ = ComputeState(); | 1174 state_ = ComputeState(); |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1614 | 1616 |
| 1615 // During the initial state when nothing has been pinged yet, return the first | 1617 // During the initial state when nothing has been pinged yet, return the first |
| 1616 // one in the ordered |connections_|. | 1618 // one in the ordered |connections_|. |
| 1617 return *(std::find_if(connections_.begin(), connections_.end(), | 1619 return *(std::find_if(connections_.begin(), connections_.end(), |
| 1618 [conn1, conn2](Connection* conn) { | 1620 [conn1, conn2](Connection* conn) { |
| 1619 return conn == conn1 || conn == conn2; | 1621 return conn == conn1 || conn == conn2; |
| 1620 })); | 1622 })); |
| 1621 } | 1623 } |
| 1622 | 1624 |
| 1623 } // namespace cricket | 1625 } // namespace cricket |
| OLD | NEW |