| 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 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1301 SignalDestroyed(this); | 1301 SignalDestroyed(this); |
| 1302 delete this; | 1302 delete this; |
| 1303 } | 1303 } |
| 1304 | 1304 |
| 1305 uint32_t Connection::last_received() { | 1305 uint32_t Connection::last_received() { |
| 1306 return std::max(last_data_received_, | 1306 return std::max(last_data_received_, |
| 1307 std::max(last_ping_received_, last_ping_response_received_)); | 1307 std::max(last_ping_received_, last_ping_response_received_)); |
| 1308 } | 1308 } |
| 1309 | 1309 |
| 1310 size_t Connection::recv_bytes_second() { | 1310 size_t Connection::recv_bytes_second() { |
| 1311 return recv_rate_tracker_.ComputeRate(); | 1311 return round(recv_rate_tracker_.ComputeRate()); |
| 1312 } | 1312 } |
| 1313 | 1313 |
| 1314 size_t Connection::recv_total_bytes() { | 1314 size_t Connection::recv_total_bytes() { |
| 1315 return recv_rate_tracker_.TotalSampleCount(); | 1315 return recv_rate_tracker_.TotalSampleCount(); |
| 1316 } | 1316 } |
| 1317 | 1317 |
| 1318 size_t Connection::sent_bytes_second() { | 1318 size_t Connection::sent_bytes_second() { |
| 1319 return send_rate_tracker_.ComputeRate(); | 1319 return round(send_rate_tracker_.ComputeRate()); |
| 1320 } | 1320 } |
| 1321 | 1321 |
| 1322 size_t Connection::sent_total_bytes() { | 1322 size_t Connection::sent_total_bytes() { |
| 1323 return send_rate_tracker_.TotalSampleCount(); | 1323 return send_rate_tracker_.TotalSampleCount(); |
| 1324 } | 1324 } |
| 1325 | 1325 |
| 1326 size_t Connection::sent_discarded_packets() { | 1326 size_t Connection::sent_discarded_packets() { |
| 1327 return sent_packets_discarded_; | 1327 return sent_packets_discarded_; |
| 1328 } | 1328 } |
| 1329 | 1329 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1414 ASSERT(sent < 0); | 1414 ASSERT(sent < 0); |
| 1415 error_ = port_->GetError(); | 1415 error_ = port_->GetError(); |
| 1416 sent_packets_discarded_++; | 1416 sent_packets_discarded_++; |
| 1417 } else { | 1417 } else { |
| 1418 send_rate_tracker_.AddSamples(sent); | 1418 send_rate_tracker_.AddSamples(sent); |
| 1419 } | 1419 } |
| 1420 return sent; | 1420 return sent; |
| 1421 } | 1421 } |
| 1422 | 1422 |
| 1423 } // namespace cricket | 1423 } // namespace cricket |
| OLD | NEW |