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_STREAM_SEQUENCER_H_ | 5 #ifndef NET_QUIC_QUIC_STREAM_SEQUENCER_H_ |
6 #define NET_QUIC_QUIC_STREAM_SEQUENCER_H_ | 6 #define NET_QUIC_QUIC_STREAM_SEQUENCER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // The stream which owns this sequencer. | 91 // The stream which owns this sequencer. |
92 ReliableQuicStream* stream_; | 92 ReliableQuicStream* stream_; |
93 | 93 |
94 // The last data consumed by the stream. | 94 // The last data consumed by the stream. |
95 QuicStreamOffset num_bytes_consumed_; | 95 QuicStreamOffset num_bytes_consumed_; |
96 | 96 |
97 // TODO(alyssar) use something better than strings. | 97 // TODO(alyssar) use something better than strings. |
98 typedef map<QuicStreamOffset, string> FrameMap; | 98 typedef map<QuicStreamOffset, string> FrameMap; |
99 | 99 |
100 // Stores buffered frames (maps from sequence number -> frame data as string). | 100 // Stores buffered frames (maps from sequence number -> frame data as string). |
101 FrameMap frames_; | 101 FrameMap buffered_frames_; |
102 | 102 |
103 // The offset, if any, we got a stream termination for. When this many bytes | 103 // The offset, if any, we got a stream termination for. When this many bytes |
104 // have been processed, the sequencer will be closed. | 104 // have been processed, the sequencer will be closed. |
105 QuicStreamOffset close_offset_; | 105 QuicStreamOffset close_offset_; |
106 | 106 |
107 // If true, the sequencer is blocked from passing data to the stream and will | 107 // If true, the sequencer is blocked from passing data to the stream and will |
108 // buffer all new incoming data until FlushBufferedFrames is called. | 108 // buffer all new incoming data until FlushBufferedFrames is called. |
109 bool blocked_; | 109 bool blocked_; |
110 | 110 |
111 // Tracks how many bytes the sequencer has buffered. | 111 // Tracks how many bytes the sequencer has buffered. |
112 size_t num_bytes_buffered_; | 112 size_t num_bytes_buffered_; |
113 | 113 |
114 // Count of the number of frames received. | 114 // Count of the number of frames received. |
115 int num_frames_received_; | 115 int num_frames_received_; |
116 | 116 |
117 // Count of the number of duplicate frames received. | 117 // Count of the number of duplicate frames received. |
118 int num_duplicate_frames_received_; | 118 int num_duplicate_frames_received_; |
119 | 119 |
120 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencer); | 120 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencer); |
121 }; | 121 }; |
122 | 122 |
123 } // namespace net | 123 } // namespace net |
124 | 124 |
125 #endif // NET_QUIC_QUIC_STREAM_SEQUENCER_H_ | 125 #endif // NET_QUIC_QUIC_STREAM_SEQUENCER_H_ |
OLD | NEW |