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_flags.h" | 7 #include "net/quic/core/quic_flags.h" |
8 #include "net/quic/core/quic_utils.h" | 8 #include "net/quic/core/quic_utils.h" |
9 #include "net/quic/core/quic_versions.h" | 9 #include "net/quic/core/quic_versions.h" |
10 #include "net/quic/platform/api/quic_ptr_util.h" | 10 #include "net/quic/platform/api/quic_ptr_util.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 encrypted_length(encrypted_length), | 219 encrypted_length(encrypted_length), |
220 has_crypto_handshake(NOT_HANDSHAKE), | 220 has_crypto_handshake(NOT_HANDSHAKE), |
221 num_padding_bytes(0), | 221 num_padding_bytes(0), |
222 path_id(path_id), | 222 path_id(path_id), |
223 packet_number(packet_number), | 223 packet_number(packet_number), |
224 packet_number_length(packet_number_length), | 224 packet_number_length(packet_number_length), |
225 encryption_level(ENCRYPTION_NONE), | 225 encryption_level(ENCRYPTION_NONE), |
226 has_ack(has_ack), | 226 has_ack(has_ack), |
227 has_stop_waiting(has_stop_waiting), | 227 has_stop_waiting(has_stop_waiting), |
228 transmission_type(NOT_RETRANSMISSION), | 228 transmission_type(NOT_RETRANSMISSION), |
229 original_path_id(kInvalidPathId), | |
230 original_packet_number(0) {} | 229 original_packet_number(0) {} |
231 | 230 |
232 SerializedPacket::SerializedPacket(const SerializedPacket& other) = default; | 231 SerializedPacket::SerializedPacket(const SerializedPacket& other) = default; |
233 | 232 |
234 SerializedPacket::~SerializedPacket() {} | 233 SerializedPacket::~SerializedPacket() {} |
235 | 234 |
236 void ClearSerializedPacket(SerializedPacket* serialized_packet) { | 235 void ClearSerializedPacket(SerializedPacket* serialized_packet) { |
237 if (!serialized_packet->retransmittable_frames.empty()) { | 236 if (!serialized_packet->retransmittable_frames.empty()) { |
238 DeleteFrames(&serialized_packet->retransmittable_frames); | 237 DeleteFrames(&serialized_packet->retransmittable_frames); |
239 } | 238 } |
240 serialized_packet->encrypted_buffer = nullptr; | 239 serialized_packet->encrypted_buffer = nullptr; |
241 serialized_packet->encrypted_length = 0; | 240 serialized_packet->encrypted_length = 0; |
242 } | 241 } |
243 | 242 |
244 char* CopyBuffer(const SerializedPacket& packet) { | 243 char* CopyBuffer(const SerializedPacket& packet) { |
245 char* dst_buffer = new char[packet.encrypted_length]; | 244 char* dst_buffer = new char[packet.encrypted_length]; |
246 memcpy(dst_buffer, packet.encrypted_buffer, packet.encrypted_length); | 245 memcpy(dst_buffer, packet.encrypted_buffer, packet.encrypted_length); |
247 return dst_buffer; | 246 return dst_buffer; |
248 } | 247 } |
249 | 248 |
250 } // namespace net | 249 } // namespace net |
OLD | NEW |