| 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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 DCHECK(listener != nullptr); | 728 DCHECK(listener != nullptr); |
| 729 } | 729 } |
| 730 | 730 |
| 731 AckListenerWrapper::~AckListenerWrapper() {} | 731 AckListenerWrapper::~AckListenerWrapper() {} |
| 732 | 732 |
| 733 SerializedPacket::SerializedPacket(QuicPathId path_id, | 733 SerializedPacket::SerializedPacket(QuicPathId path_id, |
| 734 QuicPacketNumber packet_number, | 734 QuicPacketNumber packet_number, |
| 735 QuicPacketNumberLength packet_number_length, | 735 QuicPacketNumberLength packet_number_length, |
| 736 QuicEncryptedPacket* packet, | 736 QuicEncryptedPacket* packet, |
| 737 QuicPacketEntropyHash entropy_hash, | 737 QuicPacketEntropyHash entropy_hash, |
| 738 QuicFrames* retransmittable_frames, | |
| 739 bool has_ack, | 738 bool has_ack, |
| 740 bool has_stop_waiting) | 739 bool has_stop_waiting) |
| 741 : packet(packet), | 740 : packet(packet), |
| 742 retransmittable_frames(retransmittable_frames), | |
| 743 has_crypto_handshake(NOT_HANDSHAKE), | 741 has_crypto_handshake(NOT_HANDSHAKE), |
| 744 needs_padding(false), | 742 needs_padding(false), |
| 745 path_id(path_id), | 743 path_id(path_id), |
| 746 packet_number(packet_number), | 744 packet_number(packet_number), |
| 747 packet_number_length(packet_number_length), | 745 packet_number_length(packet_number_length), |
| 748 encryption_level(ENCRYPTION_NONE), | 746 encryption_level(ENCRYPTION_NONE), |
| 749 entropy_hash(entropy_hash), | 747 entropy_hash(entropy_hash), |
| 750 is_fec_packet(false), | 748 is_fec_packet(false), |
| 751 has_ack(has_ack), | 749 has_ack(has_ack), |
| 752 has_stop_waiting(has_stop_waiting), | 750 has_stop_waiting(has_stop_waiting), |
| 753 original_packet_number(0), | 751 original_packet_number(0), |
| 754 transmission_type(NOT_RETRANSMISSION) {} | 752 transmission_type(NOT_RETRANSMISSION) {} |
| 755 | 753 |
| 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() {} | 754 SerializedPacket::~SerializedPacket() {} |
| 787 | 755 |
| 788 QuicEncryptedPacket* QuicEncryptedPacket::Clone() const { | 756 QuicEncryptedPacket* QuicEncryptedPacket::Clone() const { |
| 789 char* buffer = new char[this->length()]; | 757 char* buffer = new char[this->length()]; |
| 790 memcpy(buffer, this->data(), this->length()); | 758 memcpy(buffer, this->data(), this->length()); |
| 791 return new QuicEncryptedPacket(buffer, this->length(), true); | 759 return new QuicEncryptedPacket(buffer, this->length(), true); |
| 792 } | 760 } |
| 793 | 761 |
| 794 ostream& operator<<(ostream& os, const QuicEncryptedPacket& s) { | 762 ostream& operator<<(ostream& os, const QuicEncryptedPacket& s) { |
| 795 os << s.length() << "-byte data"; | 763 os << s.length() << "-byte data"; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 in_flight(false), | 795 in_flight(false), |
| 828 is_unackable(false), | 796 is_unackable(false), |
| 829 is_fec_packet(is_fec_packet), | 797 is_fec_packet(is_fec_packet), |
| 830 has_crypto_handshake(has_crypto_handshake), | 798 has_crypto_handshake(has_crypto_handshake), |
| 831 needs_padding(needs_padding), | 799 needs_padding(needs_padding), |
| 832 retransmission(0) {} | 800 retransmission(0) {} |
| 833 | 801 |
| 834 TransmissionInfo::~TransmissionInfo() {} | 802 TransmissionInfo::~TransmissionInfo() {} |
| 835 | 803 |
| 836 } // namespace net | 804 } // namespace net |
| OLD | NEW |