OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_CORE_FRAMES_QUIC_WINDOW_UPDATE_FRAME_H_ | 5 #ifndef NET_QUIC_CORE_FRAMES_QUIC_WINDOW_UPDATE_FRAME_H_ |
6 #define NET_QUIC_CORE_FRAMES_QUIC_WINDOW_UPDATE_FRAME_H_ | 6 #define NET_QUIC_CORE_FRAMES_QUIC_WINDOW_UPDATE_FRAME_H_ |
7 | 7 |
8 #include <ostream> | 8 #include <ostream> |
9 | 9 |
10 #include "net/quic/core/quic_types.h" | 10 #include "net/quic/core/quic_types.h" |
11 #include "net/quic/platform/api/quic_export.h" | 11 #include "net/quic/platform/api/quic_export.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 // Flow control updates per-stream and at the connection levoel. | 15 // Flow control updates per-stream and at the connection level. |
16 // Based on SPDY's WINDOW_UPDATE frame, but uses an absolute byte offset rather | 16 // Based on SPDY's WINDOW_UPDATE frame, but uses an absolute byte offset rather |
17 // than a window delta. | 17 // than a window delta. |
18 // TODO(rjshade): A possible future optimization is to make stream_id and | 18 // TODO(rjshade): A possible future optimization is to make stream_id and |
19 // byte_offset variable length, similar to stream frames. | 19 // byte_offset variable length, similar to stream frames. |
20 struct QUIC_EXPORT_PRIVATE QuicWindowUpdateFrame { | 20 struct QUIC_EXPORT_PRIVATE QuicWindowUpdateFrame { |
21 QuicWindowUpdateFrame() {} | 21 QuicWindowUpdateFrame() {} |
22 QuicWindowUpdateFrame(QuicStreamId stream_id, QuicStreamOffset byte_offset); | 22 QuicWindowUpdateFrame(QuicStreamId stream_id, QuicStreamOffset byte_offset); |
23 | 23 |
24 friend QUIC_EXPORT_PRIVATE std::ostream& operator<<( | 24 friend QUIC_EXPORT_PRIVATE std::ostream& operator<<( |
25 std::ostream& os, | 25 std::ostream& os, |
26 const QuicWindowUpdateFrame& w); | 26 const QuicWindowUpdateFrame& w); |
27 | 27 |
28 // The stream this frame applies to. 0 is a special case meaning the overall | 28 // The stream this frame applies to. 0 is a special case meaning the overall |
29 // connection rather than a specific stream. | 29 // connection rather than a specific stream. |
30 QuicStreamId stream_id; | 30 QuicStreamId stream_id; |
31 | 31 |
32 // Byte offset in the stream or connection. The receiver of this frame must | 32 // Byte offset in the stream or connection. The receiver of this frame must |
33 // not send data which would result in this offset being exceeded. | 33 // not send data which would result in this offset being exceeded. |
34 QuicStreamOffset byte_offset; | 34 QuicStreamOffset byte_offset; |
35 }; | 35 }; |
36 | 36 |
37 } // namespace net | 37 } // namespace net |
38 | 38 |
39 #endif // NET_QUIC_CORE_FRAMES_QUIC_WINDOW_UPDATE_FRAME_H_ | 39 #endif // NET_QUIC_CORE_FRAMES_QUIC_WINDOW_UPDATE_FRAME_H_ |
OLD | NEW |