| 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 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 packet_number(packet_number), | 746 packet_number(packet_number), |
| 747 packet_number_length(packet_number_length), | 747 packet_number_length(packet_number_length), |
| 748 encryption_level(ENCRYPTION_NONE), | 748 encryption_level(ENCRYPTION_NONE), |
| 749 entropy_hash(entropy_hash), | 749 entropy_hash(entropy_hash), |
| 750 is_fec_packet(false), | 750 is_fec_packet(false), |
| 751 has_ack(has_ack), | 751 has_ack(has_ack), |
| 752 has_stop_waiting(has_stop_waiting), | 752 has_stop_waiting(has_stop_waiting), |
| 753 original_packet_number(0), | 753 original_packet_number(0), |
| 754 transmission_type(NOT_RETRANSMISSION) {} | 754 transmission_type(NOT_RETRANSMISSION) {} |
| 755 | 755 |
| 756 SerializedPacket::SerializedPacket(QuicPathId path_id, | |
| 757 QuicPacketNumber packet_number, | |
| 758 QuicPacketNumberLength packet_number_length, | |
| 759 char* encrypted_buffer, | |
| 760 size_t encrypted_length, | |
| 761 bool owns_buffer, | |
| 762 QuicPacketEntropyHash entropy_hash, | |
| 763 QuicFrames* retransmittable_frames, | |
| 764 bool padding, | |
| 765 IsHandshake is_handshake, | |
| 766 bool has_ack, | |
| 767 bool has_stop_waiting, | |
| 768 EncryptionLevel level) | |
| 769 : SerializedPacket(path_id, | |
| 770 packet_number, | |
| 771 packet_number_length, | |
| 772 new QuicEncryptedPacket(encrypted_buffer, | |
| 773 encrypted_length, | |
| 774 owns_buffer), | |
| 775 entropy_hash, | |
| 776 retransmittable_frames, | |
| 777 has_ack, | |
| 778 has_stop_waiting) { | |
| 779 // TODO(ianswett): Move into the initializer list once SerializedPacket | |
| 780 // no longer contains an encrypted packet. | |
| 781 encryption_level = level; | |
| 782 needs_padding = padding; | |
| 783 has_crypto_handshake = is_handshake; | |
| 784 } | |
| 785 | |
| 786 SerializedPacket::~SerializedPacket() {} | 756 SerializedPacket::~SerializedPacket() {} |
| 787 | 757 |
| 788 QuicEncryptedPacket* QuicEncryptedPacket::Clone() const { | 758 QuicEncryptedPacket* QuicEncryptedPacket::Clone() const { |
| 789 char* buffer = new char[this->length()]; | 759 char* buffer = new char[this->length()]; |
| 790 memcpy(buffer, this->data(), this->length()); | 760 memcpy(buffer, this->data(), this->length()); |
| 791 return new QuicEncryptedPacket(buffer, this->length(), true); | 761 return new QuicEncryptedPacket(buffer, this->length(), true); |
| 792 } | 762 } |
| 793 | 763 |
| 794 ostream& operator<<(ostream& os, const QuicEncryptedPacket& s) { | 764 ostream& operator<<(ostream& os, const QuicEncryptedPacket& s) { |
| 795 os << s.length() << "-byte data"; | 765 os << s.length() << "-byte data"; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 in_flight(false), | 797 in_flight(false), |
| 828 is_unackable(false), | 798 is_unackable(false), |
| 829 is_fec_packet(is_fec_packet), | 799 is_fec_packet(is_fec_packet), |
| 830 has_crypto_handshake(has_crypto_handshake), | 800 has_crypto_handshake(has_crypto_handshake), |
| 831 needs_padding(needs_padding), | 801 needs_padding(needs_padding), |
| 832 retransmission(0) {} | 802 retransmission(0) {} |
| 833 | 803 |
| 834 TransmissionInfo::~TransmissionInfo() {} | 804 TransmissionInfo::~TransmissionInfo() {} |
| 835 | 805 |
| 836 } // namespace net | 806 } // namespace net |
| OLD | NEW |