| 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_packets.h" | 5 #include "net/quic/core/quic_packets.h" |
| 6 | 6 |
| 7 #include "net/quic/core/quic_utils.h" | 7 #include "net/quic/core/quic_utils.h" |
| 8 #include "net/quic/core/quic_versions.h" | 8 #include "net/quic/core/quic_versions.h" |
| 9 #include "net/quic/platform/api/quic_flags.h" | 9 #include "net/quic/platform/api/quic_flags.h" |
| 10 #include "net/quic/platform/api/quic_ptr_util.h" | 10 #include "net/quic/platform/api/quic_ptr_util.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 QuicPacketNumberLength packet_number_length) { | 45 QuicPacketNumberLength packet_number_length) { |
| 46 // Encryption starts before private flags. | 46 // Encryption starts before private flags. |
| 47 return GetPacketHeaderSize(version, connection_id_length, include_version, | 47 return GetPacketHeaderSize(version, connection_id_length, include_version, |
| 48 include_diversification_nonce, | 48 include_diversification_nonce, |
| 49 packet_number_length); | 49 packet_number_length); |
| 50 } | 50 } |
| 51 | 51 |
| 52 QuicPacketPublicHeader::QuicPacketPublicHeader() | 52 QuicPacketPublicHeader::QuicPacketPublicHeader() |
| 53 : connection_id(0), | 53 : connection_id(0), |
| 54 connection_id_length(PACKET_8BYTE_CONNECTION_ID), | 54 connection_id_length(PACKET_8BYTE_CONNECTION_ID), |
| 55 multipath_flag(false), | |
| 56 reset_flag(false), | 55 reset_flag(false), |
| 57 version_flag(false), | 56 version_flag(false), |
| 58 packet_number_length(PACKET_6BYTE_PACKET_NUMBER), | 57 packet_number_length(PACKET_6BYTE_PACKET_NUMBER), |
| 59 nonce(nullptr) {} | 58 nonce(nullptr) {} |
| 60 | 59 |
| 61 QuicPacketPublicHeader::QuicPacketPublicHeader( | 60 QuicPacketPublicHeader::QuicPacketPublicHeader( |
| 62 const QuicPacketPublicHeader& other) = default; | 61 const QuicPacketPublicHeader& other) = default; |
| 63 | 62 |
| 64 QuicPacketPublicHeader::~QuicPacketPublicHeader() {} | 63 QuicPacketPublicHeader::~QuicPacketPublicHeader() {} |
| 65 | 64 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 serialized_packet->largest_acked = 0; | 227 serialized_packet->largest_acked = 0; |
| 229 } | 228 } |
| 230 | 229 |
| 231 char* CopyBuffer(const SerializedPacket& packet) { | 230 char* CopyBuffer(const SerializedPacket& packet) { |
| 232 char* dst_buffer = new char[packet.encrypted_length]; | 231 char* dst_buffer = new char[packet.encrypted_length]; |
| 233 memcpy(dst_buffer, packet.encrypted_buffer, packet.encrypted_length); | 232 memcpy(dst_buffer, packet.encrypted_buffer, packet.encrypted_length); |
| 234 return dst_buffer; | 233 return dst_buffer; |
| 235 } | 234 } |
| 236 | 235 |
| 237 } // namespace net | 236 } // namespace net |
| OLD | NEW |