| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/quic/quic_connection.h" | 5 #include "net/quic/quic_connection.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 | 1085 |
| 1086 void QuicConnection::SendBlocked(QuicStreamId id) { | 1086 void QuicConnection::SendBlocked(QuicStreamId id) { |
| 1087 // Opportunistically bundle an ack with this outgoing packet. | 1087 // Opportunistically bundle an ack with this outgoing packet. |
| 1088 ScopedPacketBundler ack_bundler(this, BUNDLE_PENDING_ACK); | 1088 ScopedPacketBundler ack_bundler(this, BUNDLE_PENDING_ACK); |
| 1089 packet_generator_.AddControlFrame(QuicFrame(new QuicBlockedFrame(id))); | 1089 packet_generator_.AddControlFrame(QuicFrame(new QuicBlockedFrame(id))); |
| 1090 } | 1090 } |
| 1091 | 1091 |
| 1092 const QuicConnectionStats& QuicConnection::GetStats() { | 1092 const QuicConnectionStats& QuicConnection::GetStats() { |
| 1093 // Update rtt and estimated bandwidth. | 1093 // Update rtt and estimated bandwidth. |
| 1094 stats_.min_rtt_us = | 1094 stats_.min_rtt_us = |
| 1095 sent_packet_manager_.GetRttStats()->min_rtt().ToMicroseconds(); | 1095 sent_packet_manager_.GetRttStats()->MinRtt().ToMicroseconds(); |
| 1096 stats_.srtt_us = | 1096 stats_.srtt_us = |
| 1097 sent_packet_manager_.GetRttStats()->SmoothedRtt().ToMicroseconds(); | 1097 sent_packet_manager_.GetRttStats()->SmoothedRtt().ToMicroseconds(); |
| 1098 stats_.estimated_bandwidth = | 1098 stats_.estimated_bandwidth = |
| 1099 sent_packet_manager_.BandwidthEstimate().ToBytesPerSecond(); | 1099 sent_packet_manager_.BandwidthEstimate().ToBytesPerSecond(); |
| 1100 stats_.congestion_window = sent_packet_manager_.GetCongestionWindow(); | 1100 stats_.congestion_window = sent_packet_manager_.GetCongestionWindow(); |
| 1101 stats_.slow_start_threshold = sent_packet_manager_.GetSlowStartThreshold(); | 1101 stats_.slow_start_threshold = sent_packet_manager_.GetSlowStartThreshold(); |
| 1102 stats_.max_packet_size = packet_generator_.max_packet_length(); | 1102 stats_.max_packet_size = packet_generator_.max_packet_length(); |
| 1103 return stats_; | 1103 return stats_; |
| 1104 } | 1104 } |
| 1105 | 1105 |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2040 } | 2040 } |
| 2041 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) { | 2041 for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) { |
| 2042 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) { | 2042 if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) { |
| 2043 return true; | 2043 return true; |
| 2044 } | 2044 } |
| 2045 } | 2045 } |
| 2046 return false; | 2046 return false; |
| 2047 } | 2047 } |
| 2048 | 2048 |
| 2049 } // namespace net | 2049 } // namespace net |
| OLD | NEW |