| 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_protocol.h" | 5 #include "net/quic/quic_protocol.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "net/quic/quic_flags.h" | 8 #include "net/quic/quic_flags.h" |
| 9 #include "net/quic/quic_utils.h" | 9 #include "net/quic/quic_utils.h" |
| 10 | 10 |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 QuicPacketNumberLength packet_number_length, | 791 QuicPacketNumberLength packet_number_length, |
| 792 QuicEncryptedPacket* packet, | 792 QuicEncryptedPacket* packet, |
| 793 QuicPacketEntropyHash entropy_hash, | 793 QuicPacketEntropyHash entropy_hash, |
| 794 RetransmittableFrames* retransmittable_frames, | 794 RetransmittableFrames* retransmittable_frames, |
| 795 bool has_ack, | 795 bool has_ack, |
| 796 bool has_stop_waiting) | 796 bool has_stop_waiting) |
| 797 : packet(packet), | 797 : packet(packet), |
| 798 retransmittable_frames(retransmittable_frames), | 798 retransmittable_frames(retransmittable_frames), |
| 799 packet_number(packet_number), | 799 packet_number(packet_number), |
| 800 packet_number_length(packet_number_length), | 800 packet_number_length(packet_number_length), |
| 801 encryption_level(ENCRYPTION_NONE), |
| 801 entropy_hash(entropy_hash), | 802 entropy_hash(entropy_hash), |
| 802 is_fec_packet(false), | 803 is_fec_packet(false), |
| 803 has_ack(has_ack), | 804 has_ack(has_ack), |
| 804 has_stop_waiting(has_stop_waiting) {} | 805 has_stop_waiting(has_stop_waiting) {} |
| 805 | 806 |
| 806 SerializedPacket::SerializedPacket( | 807 SerializedPacket::SerializedPacket( |
| 807 QuicPacketNumber packet_number, | 808 QuicPacketNumber packet_number, |
| 808 QuicPacketNumberLength packet_number_length, | 809 QuicPacketNumberLength packet_number_length, |
| 809 char* encrypted_buffer, | 810 char* encrypted_buffer, |
| 810 size_t encrypted_length, | 811 size_t encrypted_length, |
| 811 bool owns_buffer, | 812 bool owns_buffer, |
| 812 QuicPacketEntropyHash entropy_hash, | 813 QuicPacketEntropyHash entropy_hash, |
| 813 RetransmittableFrames* retransmittable_frames, | 814 RetransmittableFrames* retransmittable_frames, |
| 814 bool has_ack, | 815 bool has_ack, |
| 815 bool has_stop_waiting) | 816 bool has_stop_waiting, |
| 817 EncryptionLevel level) |
| 816 : SerializedPacket(packet_number, | 818 : SerializedPacket(packet_number, |
| 817 packet_number_length, | 819 packet_number_length, |
| 818 new QuicEncryptedPacket(encrypted_buffer, | 820 new QuicEncryptedPacket(encrypted_buffer, |
| 819 encrypted_length, | 821 encrypted_length, |
| 820 owns_buffer), | 822 owns_buffer), |
| 821 entropy_hash, | 823 entropy_hash, |
| 822 retransmittable_frames, | 824 retransmittable_frames, |
| 823 has_ack, | 825 has_ack, |
| 824 has_stop_waiting) {} | 826 has_stop_waiting) { |
| 827 // TODO(ianswett): Move into the initializer list once SerializedPacket |
| 828 // no longer contains an encrypted packet. |
| 829 encryption_level = level; |
| 830 } |
| 825 | 831 |
| 826 SerializedPacket::~SerializedPacket() {} | 832 SerializedPacket::~SerializedPacket() {} |
| 827 | 833 |
| 828 QuicEncryptedPacket* QuicEncryptedPacket::Clone() const { | 834 QuicEncryptedPacket* QuicEncryptedPacket::Clone() const { |
| 829 char* buffer = new char[this->length()]; | 835 char* buffer = new char[this->length()]; |
| 830 memcpy(buffer, this->data(), this->length()); | 836 memcpy(buffer, this->data(), this->length()); |
| 831 return new QuicEncryptedPacket(buffer, this->length(), true); | 837 return new QuicEncryptedPacket(buffer, this->length(), true); |
| 832 } | 838 } |
| 833 | 839 |
| 834 ostream& operator<<(ostream& os, const QuicEncryptedPacket& s) { | 840 ostream& operator<<(ostream& os, const QuicEncryptedPacket& s) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 864 transmission_type(transmission_type), | 870 transmission_type(transmission_type), |
| 865 in_flight(false), | 871 in_flight(false), |
| 866 is_unackable(false), | 872 is_unackable(false), |
| 867 is_fec_packet(is_fec_packet), | 873 is_fec_packet(is_fec_packet), |
| 868 all_transmissions(nullptr), | 874 all_transmissions(nullptr), |
| 869 retransmission(0) {} | 875 retransmission(0) {} |
| 870 | 876 |
| 871 TransmissionInfo::~TransmissionInfo() {} | 877 TransmissionInfo::~TransmissionInfo() {} |
| 872 | 878 |
| 873 } // namespace net | 879 } // namespace net |
| OLD | NEW |