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 18 matching lines...) Expand all Loading... |
29 class NET_EXPORT_PRIVATE QuicStreamSequencer { | 29 class NET_EXPORT_PRIVATE QuicStreamSequencer { |
30 public: | 30 public: |
31 explicit QuicStreamSequencer(ReliableQuicStream* quic_stream); | 31 explicit QuicStreamSequencer(ReliableQuicStream* quic_stream); |
32 virtual ~QuicStreamSequencer(); | 32 virtual ~QuicStreamSequencer(); |
33 | 33 |
34 // If the frame is the next one we need in order to process in-order data, | 34 // If the frame is the next one we need in order to process in-order data, |
35 // ProcessData will be immediately called on the stream until all buffered | 35 // ProcessData will be immediately called on the stream until all buffered |
36 // data is processed or the stream fails to consume data. Any unconsumed | 36 // data is processed or the stream fails to consume data. Any unconsumed |
37 // data will be buffered. If the frame is not the next in line, it will be | 37 // data will be buffered. If the frame is not the next in line, it will be |
38 // buffered. | 38 // buffered. |
39 bool OnStreamFrame(const QuicStreamFrame& frame); | 39 void OnStreamFrame(const QuicStreamFrame& frame); |
40 | 40 |
41 // Once data is buffered, it's up to the stream to read it when the stream | 41 // Once data is buffered, it's up to the stream to read it when the stream |
42 // can handle more data. The following three functions make that possible. | 42 // can handle more data. The following three functions make that possible. |
43 | 43 |
44 // Fills in up to iov_len iovecs with the next readable regions. Returns the | 44 // Fills in up to iov_len iovecs with the next readable regions. Returns the |
45 // number of iovs used. Non-destructive of the underlying data. | 45 // number of iovs used. Non-destructive of the underlying data. |
46 int GetReadableRegions(iovec* iov, size_t iov_len); | 46 int GetReadableRegions(iovec* iov, size_t iov_len); |
47 | 47 |
48 // Copies the data into the iov_len buffers provided. Returns the number of | 48 // Copies the data into the iov_len buffers provided. Returns the number of |
49 // bytes read. Any buffered data no longer in use will be released. | 49 // bytes read. Any buffered data no longer in use will be released. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 // Count of the number of duplicate frames received. | 125 // Count of the number of duplicate frames received. |
126 int num_duplicate_frames_received_; | 126 int num_duplicate_frames_received_; |
127 | 127 |
128 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencer); | 128 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencer); |
129 }; | 129 }; |
130 | 130 |
131 } // namespace net | 131 } // namespace net |
132 | 132 |
133 #endif // NET_QUIC_QUIC_STREAM_SEQUENCER_H_ | 133 #endif // NET_QUIC_QUIC_STREAM_SEQUENCER_H_ |
OLD | NEW |