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_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 Loading... |
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 |
OLD | NEW |