Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: webrtc/p2p/base/p2ptransportchannel.cc

Issue 2670113002: Pick the DTLS handshake timeout based on the ICE RTT estimate (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 return rtc::Optional<int>(selected_connection_->rtt());
282 } else {
283 return rtc::Optional<int>();
284 }
285 }
286
279 // A channel is considered ICE completed once there is at most one active 287 // A channel is considered ICE completed once there is at most one active
280 // connection per network and at least one active connection. 288 // connection per network and at least one active connection.
281 IceTransportState P2PTransportChannel::ComputeState() const { 289 IceTransportState P2PTransportChannel::ComputeState() const {
282 if (!had_connection_) { 290 if (!had_connection_) {
283 return IceTransportState::STATE_INIT; 291 return IceTransportState::STATE_INIT;
284 } 292 }
285 293
286 std::vector<Connection*> active_connections; 294 std::vector<Connection*> active_connections;
287 for (Connection* connection : connections_) { 295 for (Connection* connection : connections_) {
288 if (connection->active()) { 296 if (connection->active()) {
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 2042
2035 void P2PTransportChannel::set_receiving(bool receiving) { 2043 void P2PTransportChannel::set_receiving(bool receiving) {
2036 if (receiving_ == receiving) { 2044 if (receiving_ == receiving) {
2037 return; 2045 return;
2038 } 2046 }
2039 receiving_ = receiving; 2047 receiving_ = receiving;
2040 SignalReceivingState(this); 2048 SignalReceivingState(this);
2041 } 2049 }
2042 2050
2043 } // namespace cricket 2051 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698