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_generator.cc

Issue 687033002: Adding an option for peers to negotiate the length of the QUIC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_1028
Patch Set: Created 6 years, 1 month 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_generator.h ('k') | net/quic/quic_packet_generator_test.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_generator.h" 5 #include "net/quic/quic_packet_generator.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/quic_fec_group.h" 9 #include "net/quic/quic_fec_group.h"
10 #include "net/quic/quic_utils.h" 10 #include "net/quic/quic_utils.h"
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 return packet_creator_.ReserializeAllFrames(frames, original_length); 377 return packet_creator_.ReserializeAllFrames(frames, original_length);
378 } 378 }
379 379
380 void QuicPacketGenerator::UpdateSequenceNumberLength( 380 void QuicPacketGenerator::UpdateSequenceNumberLength(
381 QuicPacketSequenceNumber least_packet_awaited_by_peer, 381 QuicPacketSequenceNumber least_packet_awaited_by_peer,
382 QuicByteCount congestion_window) { 382 QuicByteCount congestion_window) {
383 return packet_creator_.UpdateSequenceNumberLength( 383 return packet_creator_.UpdateSequenceNumberLength(
384 least_packet_awaited_by_peer, congestion_window); 384 least_packet_awaited_by_peer, congestion_window);
385 } 385 }
386 386
387 void QuicPacketGenerator::SetConnectionIdLength(uint32 length) {
388 if (length == 0) {
389 packet_creator_.set_connection_id_length(PACKET_0BYTE_CONNECTION_ID);
390 } else if (length == 1) {
391 packet_creator_.set_connection_id_length(PACKET_1BYTE_CONNECTION_ID);
392 } else if (length <= 4) {
393 packet_creator_.set_connection_id_length(PACKET_4BYTE_CONNECTION_ID);
394 } else {
395 packet_creator_.set_connection_id_length(PACKET_8BYTE_CONNECTION_ID);
396 }
397 }
398
399
387 void QuicPacketGenerator::set_encryption_level(EncryptionLevel level) { 400 void QuicPacketGenerator::set_encryption_level(EncryptionLevel level) {
388 packet_creator_.set_encryption_level(level); 401 packet_creator_.set_encryption_level(level);
389 } 402 }
390 403
391 } // namespace net 404 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_packet_generator.h ('k') | net/quic/quic_packet_generator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698