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/core/quic_packet_creator.h" | 5 #include "net/quic/core/quic_packet_creator.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstdint> | 8 #include <cstdint> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 330 |
331 delegate_->OnSerializedPacket(&packet_); | 331 delegate_->OnSerializedPacket(&packet_); |
332 ClearPacket(); | 332 ClearPacket(); |
333 } | 333 } |
334 | 334 |
335 void QuicPacketCreator::ClearPacket() { | 335 void QuicPacketCreator::ClearPacket() { |
336 packet_.has_ack = false; | 336 packet_.has_ack = false; |
337 packet_.has_stop_waiting = false; | 337 packet_.has_stop_waiting = false; |
338 packet_.has_crypto_handshake = NOT_HANDSHAKE; | 338 packet_.has_crypto_handshake = NOT_HANDSHAKE; |
339 packet_.num_padding_bytes = 0; | 339 packet_.num_padding_bytes = 0; |
340 packet_.original_path_id = kInvalidPathId; | |
341 packet_.original_packet_number = 0; | 340 packet_.original_packet_number = 0; |
342 packet_.transmission_type = NOT_RETRANSMISSION; | 341 packet_.transmission_type = NOT_RETRANSMISSION; |
343 packet_.encrypted_buffer = nullptr; | 342 packet_.encrypted_buffer = nullptr; |
344 packet_.encrypted_length = 0; | 343 packet_.encrypted_length = 0; |
345 DCHECK(packet_.retransmittable_frames.empty()); | 344 DCHECK(packet_.retransmittable_frames.empty()); |
346 packet_.listeners.clear(); | 345 packet_.listeners.clear(); |
347 } | 346 } |
348 | 347 |
349 void QuicPacketCreator::CreateAndSerializeStreamFrame( | 348 void QuicPacketCreator::CreateAndSerializeStreamFrame( |
350 QuicStreamId id, | 349 QuicStreamId id, |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 // Switching path needs to update packet number length. | 654 // Switching path needs to update packet number length. |
656 UpdatePacketNumberLength(least_packet_awaited_by_peer, max_packets_in_flight); | 655 UpdatePacketNumberLength(least_packet_awaited_by_peer, max_packets_in_flight); |
657 } | 656 } |
658 | 657 |
659 bool QuicPacketCreator::IncludeNonceInPublicHeader() { | 658 bool QuicPacketCreator::IncludeNonceInPublicHeader() { |
660 return have_diversification_nonce_ && | 659 return have_diversification_nonce_ && |
661 packet_.encryption_level == ENCRYPTION_INITIAL; | 660 packet_.encryption_level == ENCRYPTION_INITIAL; |
662 } | 661 } |
663 | 662 |
664 } // namespace net | 663 } // namespace net |
OLD | NEW |