| 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/core/quic_connection.h" | 5 #include "net/quic/core/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 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 | 971 |
| 972 bool QuicConnection::OnBlockedFrame(const QuicBlockedFrame& frame) { | 972 bool QuicConnection::OnBlockedFrame(const QuicBlockedFrame& frame) { |
| 973 DCHECK(connected_); | 973 DCHECK(connected_); |
| 974 if (debug_visitor_ != nullptr) { | 974 if (debug_visitor_ != nullptr) { |
| 975 debug_visitor_->OnBlockedFrame(frame); | 975 debug_visitor_->OnBlockedFrame(frame); |
| 976 } | 976 } |
| 977 DVLOG(1) << ENDPOINT | 977 DVLOG(1) << ENDPOINT |
| 978 << "BLOCKED_FRAME received for stream: " << frame.stream_id; | 978 << "BLOCKED_FRAME received for stream: " << frame.stream_id; |
| 979 visitor_->OnBlockedFrame(frame); | 979 visitor_->OnBlockedFrame(frame); |
| 980 visitor_->PostProcessAfterData(); | 980 visitor_->PostProcessAfterData(); |
| 981 stats_.blocked_frames_received++; |
| 981 should_last_packet_instigate_acks_ = true; | 982 should_last_packet_instigate_acks_ = true; |
| 982 return connected_; | 983 return connected_; |
| 983 } | 984 } |
| 984 | 985 |
| 985 bool QuicConnection::OnPathCloseFrame(const QuicPathCloseFrame& frame) { | 986 bool QuicConnection::OnPathCloseFrame(const QuicPathCloseFrame& frame) { |
| 986 DCHECK(connected_); | 987 DCHECK(connected_); |
| 987 if (debug_visitor_ != nullptr) { | 988 if (debug_visitor_ != nullptr) { |
| 988 debug_visitor_->OnPathCloseFrame(frame); | 989 debug_visitor_->OnPathCloseFrame(frame); |
| 989 } | 990 } |
| 990 DVLOG(1) << ENDPOINT | 991 DVLOG(1) << ENDPOINT |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1265 // Opportunistically bundle an ack with this outgoing packet. | 1266 // Opportunistically bundle an ack with this outgoing packet. |
| 1266 ScopedPacketBundler ack_bundler(this, SEND_ACK_IF_PENDING); | 1267 ScopedPacketBundler ack_bundler(this, SEND_ACK_IF_PENDING); |
| 1267 packet_generator_.AddControlFrame( | 1268 packet_generator_.AddControlFrame( |
| 1268 QuicFrame(new QuicWindowUpdateFrame(id, byte_offset))); | 1269 QuicFrame(new QuicWindowUpdateFrame(id, byte_offset))); |
| 1269 } | 1270 } |
| 1270 | 1271 |
| 1271 void QuicConnection::SendBlocked(QuicStreamId id) { | 1272 void QuicConnection::SendBlocked(QuicStreamId id) { |
| 1272 // Opportunistically bundle an ack with this outgoing packet. | 1273 // Opportunistically bundle an ack with this outgoing packet. |
| 1273 ScopedPacketBundler ack_bundler(this, SEND_ACK_IF_PENDING); | 1274 ScopedPacketBundler ack_bundler(this, SEND_ACK_IF_PENDING); |
| 1274 packet_generator_.AddControlFrame(QuicFrame(new QuicBlockedFrame(id))); | 1275 packet_generator_.AddControlFrame(QuicFrame(new QuicBlockedFrame(id))); |
| 1276 stats_.blocked_frames_sent++; |
| 1275 } | 1277 } |
| 1276 | 1278 |
| 1277 void QuicConnection::SendPathClose(QuicPathId path_id) { | 1279 void QuicConnection::SendPathClose(QuicPathId path_id) { |
| 1278 // Opportunistically bundle an ack with this outgoing packet. | 1280 // Opportunistically bundle an ack with this outgoing packet. |
| 1279 ScopedPacketBundler ack_bundler(this, SEND_ACK_IF_PENDING); | 1281 ScopedPacketBundler ack_bundler(this, SEND_ACK_IF_PENDING); |
| 1280 packet_generator_.AddControlFrame(QuicFrame(new QuicPathCloseFrame(path_id))); | 1282 packet_generator_.AddControlFrame(QuicFrame(new QuicPathCloseFrame(path_id))); |
| 1281 OnPathClosed(path_id); | 1283 OnPathClosed(path_id); |
| 1282 } | 1284 } |
| 1283 | 1285 |
| 1284 const QuicConnectionStats& QuicConnection::GetStats() { | 1286 const QuicConnectionStats& QuicConnection::GetStats() { |
| (...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2581 | 2583 |
| 2582 void QuicConnection::CheckIfApplicationLimited() { | 2584 void QuicConnection::CheckIfApplicationLimited() { |
| 2583 if (queued_packets_.empty() && | 2585 if (queued_packets_.empty() && |
| 2584 !sent_packet_manager_->HasPendingRetransmissions() && | 2586 !sent_packet_manager_->HasPendingRetransmissions() && |
| 2585 !visitor_->WillingAndAbleToWrite()) { | 2587 !visitor_->WillingAndAbleToWrite()) { |
| 2586 sent_packet_manager_->OnApplicationLimited(); | 2588 sent_packet_manager_->OnApplicationLimited(); |
| 2587 } | 2589 } |
| 2588 } | 2590 } |
| 2589 | 2591 |
| 2590 } // namespace net | 2592 } // namespace net |
| OLD | NEW |