| 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 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ | 5 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ |
| 6 #define NET_QUIC_QUIC_PROTOCOL_H_ | 6 #define NET_QUIC_QUIC_PROTOCOL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 private: | 913 private: |
| 914 const char* buffer_; | 914 const char* buffer_; |
| 915 size_t length_; | 915 size_t length_; |
| 916 bool owns_buffer_; | 916 bool owns_buffer_; |
| 917 | 917 |
| 918 DISALLOW_COPY_AND_ASSIGN(QuicData); | 918 DISALLOW_COPY_AND_ASSIGN(QuicData); |
| 919 }; | 919 }; |
| 920 | 920 |
| 921 class NET_EXPORT_PRIVATE QuicPacket : public QuicData { | 921 class NET_EXPORT_PRIVATE QuicPacket : public QuicData { |
| 922 public: | 922 public: |
| 923 static QuicPacket* NewDataPacket( | 923 QuicPacket(char* buffer, |
| 924 char* buffer, | 924 size_t length, |
| 925 size_t length, | 925 bool owns_buffer, |
| 926 bool owns_buffer, | 926 QuicConnectionIdLength connection_id_length, |
| 927 QuicConnectionIdLength connection_id_length, | 927 bool includes_version, |
| 928 bool includes_version, | 928 QuicSequenceNumberLength sequence_number_length); |
| 929 QuicSequenceNumberLength sequence_number_length) { | |
| 930 return new QuicPacket(buffer, length, owns_buffer, connection_id_length, | |
| 931 includes_version, sequence_number_length, false); | |
| 932 } | |
| 933 | |
| 934 static QuicPacket* NewFecPacket( | |
| 935 char* buffer, | |
| 936 size_t length, | |
| 937 bool owns_buffer, | |
| 938 QuicConnectionIdLength connection_id_length, | |
| 939 bool includes_version, | |
| 940 QuicSequenceNumberLength sequence_number_length) { | |
| 941 return new QuicPacket(buffer, length, owns_buffer, connection_id_length, | |
| 942 includes_version, sequence_number_length, true); | |
| 943 } | |
| 944 | 929 |
| 945 base::StringPiece FecProtectedData() const; | 930 base::StringPiece FecProtectedData() const; |
| 946 base::StringPiece AssociatedData() const; | 931 base::StringPiece AssociatedData() const; |
| 947 base::StringPiece BeforePlaintext() const; | 932 base::StringPiece BeforePlaintext() const; |
| 948 base::StringPiece Plaintext() const; | 933 base::StringPiece Plaintext() const; |
| 949 | 934 |
| 950 bool is_fec_packet() const { return is_fec_packet_; } | |
| 951 | |
| 952 char* mutable_data() { return buffer_; } | 935 char* mutable_data() { return buffer_; } |
| 953 | 936 |
| 954 private: | 937 private: |
| 955 QuicPacket(char* buffer, | |
| 956 size_t length, | |
| 957 bool owns_buffer, | |
| 958 QuicConnectionIdLength connection_id_length, | |
| 959 bool includes_version, | |
| 960 QuicSequenceNumberLength sequence_number_length, | |
| 961 bool is_fec_packet); | |
| 962 | |
| 963 char* buffer_; | 938 char* buffer_; |
| 964 const bool is_fec_packet_; | |
| 965 const QuicConnectionIdLength connection_id_length_; | 939 const QuicConnectionIdLength connection_id_length_; |
| 966 const bool includes_version_; | 940 const bool includes_version_; |
| 967 const QuicSequenceNumberLength sequence_number_length_; | 941 const QuicSequenceNumberLength sequence_number_length_; |
| 968 | 942 |
| 969 DISALLOW_COPY_AND_ASSIGN(QuicPacket); | 943 DISALLOW_COPY_AND_ASSIGN(QuicPacket); |
| 970 }; | 944 }; |
| 971 | 945 |
| 972 class NET_EXPORT_PRIVATE QuicEncryptedPacket : public QuicData { | 946 class NET_EXPORT_PRIVATE QuicEncryptedPacket : public QuicData { |
| 973 public: | 947 public: |
| 974 QuicEncryptedPacket(const char* buffer, size_t length); | 948 QuicEncryptedPacket(const char* buffer, size_t length); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1026 QuicPacket* packet, | 1000 QuicPacket* packet, |
| 1027 QuicPacketEntropyHash entropy_hash, | 1001 QuicPacketEntropyHash entropy_hash, |
| 1028 RetransmittableFrames* retransmittable_frames); | 1002 RetransmittableFrames* retransmittable_frames); |
| 1029 ~SerializedPacket(); | 1003 ~SerializedPacket(); |
| 1030 | 1004 |
| 1031 QuicPacketSequenceNumber sequence_number; | 1005 QuicPacketSequenceNumber sequence_number; |
| 1032 QuicSequenceNumberLength sequence_number_length; | 1006 QuicSequenceNumberLength sequence_number_length; |
| 1033 QuicPacket* packet; | 1007 QuicPacket* packet; |
| 1034 QuicPacketEntropyHash entropy_hash; | 1008 QuicPacketEntropyHash entropy_hash; |
| 1035 RetransmittableFrames* retransmittable_frames; | 1009 RetransmittableFrames* retransmittable_frames; |
| 1010 bool is_fec_packet; |
| 1036 | 1011 |
| 1037 // Optional notifiers which will be informed when this packet has been ACKed. | 1012 // Optional notifiers which will be informed when this packet has been ACKed. |
| 1038 std::list<QuicAckNotifier*> notifiers; | 1013 std::list<QuicAckNotifier*> notifiers; |
| 1039 }; | 1014 }; |
| 1040 | 1015 |
| 1041 struct NET_EXPORT_PRIVATE TransmissionInfo { | 1016 struct NET_EXPORT_PRIVATE TransmissionInfo { |
| 1042 // Used by STL when assigning into a map. | 1017 // Used by STL when assigning into a map. |
| 1043 TransmissionInfo(); | 1018 TransmissionInfo(); |
| 1044 | 1019 |
| 1045 // Constructs a Transmission with a new all_tranmissions set | 1020 // Constructs a Transmission with a new all_tranmissions set |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1065 bool in_flight; | 1040 bool in_flight; |
| 1066 // True if the packet can never be acked, so it can be removed. | 1041 // True if the packet can never be acked, so it can be removed. |
| 1067 bool is_unackable; | 1042 bool is_unackable; |
| 1068 // True if the packet is an FEC packet. | 1043 // True if the packet is an FEC packet. |
| 1069 bool is_fec_packet; | 1044 bool is_fec_packet; |
| 1070 }; | 1045 }; |
| 1071 | 1046 |
| 1072 } // namespace net | 1047 } // namespace net |
| 1073 | 1048 |
| 1074 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1049 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
| OLD | NEW |