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_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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 header->packet_sequence_number = ++sequence_number_; | 438 header->packet_sequence_number = ++sequence_number_; |
439 header->public_header.sequence_number_length = sequence_number_length_; | 439 header->public_header.sequence_number_length = sequence_number_length_; |
440 header->entropy_flag = random_bool_source_->RandBool(); | 440 header->entropy_flag = random_bool_source_->RandBool(); |
441 header->is_in_fec_group = fec_group == 0 ? NOT_IN_FEC_GROUP : IN_FEC_GROUP; | 441 header->is_in_fec_group = fec_group == 0 ? NOT_IN_FEC_GROUP : IN_FEC_GROUP; |
442 header->fec_group = fec_group; | 442 header->fec_group = fec_group; |
443 } | 443 } |
444 | 444 |
445 bool QuicPacketCreator::ShouldRetransmit(const QuicFrame& frame) { | 445 bool QuicPacketCreator::ShouldRetransmit(const QuicFrame& frame) { |
446 switch (frame.type) { | 446 switch (frame.type) { |
447 case ACK_FRAME: | 447 case ACK_FRAME: |
448 case CONGESTION_FEEDBACK_FRAME: | |
449 case PADDING_FRAME: | 448 case PADDING_FRAME: |
450 case STOP_WAITING_FRAME: | 449 case STOP_WAITING_FRAME: |
451 return false; | 450 return false; |
452 default: | 451 default: |
453 return true; | 452 return true; |
454 } | 453 } |
455 } | 454 } |
456 | 455 |
457 bool QuicPacketCreator::AddFrame(const QuicFrame& frame, | 456 bool QuicPacketCreator::AddFrame(const QuicFrame& frame, |
458 bool save_retransmittable_frames) { | 457 bool save_retransmittable_frames) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 if (!is_handshake) { | 509 if (!is_handshake) { |
511 return; | 510 return; |
512 } | 511 } |
513 | 512 |
514 QuicPaddingFrame padding; | 513 QuicPaddingFrame padding; |
515 bool success = AddFrame(QuicFrame(&padding), false); | 514 bool success = AddFrame(QuicFrame(&padding), false); |
516 DCHECK(success); | 515 DCHECK(success); |
517 } | 516 } |
518 | 517 |
519 } // namespace net | 518 } // namespace net |
OLD | NEW |