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 <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 UNKNOWN, | 1083 UNKNOWN, |
1084 // All other peer address change types. | 1084 // All other peer address change types. |
1085 UNSPECIFIED, | 1085 UNSPECIFIED, |
1086 }; | 1086 }; |
1087 | 1087 |
1088 struct NET_EXPORT_PRIVATE QuicFrame { | 1088 struct NET_EXPORT_PRIVATE QuicFrame { |
1089 QuicFrame(); | 1089 QuicFrame(); |
1090 explicit QuicFrame(QuicPaddingFrame padding_frame); | 1090 explicit QuicFrame(QuicPaddingFrame padding_frame); |
1091 explicit QuicFrame(QuicMtuDiscoveryFrame frame); | 1091 explicit QuicFrame(QuicMtuDiscoveryFrame frame); |
1092 explicit QuicFrame(QuicPingFrame frame); | 1092 explicit QuicFrame(QuicPingFrame frame); |
| 1093 explicit QuicFrame(QuicBlockedFrame frame); |
1093 | 1094 |
1094 explicit QuicFrame(QuicStreamFrame* stream_frame); | 1095 explicit QuicFrame(QuicStreamFrame* stream_frame); |
1095 explicit QuicFrame(QuicAckFrame* frame); | 1096 explicit QuicFrame(QuicAckFrame* frame); |
1096 explicit QuicFrame(QuicRstStreamFrame* frame); | 1097 explicit QuicFrame(QuicRstStreamFrame* frame); |
1097 explicit QuicFrame(QuicConnectionCloseFrame* frame); | 1098 explicit QuicFrame(QuicConnectionCloseFrame* frame); |
1098 explicit QuicFrame(QuicStopWaitingFrame* frame); | 1099 explicit QuicFrame(QuicStopWaitingFrame* frame); |
1099 explicit QuicFrame(QuicGoAwayFrame* frame); | 1100 explicit QuicFrame(QuicGoAwayFrame* frame); |
1100 explicit QuicFrame(QuicWindowUpdateFrame* frame); | 1101 explicit QuicFrame(QuicWindowUpdateFrame* frame); |
1101 explicit QuicFrame(QuicBlockedFrame* frame); | |
1102 | 1102 |
1103 NET_EXPORT_PRIVATE friend std::ostream& operator<<(std::ostream& os, | 1103 NET_EXPORT_PRIVATE friend std::ostream& operator<<(std::ostream& os, |
1104 const QuicFrame& frame); | 1104 const QuicFrame& frame); |
1105 | 1105 |
1106 QuicFrameType type; | 1106 QuicFrameType type; |
1107 union { | 1107 union { |
1108 // Frames smaller than a pointer are inline. | 1108 // Frames smaller than a pointer are inline. |
1109 QuicPaddingFrame padding_frame; | 1109 QuicPaddingFrame padding_frame; |
1110 QuicMtuDiscoveryFrame mtu_discovery_frame; | 1110 QuicMtuDiscoveryFrame mtu_discovery_frame; |
1111 QuicPingFrame ping_frame; | 1111 QuicPingFrame ping_frame; |
| 1112 QuicBlockedFrame blocked_frame; |
1112 | 1113 |
1113 // Frames larger than a pointer. | 1114 // Frames larger than a pointer. |
1114 QuicStreamFrame* stream_frame; | 1115 QuicStreamFrame* stream_frame; |
1115 QuicAckFrame* ack_frame; | 1116 QuicAckFrame* ack_frame; |
1116 QuicStopWaitingFrame* stop_waiting_frame; | 1117 QuicStopWaitingFrame* stop_waiting_frame; |
1117 QuicRstStreamFrame* rst_stream_frame; | 1118 QuicRstStreamFrame* rst_stream_frame; |
1118 QuicConnectionCloseFrame* connection_close_frame; | 1119 QuicConnectionCloseFrame* connection_close_frame; |
1119 QuicGoAwayFrame* goaway_frame; | 1120 QuicGoAwayFrame* goaway_frame; |
1120 QuicWindowUpdateFrame* window_update_frame; | 1121 QuicWindowUpdateFrame* window_update_frame; |
1121 QuicBlockedFrame* blocked_frame; | |
1122 }; | 1122 }; |
1123 }; | 1123 }; |
1124 // QuicFrameType consumes 8 bytes with padding. | 1124 // QuicFrameType consumes 8 bytes with padding. |
1125 static_assert(sizeof(QuicFrame) <= 16, | 1125 static_assert(sizeof(QuicFrame) <= 16, |
1126 "Frames larger than 8 bytes should be referenced by pointer."); | 1126 "Frames larger than 8 bytes should be referenced by pointer."); |
1127 | 1127 |
1128 typedef std::vector<QuicFrame> QuicFrames; | 1128 typedef std::vector<QuicFrame> QuicFrames; |
1129 | 1129 |
1130 class NET_EXPORT_PRIVATE QuicData { | 1130 class NET_EXPORT_PRIVATE QuicData { |
1131 public: | 1131 public: |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 : iov(iov), iov_count(iov_count), total_length(total_length) {} | 1317 : iov(iov), iov_count(iov_count), total_length(total_length) {} |
1318 | 1318 |
1319 const struct iovec* iov; | 1319 const struct iovec* iov; |
1320 const int iov_count; | 1320 const int iov_count; |
1321 const size_t total_length; | 1321 const size_t total_length; |
1322 }; | 1322 }; |
1323 | 1323 |
1324 } // namespace net | 1324 } // namespace net |
1325 | 1325 |
1326 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1326 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |