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

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

Issue 341083007: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compile fix Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_packet_creator.h ('k') | net/quic/quic_packet_generator.cc » ('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_creator.h" 5 #include "net/quic/quic_packet_creator.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "net/quic/crypto/quic_random.h" 9 #include "net/quic/crypto/quic_random.h"
10 #include "net/quic/quic_ack_notifier.h" 10 #include "net/quic/quic_ack_notifier.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 } 305 }
306 SerializedPacket packet = SerializePacket(); 306 SerializedPacket packet = SerializePacket();
307 DCHECK(packet.retransmittable_frames == NULL); 307 DCHECK(packet.retransmittable_frames == NULL);
308 return packet; 308 return packet;
309 } 309 }
310 310
311 bool QuicPacketCreator::HasPendingFrames() const { 311 bool QuicPacketCreator::HasPendingFrames() const {
312 return !queued_frames_.empty(); 312 return !queued_frames_.empty();
313 } 313 }
314 314
315 bool QuicPacketCreator::HasPendingRetransmittableFrames() const {
316 return queued_retransmittable_frames_.get() != NULL &&
317 !queued_retransmittable_frames_->frames().empty();
318 }
319
315 size_t QuicPacketCreator::ExpansionOnNewFrame() const { 320 size_t QuicPacketCreator::ExpansionOnNewFrame() const {
316 // If packet is FEC protected, there's no expansion. 321 // If packet is FEC protected, there's no expansion.
317 if (should_fec_protect_) { 322 if (should_fec_protect_) {
318 return 0; 323 return 0;
319 } 324 }
320 // If the last frame in the packet is a stream frame, then it will expand to 325 // If the last frame in the packet is a stream frame, then it will expand to
321 // include the stream_length field when a new frame is added. 326 // include the stream_length field when a new frame is added.
322 bool has_trailing_stream_frame = 327 bool has_trailing_stream_frame =
323 !queued_frames_.empty() && queued_frames_.back().type == STREAM_FRAME; 328 !queued_frames_.empty() && queued_frames_.back().type == STREAM_FRAME;
324 return has_trailing_stream_frame ? kQuicStreamPayloadLengthSize : 0; 329 return has_trailing_stream_frame ? kQuicStreamPayloadLengthSize : 0;
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 if (!is_handshake) { 508 if (!is_handshake) {
504 return; 509 return;
505 } 510 }
506 511
507 QuicPaddingFrame padding; 512 QuicPaddingFrame padding;
508 bool success = AddFrame(QuicFrame(&padding), false); 513 bool success = AddFrame(QuicFrame(&padding), false);
509 DCHECK(success); 514 DCHECK(success);
510 } 515 }
511 516
512 } // namespace net 517 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_packet_creator.h ('k') | net/quic/quic_packet_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698