| 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_packet_generator.h" | 5 #include "net/quic/quic_packet_generator.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "net/quic/quic_bug_tracker.h" | 8 #include "net/quic/quic_bug_tracker.h" |
| 9 #include "net/quic/quic_flags.h" | 9 #include "net/quic/quic_flags.h" |
| 10 #include "net/quic/quic_utils.h" | 10 #include "net/quic/quic_utils.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 if (!packet_creator_.ConsumeData(id, iov, total_bytes_consumed, | 84 if (!packet_creator_.ConsumeData(id, iov, total_bytes_consumed, |
| 85 offset + total_bytes_consumed, fin, | 85 offset + total_bytes_consumed, fin, |
| 86 has_handshake, &frame)) { | 86 has_handshake, &frame)) { |
| 87 // The creator is always flushed if there's not enough room for a new | 87 // The creator is always flushed if there's not enough room for a new |
| 88 // stream frame before ConsumeData, so ConsumeData should always succeed. | 88 // stream frame before ConsumeData, so ConsumeData should always succeed. |
| 89 QUIC_BUG << "Failed to ConsumeData, stream:" << id; | 89 QUIC_BUG << "Failed to ConsumeData, stream:" << id; |
| 90 return QuicConsumedData(0, false); | 90 return QuicConsumedData(0, false); |
| 91 } | 91 } |
| 92 | 92 |
| 93 // A stream frame is created and added. | 93 // A stream frame is created and added. |
| 94 size_t bytes_consumed = frame.stream_frame->frame_length; | 94 size_t bytes_consumed = frame.stream_frame->data_length; |
| 95 if (listener != nullptr) { | 95 if (listener != nullptr) { |
| 96 packet_creator_.AddAckListener(listener, bytes_consumed); | 96 packet_creator_.AddAckListener(listener, bytes_consumed); |
| 97 } | 97 } |
| 98 total_bytes_consumed += bytes_consumed; | 98 total_bytes_consumed += bytes_consumed; |
| 99 fin_consumed = fin && total_bytes_consumed == iov.total_length; | 99 fin_consumed = fin && total_bytes_consumed == iov.total_length; |
| 100 DCHECK(total_bytes_consumed == iov.total_length || | 100 DCHECK(total_bytes_consumed == iov.total_length || |
| 101 (bytes_consumed > 0 && packet_creator_.HasPendingFrames())); | 101 (bytes_consumed > 0 && packet_creator_.HasPendingFrames())); |
| 102 | 102 |
| 103 if (!InBatchMode()) { | 103 if (!InBatchMode()) { |
| 104 packet_creator_.Flush(); | 104 packet_creator_.Flush(); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 294 |
| 295 void QuicPacketGenerator::SetCurrentPath( | 295 void QuicPacketGenerator::SetCurrentPath( |
| 296 QuicPathId path_id, | 296 QuicPathId path_id, |
| 297 QuicPacketNumber least_packet_awaited_by_peer, | 297 QuicPacketNumber least_packet_awaited_by_peer, |
| 298 QuicPacketCount max_packets_in_flight) { | 298 QuicPacketCount max_packets_in_flight) { |
| 299 packet_creator_.SetCurrentPath(path_id, least_packet_awaited_by_peer, | 299 packet_creator_.SetCurrentPath(path_id, least_packet_awaited_by_peer, |
| 300 max_packets_in_flight); | 300 max_packets_in_flight); |
| 301 } | 301 } |
| 302 | 302 |
| 303 } // namespace net | 303 } // namespace net |
| OLD | NEW |