| 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 return; | 269 return; |
| 270 } | 270 } |
| 271 | 271 |
| 272 tiebreaker_ = tiebreaker; | 272 tiebreaker_ = tiebreaker; |
| 273 } | 273 } |
| 274 | 274 |
| 275 IceTransportState P2PTransportChannel::GetState() const { | 275 IceTransportState P2PTransportChannel::GetState() const { |
| 276 return state_; | 276 return state_; |
| 277 } | 277 } |
| 278 | 278 |
| 279 rtc::Optional<int> P2PTransportChannel::GetRttEstimate() { | |
| 280 if (selected_connection_ != nullptr | |
| 281 && selected_connection_->rtt_samples() > 0) { | |
| 282 return rtc::Optional<int>(selected_connection_->rtt()); | |
| 283 } else { | |
| 284 return rtc::Optional<int>(); | |
| 285 } | |
| 286 } | |
| 287 | |
| 288 // A channel is considered ICE completed once there is at most one active | 279 // A channel is considered ICE completed once there is at most one active |
| 289 // connection per network and at least one active connection. | 280 // connection per network and at least one active connection. |
| 290 IceTransportState P2PTransportChannel::ComputeState() const { | 281 IceTransportState P2PTransportChannel::ComputeState() const { |
| 291 if (!had_connection_) { | 282 if (!had_connection_) { |
| 292 return IceTransportState::STATE_INIT; | 283 return IceTransportState::STATE_INIT; |
| 293 } | 284 } |
| 294 | 285 |
| 295 std::vector<Connection*> active_connections; | 286 std::vector<Connection*> active_connections; |
| 296 for (Connection* connection : connections_) { | 287 for (Connection* connection : connections_) { |
| 297 if (connection->active()) { | 288 if (connection->active()) { |
| (...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2043 | 2034 |
| 2044 void P2PTransportChannel::set_receiving(bool receiving) { | 2035 void P2PTransportChannel::set_receiving(bool receiving) { |
| 2045 if (receiving_ == receiving) { | 2036 if (receiving_ == receiving) { |
| 2046 return; | 2037 return; |
| 2047 } | 2038 } |
| 2048 receiving_ = receiving; | 2039 receiving_ = receiving; |
| 2049 SignalReceivingState(this); | 2040 SignalReceivingState(this); |
| 2050 } | 2041 } |
| 2051 | 2042 |
| 2052 } // namespace cricket | 2043 } // namespace cricket |
| OLD | NEW |