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 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "net/base/iovec.h" | 12 #include "net/base/iovec.h" |
13 #include "net/quic/quic_protocol.h" | 13 #include "net/quic/quic_protocol.h" |
14 | 14 |
15 namespace net { | 15 namespace net { |
16 | 16 |
17 namespace test { | 17 namespace test { |
18 class QuicStreamSequencerPeer; | 18 class QuicStreamSequencerPeer; |
19 } // namespace test | 19 } // namespace test |
20 | 20 |
21 class QuicSession; | 21 class QuicSession; |
22 class ReliableQuicStream; | 22 class ReliableQuicStream; |
23 | 23 |
24 // Buffers frames until we have something which can be passed | 24 // Buffers frames until we have something which can be passed |
25 // up to the next layer. | 25 // up to the next layer. |
26 // TOOD(alyssar) add some checks for overflow attempts [1, 256,] [2, 256] | |
27 class NET_EXPORT_PRIVATE QuicStreamSequencer { | 26 class NET_EXPORT_PRIVATE QuicStreamSequencer { |
28 public: | 27 public: |
29 explicit QuicStreamSequencer(ReliableQuicStream* quic_stream); | 28 explicit QuicStreamSequencer(ReliableQuicStream* quic_stream); |
30 virtual ~QuicStreamSequencer(); | 29 virtual ~QuicStreamSequencer(); |
31 | 30 |
32 // If the frame is the next one we need in order to process in-order data, | 31 // If the frame is the next one we need in order to process in-order data, |
33 // ProcessData will be immediately called on the stream until all buffered | 32 // ProcessData will be immediately called on the stream until all buffered |
34 // data is processed or the stream fails to consume data. Any unconsumed | 33 // data is processed or the stream fails to consume data. Any unconsumed |
35 // data will be buffered. If the frame is not the next in line, it will be | 34 // data will be buffered. If the frame is not the next in line, it will be |
36 // buffered. | 35 // buffered. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 121 |
123 // Count of the number of duplicate frames received. | 122 // Count of the number of duplicate frames received. |
124 int num_duplicate_frames_received_; | 123 int num_duplicate_frames_received_; |
125 | 124 |
126 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencer); | 125 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencer); |
127 }; | 126 }; |
128 | 127 |
129 } // namespace net | 128 } // namespace net |
130 | 129 |
131 #endif // NET_QUIC_QUIC_STREAM_SEQUENCER_H_ | 130 #endif // NET_QUIC_QUIC_STREAM_SEQUENCER_H_ |
OLD | NEW |