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 |
11 #include "webrtc/p2p/base/port.h" | 11 #include "webrtc/p2p/base/port.h" |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "webrtc/base/base64.h" | |
17 #include "webrtc/base/checks.h" | |
18 #include "webrtc/base/crc32.h" | |
19 #include "webrtc/base/helpers.h" | |
20 #include "webrtc/base/logging.h" | |
21 #include "webrtc/base/messagedigest.h" | |
22 #include "webrtc/base/network.h" | |
23 #include "webrtc/base/ptr_util.h" | |
24 #include "webrtc/base/safe_minmax.h" | |
25 #include "webrtc/base/stringencode.h" | |
26 #include "webrtc/base/stringutils.h" | |
27 #include "webrtc/p2p/base/common.h" | 16 #include "webrtc/p2p/base/common.h" |
28 #include "webrtc/p2p/base/portallocator.h" | 17 #include "webrtc/p2p/base/portallocator.h" |
| 18 #include "webrtc/rtc_base/base64.h" |
| 19 #include "webrtc/rtc_base/checks.h" |
| 20 #include "webrtc/rtc_base/crc32.h" |
| 21 #include "webrtc/rtc_base/helpers.h" |
| 22 #include "webrtc/rtc_base/logging.h" |
| 23 #include "webrtc/rtc_base/messagedigest.h" |
| 24 #include "webrtc/rtc_base/network.h" |
| 25 #include "webrtc/rtc_base/ptr_util.h" |
| 26 #include "webrtc/rtc_base/safe_minmax.h" |
| 27 #include "webrtc/rtc_base/stringencode.h" |
| 28 #include "webrtc/rtc_base/stringutils.h" |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 // Determines whether we have seen at least the given maximum number of | 32 // Determines whether we have seen at least the given maximum number of |
33 // pings fail to have a response. | 33 // pings fail to have a response. |
34 inline bool TooManyFailures( | 34 inline bool TooManyFailures( |
35 const std::vector<cricket::Connection::SentPing>& pings_since_last_response, | 35 const std::vector<cricket::Connection::SentPing>& pings_since_last_response, |
36 uint32_t maximum_failures, | 36 uint32_t maximum_failures, |
37 int rtt_estimate, | 37 int rtt_estimate, |
38 int64_t now) { | 38 int64_t now) { |
(...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1633 RTC_DCHECK(sent < 0); | 1633 RTC_DCHECK(sent < 0); |
1634 error_ = port_->GetError(); | 1634 error_ = port_->GetError(); |
1635 stats_.sent_discarded_packets++; | 1635 stats_.sent_discarded_packets++; |
1636 } else { | 1636 } else { |
1637 send_rate_tracker_.AddSamples(sent); | 1637 send_rate_tracker_.AddSamples(sent); |
1638 } | 1638 } |
1639 return sent; | 1639 return sent; |
1640 } | 1640 } |
1641 | 1641 |
1642 } // namespace cricket | 1642 } // namespace cricket |
OLD | NEW |