| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "net/quic/quic_frame_list.h" | |
| 15 #include "net/quic/quic_protocol.h" | 14 #include "net/quic/quic_protocol.h" |
| 15 #include "net/quic/stream_sequencer_buffer.h" |
| 16 |
| 17 using std::string; |
| 16 | 18 |
| 17 namespace net { | 19 namespace net { |
| 18 | 20 |
| 19 namespace test { | 21 namespace test { |
| 20 class QuicStreamSequencerPeer; | 22 class QuicStreamSequencerPeer; |
| 21 } // namespace test | 23 } // namespace test |
| 22 | 24 |
| 23 class QuicClock; | 25 class QuicClock; |
| 24 class QuicSession; | 26 class QuicSession; |
| 25 class ReliableQuicStream; | 27 class ReliableQuicStream; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 void CloseStreamAtOffset(QuicStreamOffset offset); | 109 void CloseStreamAtOffset(QuicStreamOffset offset); |
| 108 | 110 |
| 109 // If we've received a FIN and have processed all remaining data, then inform | 111 // If we've received a FIN and have processed all remaining data, then inform |
| 110 // the stream of FIN, and clear buffers. | 112 // the stream of FIN, and clear buffers. |
| 111 bool MaybeCloseStream(); | 113 bool MaybeCloseStream(); |
| 112 | 114 |
| 113 // The stream which owns this sequencer. | 115 // The stream which owns this sequencer. |
| 114 ReliableQuicStream* stream_; | 116 ReliableQuicStream* stream_; |
| 115 | 117 |
| 116 // Stores received data in offset order. | 118 // Stores received data in offset order. |
| 117 scoped_ptr<QuicStreamSequencerBufferInterface> buffered_frames_; | 119 StreamSequencerBuffer buffered_frames_; |
| 118 | 120 |
| 119 // The offset, if any, we got a stream termination for. When this many bytes | 121 // The offset, if any, we got a stream termination for. When this many bytes |
| 120 // have been processed, the sequencer will be closed. | 122 // have been processed, the sequencer will be closed. |
| 121 QuicStreamOffset close_offset_; | 123 QuicStreamOffset close_offset_; |
| 122 | 124 |
| 123 // If true, the sequencer is blocked from passing data to the stream and will | 125 // If true, the sequencer is blocked from passing data to the stream and will |
| 124 // buffer all new incoming data until FlushBufferedFrames is called. | 126 // buffer all new incoming data until FlushBufferedFrames is called. |
| 125 bool blocked_; | 127 bool blocked_; |
| 126 | 128 |
| 127 // Count of the number of frames received. | 129 // Count of the number of frames received. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 139 | 141 |
| 140 // If true, all incoming data will be discarded. | 142 // If true, all incoming data will be discarded. |
| 141 bool ignore_read_data_; | 143 bool ignore_read_data_; |
| 142 | 144 |
| 143 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencer); | 145 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencer); |
| 144 }; | 146 }; |
| 145 | 147 |
| 146 } // namespace net | 148 } // namespace net |
| 147 | 149 |
| 148 #endif // NET_QUIC_QUIC_STREAM_SEQUENCER_H_ | 150 #endif // NET_QUIC_QUIC_STREAM_SEQUENCER_H_ |
| OLD | NEW |