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

Unified Diff: net/quic/core/quic_packet_creator.cc

Issue 2242413002: Stop using next_packet_sequence_number_length in QuicPacketCreator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@130098258
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/quic_flags.cc ('k') | net/quic/core/quic_packet_creator_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_packet_creator.cc
diff --git a/net/quic/core/quic_packet_creator.cc b/net/quic/core/quic_packet_creator.cc
index 27f715a66b371aa5ac3416dc8322eea32f9ff2b5..d6b82a1d23f8dc3e92e60c48e08f944456d6837e 100644
--- a/net/quic/core/quic_packet_creator.cc
+++ b/net/quic/core/quic_packet_creator.cc
@@ -83,7 +83,7 @@ void QuicPacketCreator::SetMaxPacketLength(QuicByteCount length) {
}
void QuicPacketCreator::MaybeUpdatePacketNumberLength() {
- DCHECK(!FLAGS_quic_simple_packet_number_length);
+ DCHECK(!FLAGS_quic_simple_packet_number_length_2);
if (!queued_frames_.empty()) {
// Don't change creator state if there are frames queued.
return;
@@ -115,7 +115,7 @@ void QuicPacketCreator::SetDiversificationNonce(
void QuicPacketCreator::UpdatePacketNumberLength(
QuicPacketNumber least_packet_awaited_by_peer,
QuicPacketCount max_packets_in_flight) {
- if (FLAGS_quic_simple_packet_number_length && !queued_frames_.empty()) {
+ if (FLAGS_quic_simple_packet_number_length_2 && !queued_frames_.empty()) {
// Don't change creator state if there are frames queued.
QUIC_BUG << "Called UpdatePacketNumberLength with " << queued_frames_.size()
<< " queued_frames. First frame type:"
@@ -128,7 +128,7 @@ void QuicPacketCreator::UpdatePacketNumberLength(
const QuicPacketNumber current_delta =
packet_.packet_number + 1 - least_packet_awaited_by_peer;
const uint64_t delta = max(current_delta, max_packets_in_flight);
- if (FLAGS_quic_simple_packet_number_length) {
+ if (FLAGS_quic_simple_packet_number_length_2) {
packet_.packet_number_length =
QuicFramer::GetMinSequenceNumberLength(delta * 4);
} else {
@@ -209,7 +209,7 @@ void QuicPacketCreator::CreateStreamFrame(QuicStreamId id,
IncludeNonceInPublicHeader(),
PACKET_6BYTE_PACKET_NUMBER, offset));
- if (!FLAGS_quic_simple_packet_number_length) {
+ if (!FLAGS_quic_simple_packet_number_length_2) {
MaybeUpdatePacketNumberLength();
}
QUIC_BUG_IF(!HasRoomForStreamFrame(id, offset))
@@ -304,7 +304,7 @@ void QuicPacketCreator::ReserializeAllFrames(
// Temporarily set the packet number length and change the encryption level.
packet_.packet_number_length = retransmission.packet_number_length;
- if (!FLAGS_quic_simple_packet_number_length) {
+ if (!FLAGS_quic_simple_packet_number_length_2) {
next_packet_number_length_ = retransmission.packet_number_length;
}
packet_.num_padding_bytes = retransmission.num_padding_bytes;
@@ -332,7 +332,7 @@ void QuicPacketCreator::ReserializeAllFrames(
packet_.transmission_type = retransmission.transmission_type;
OnSerializedPacket();
// Restore old values.
- if (!FLAGS_quic_simple_packet_number_length) {
+ if (!FLAGS_quic_simple_packet_number_length_2) {
// OnSerializedPacket updates the packet_number_length, so it's incorrect to
// restore it here.
packet_.packet_number_length = saved_length;
@@ -487,7 +487,7 @@ size_t QuicPacketCreator::PacketSize() {
return packet_size_;
}
// Update packet number length on packet boundary.
- if (!FLAGS_quic_simple_packet_number_length) {
+ if (!FLAGS_quic_simple_packet_number_length_2) {
packet_.packet_number_length = next_packet_number_length_;
}
packet_size_ = GetPacketHeaderSize(
@@ -622,7 +622,7 @@ bool QuicPacketCreator::AddFrame(const QuicFrame& frame,
ConnectionCloseSource::FROM_SELF);
return false;
}
- if (!FLAGS_quic_simple_packet_number_length) {
+ if (!FLAGS_quic_simple_packet_number_length_2) {
MaybeUpdatePacketNumberLength();
}
size_t frame_len = framer_->GetSerializedFrameLength(
« no previous file with comments | « net/quic/core/quic_flags.cc ('k') | net/quic/core/quic_packet_creator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698