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> |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 void SetUnblocked(); | 72 void SetUnblocked(); |
73 | 73 |
74 // Blocks processing of frames until |SetUnblocked| is called. | 74 // Blocks processing of frames until |SetUnblocked| is called. |
75 void SetBlockedUntilFlush(); | 75 void SetBlockedUntilFlush(); |
76 | 76 |
77 // Sets the sequencer to discard all incoming data itself and not call | 77 // Sets the sequencer to discard all incoming data itself and not call |
78 // |stream_->OnDataAvailable()|. |stream_->OnFinRead()| will be called | 78 // |stream_->OnDataAvailable()|. |stream_->OnFinRead()| will be called |
79 // automatically when the FIN is consumed (which may be immediately). | 79 // automatically when the FIN is consumed (which may be immediately). |
80 void StopReading(); | 80 void StopReading(); |
81 | 81 |
| 82 // Free the memory of underlying buffer. |
| 83 void ReleaseBuffer(); |
| 84 |
82 // Number of bytes in the buffer right now. | 85 // Number of bytes in the buffer right now. |
83 size_t NumBytesBuffered() const; | 86 size_t NumBytesBuffered() const; |
84 | 87 |
85 // Number of bytes has been consumed. | 88 // Number of bytes has been consumed. |
86 QuicStreamOffset NumBytesConsumed() const; | 89 QuicStreamOffset NumBytesConsumed() const; |
87 | 90 |
88 int num_frames_received() const { return num_frames_received_; } | 91 int num_frames_received() const { return num_frames_received_; } |
89 | 92 |
90 int num_duplicate_frames_received() const { | 93 int num_duplicate_frames_received() const { |
91 return num_duplicate_frames_received_; | 94 return num_duplicate_frames_received_; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 144 |
142 // If true, all incoming data will be discarded. | 145 // If true, all incoming data will be discarded. |
143 bool ignore_read_data_; | 146 bool ignore_read_data_; |
144 | 147 |
145 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencer); | 148 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencer); |
146 }; | 149 }; |
147 | 150 |
148 } // namespace net | 151 } // namespace net |
149 | 152 |
150 #endif // NET_QUIC_QUIC_STREAM_SEQUENCER_H_ | 153 #endif // NET_QUIC_QUIC_STREAM_SEQUENCER_H_ |
OLD | NEW |