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_protocol.h" | 5 #include "net/quic/core/quic_protocol.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "net/quic/core/quic_flags.h" | 9 #include "net/quic/core/quic_flags.h" |
10 #include "net/quic/core/quic_utils.h" | 10 #include "net/quic/core/quic_utils.h" |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 } | 706 } |
707 | 707 |
708 ostream& operator<<(ostream& os, const QuicEncryptedPacket& s) { | 708 ostream& operator<<(ostream& os, const QuicEncryptedPacket& s) { |
709 os << s.length() << "-byte data"; | 709 os << s.length() << "-byte data"; |
710 return os; | 710 return os; |
711 } | 711 } |
712 | 712 |
713 QuicReceivedPacket::QuicReceivedPacket(const char* buffer, | 713 QuicReceivedPacket::QuicReceivedPacket(const char* buffer, |
714 size_t length, | 714 size_t length, |
715 QuicTime receipt_time) | 715 QuicTime receipt_time) |
716 : QuicReceivedPacket(buffer, | 716 : QuicEncryptedPacket(buffer, length), |
717 length, | 717 receipt_time_(receipt_time), |
718 receipt_time, | 718 ttl_(0) {} |
719 false /* owns_buffer */) {} | |
720 | 719 |
721 QuicReceivedPacket::QuicReceivedPacket(const char* buffer, | 720 QuicReceivedPacket::QuicReceivedPacket(const char* buffer, |
722 size_t length, | 721 size_t length, |
723 QuicTime receipt_time, | 722 QuicTime receipt_time, |
724 bool owns_buffer) | 723 bool owns_buffer) |
725 : QuicReceivedPacket(buffer, | 724 : QuicEncryptedPacket(buffer, length, owns_buffer), |
726 length, | 725 receipt_time_(receipt_time), |
727 receipt_time, | 726 ttl_(0) {} |
728 owns_buffer, | |
729 false /* potentially_small_mtu */, | |
730 -1 /* ttl */, | |
731 false /* ttl_valid */) {} | |
732 | 727 |
733 QuicReceivedPacket::QuicReceivedPacket(const char* buffer, | 728 QuicReceivedPacket::QuicReceivedPacket(const char* buffer, |
734 size_t length, | 729 size_t length, |
735 QuicTime receipt_time, | 730 QuicTime receipt_time, |
736 bool owns_buffer, | 731 bool owns_buffer, |
737 bool potentially_small_mtu, | |
738 int ttl, | 732 int ttl, |
739 bool ttl_valid) | 733 bool ttl_valid) |
740 : QuicEncryptedPacket(buffer, length, owns_buffer), | 734 : QuicEncryptedPacket(buffer, length, owns_buffer), |
741 receipt_time_(receipt_time), | 735 receipt_time_(receipt_time), |
742 ttl_(ttl_valid ? ttl : -1), | 736 ttl_(ttl_valid ? ttl : -1) {} |
743 potentially_small_mtu_(potentially_small_mtu) {} | |
744 | 737 |
745 QuicReceivedPacket* QuicReceivedPacket::Clone() const { | 738 QuicReceivedPacket* QuicReceivedPacket::Clone() const { |
746 char* buffer = new char[this->length()]; | 739 char* buffer = new char[this->length()]; |
747 memcpy(buffer, this->data(), this->length()); | 740 memcpy(buffer, this->data(), this->length()); |
748 return new QuicReceivedPacket(buffer, this->length(), receipt_time(), true, | 741 return new QuicReceivedPacket(buffer, this->length(), receipt_time(), true, |
749 potentially_small_mtu(), ttl(), ttl() >= 0); | 742 ttl(), ttl() >= 0); |
750 } | 743 } |
751 | 744 |
752 ostream& operator<<(ostream& os, const QuicReceivedPacket& s) { | 745 ostream& operator<<(ostream& os, const QuicReceivedPacket& s) { |
753 os << s.length() << "-byte data"; | 746 os << s.length() << "-byte data"; |
754 return os; | 747 return os; |
755 } | 748 } |
756 | 749 |
757 StringPiece QuicPacket::AssociatedData(QuicVersion version) const { | 750 StringPiece QuicPacket::AssociatedData(QuicVersion version) const { |
758 return StringPiece( | 751 return StringPiece( |
759 data(), GetStartOfEncryptedData(version, connection_id_length_, | 752 data(), GetStartOfEncryptedData(version, connection_id_length_, |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 is_unackable(false), | 852 is_unackable(false), |
860 has_crypto_handshake(has_crypto_handshake), | 853 has_crypto_handshake(has_crypto_handshake), |
861 num_padding_bytes(num_padding_bytes), | 854 num_padding_bytes(num_padding_bytes), |
862 retransmission(0) {} | 855 retransmission(0) {} |
863 | 856 |
864 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default; | 857 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default; |
865 | 858 |
866 TransmissionInfo::~TransmissionInfo() {} | 859 TransmissionInfo::~TransmissionInfo() {} |
867 | 860 |
868 } // namespace net | 861 } // namespace net |
OLD | NEW |