Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(838)

Side by Side Diff: net/quic/quic_packet_generator.cc

Issue 1979763002: Landing Recent QUIC changes until Sun May 8 00:39:29 2016 +0000 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_packet_creator_test.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/quic/quic_packet_creator_test.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698