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 class NET_EXPORT_PRIVATE QuicStreamSequencer { | 26 class NET_EXPORT_PRIVATE QuicStreamSequencer { |
27 public: | 27 public: |
28 // A contiguous segment received by a QUIC stream. | 28 // A contiguous segment received by a QUIC stream. |
29 struct FrameData { | 29 struct FrameData { |
30 FrameData(QuicStreamOffset offset, std::string segment); | 30 FrameData(QuicStreamOffset offset, const std::string& segment); |
31 | 31 |
32 const QuicStreamOffset offset; | 32 const QuicStreamOffset offset; |
33 std::string segment; | 33 std::string segment; |
34 }; | 34 }; |
35 | 35 |
36 // TODO(alyssar) use something better than strings. | 36 // TODO(alyssar) use something better than strings. |
37 // Maybe write new frames into a ring buffer, and keep track of consumed | 37 // Maybe write new frames into a ring buffer, and keep track of consumed |
38 // bytes, and gaps. | 38 // bytes, and gaps. |
39 typedef std::list<FrameData> FrameList; | 39 typedef std::list<FrameData> FrameList; |
40 | 40 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // Count of the number of frames received before all previous frames were | 147 // Count of the number of frames received before all previous frames were |
148 // received. | 148 // received. |
149 int num_early_frames_received_; | 149 int num_early_frames_received_; |
150 | 150 |
151 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencer); | 151 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencer); |
152 }; | 152 }; |
153 | 153 |
154 } // namespace net | 154 } // namespace net |
155 | 155 |
156 #endif // NET_QUIC_QUIC_STREAM_SEQUENCER_H_ | 156 #endif // NET_QUIC_QUIC_STREAM_SEQUENCER_H_ |
OLD | NEW |