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

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

Issue 2670053002: Allow applications to limit the ICE check rate through RTCConfiguration (Closed)
Patch Set: CR feedback 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
« no previous file with comments | « webrtc/p2p/base/port.h ('k') | webrtc/pc/peerconnection.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 if (pings_since_last_response.size() == 0) 53 if (pings_since_last_response.size() == 0)
54 return false; 54 return false;
55 55
56 auto first = pings_since_last_response[0]; 56 auto first = pings_since_last_response[0];
57 return now > (first.sent_time + maximum_time); 57 return now > (first.sent_time + maximum_time);
58 } 58 }
59 59
60 // We will restrict RTT estimates (when used for determining state) to be 60 // We will restrict RTT estimates (when used for determining state) to be
61 // within a reasonable range. 61 // within a reasonable range.
62 const int MINIMUM_RTT = 100; // 0.1 seconds 62 const int MINIMUM_RTT = 100; // 0.1 seconds
63 const int MAXIMUM_RTT = 3000; // 3 seconds 63 const int MAXIMUM_RTT = 60000; // 60 seconds
64 64
65 // When we don't have any RTT data, we have to pick something reasonable. We 65 // When we don't have any RTT data, we have to pick something reasonable. We
66 // use a large value just in case the connection is really slow. 66 // use a large value just in case the connection is really slow.
67 const int DEFAULT_RTT = MAXIMUM_RTT; 67 const int DEFAULT_RTT = 3000; // 3 seconds
68 68
69 // Computes our estimate of the RTT given the current estimate. 69 // Computes our estimate of the RTT given the current estimate.
70 inline int ConservativeRTTEstimate(int rtt) { 70 inline int ConservativeRTTEstimate(int rtt) {
71 return std::max(MINIMUM_RTT, std::min(MAXIMUM_RTT, 2 * rtt)); 71 return std::max(MINIMUM_RTT, std::min(MAXIMUM_RTT, 2 * rtt));
72 } 72 }
73 73
74 // Weighting of the old rtt value to new data. 74 // Weighting of the old rtt value to new data.
75 const int RTT_RATIO = 3; // 3 : 1 75 const int RTT_RATIO = 3; // 3 : 1
76 76
77 // The delay before we begin checking if this port is useless. 77 // The delay before we begin checking if this port is useless.
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 RTC_DCHECK(sent < 0); 1583 RTC_DCHECK(sent < 0);
1584 error_ = port_->GetError(); 1584 error_ = port_->GetError();
1585 stats_.sent_discarded_packets++; 1585 stats_.sent_discarded_packets++;
1586 } else { 1586 } else {
1587 send_rate_tracker_.AddSamples(sent); 1587 send_rate_tracker_.AddSamples(sent);
1588 } 1588 }
1589 return sent; 1589 return sent;
1590 } 1590 }
1591 1591
1592 } // namespace cricket 1592 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/p2p/base/port.h ('k') | webrtc/pc/peerconnection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698