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

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

Issue 2011653004: Remove obsolete fields in quic_protocol and their current usage in QUIC. Reorders QuicAckFrame fie… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@122721477
Patch Set: Created 4 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
« no previous file with comments | « net/quic/quic_framer_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_creator.h" 5 #include "net/quic/quic_packet_creator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 if (IncludeNonceInPublicHeader()) { 515 if (IncludeNonceInPublicHeader()) {
516 DCHECK_EQ(Perspective::IS_SERVER, framer_->perspective()); 516 DCHECK_EQ(Perspective::IS_SERVER, framer_->perspective());
517 header->public_header.nonce = &diversification_nonce_; 517 header->public_header.nonce = &diversification_nonce_;
518 } else { 518 } else {
519 header->public_header.nonce = nullptr; 519 header->public_header.nonce = nullptr;
520 } 520 }
521 header->path_id = packet_.path_id; 521 header->path_id = packet_.path_id;
522 header->packet_number = ++packet_.packet_number; 522 header->packet_number = ++packet_.packet_number;
523 header->public_header.packet_number_length = packet_.packet_number_length; 523 header->public_header.packet_number_length = packet_.packet_number_length;
524 header->entropy_flag = random_bool_source_->RandBool(); 524 header->entropy_flag = random_bool_source_->RandBool();
525 header->is_in_fec_group = NOT_IN_FEC_GROUP;
526 header->fec_group = 0;
527 } 525 }
528 526
529 bool QuicPacketCreator::ShouldRetransmit(const QuicFrame& frame) { 527 bool QuicPacketCreator::ShouldRetransmit(const QuicFrame& frame) {
530 switch (frame.type) { 528 switch (frame.type) {
531 case ACK_FRAME: 529 case ACK_FRAME:
532 case PADDING_FRAME: 530 case PADDING_FRAME:
533 case STOP_WAITING_FRAME: 531 case STOP_WAITING_FRAME:
534 case MTU_DISCOVERY_FRAME: 532 case MTU_DISCOVERY_FRAME:
535 return false; 533 return false;
536 default: 534 default:
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 // Switching path needs to update packet number length. 629 // Switching path needs to update packet number length.
632 UpdatePacketNumberLength(least_packet_awaited_by_peer, max_packets_in_flight); 630 UpdatePacketNumberLength(least_packet_awaited_by_peer, max_packets_in_flight);
633 } 631 }
634 632
635 bool QuicPacketCreator::IncludeNonceInPublicHeader() { 633 bool QuicPacketCreator::IncludeNonceInPublicHeader() {
636 return have_diversification_nonce_ && 634 return have_diversification_nonce_ &&
637 packet_.encryption_level == ENCRYPTION_INITIAL; 635 packet_.encryption_level == ENCRYPTION_INITIAL;
638 } 636 }
639 637
640 } // namespace net 638 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_framer_test.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698