| 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 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 size_t num_bytes_buffered() const { return num_bytes_buffered_; } | 69 size_t num_bytes_buffered() const { return num_bytes_buffered_; } |
| 70 QuicStreamOffset num_bytes_consumed() const { return num_bytes_consumed_; } | 70 QuicStreamOffset num_bytes_consumed() const { return num_bytes_consumed_; } |
| 71 | 71 |
| 72 int num_frames_received() const { return num_frames_received_; } | 72 int num_frames_received() const { return num_frames_received_; } |
| 73 | 73 |
| 74 int num_duplicate_frames_received() const { | 74 int num_duplicate_frames_received() const { |
| 75 return num_duplicate_frames_received_; | 75 return num_duplicate_frames_received_; |
| 76 } | 76 } |
| 77 | 77 |
| 78 int num_early_frames_received() const { return num_early_frames_received_; } |
| 79 |
| 78 private: | 80 private: |
| 79 friend class test::QuicStreamSequencerPeer; | 81 friend class test::QuicStreamSequencerPeer; |
| 80 | 82 |
| 81 // Wait until we've seen 'offset' bytes, and then terminate the stream. | 83 // Wait until we've seen 'offset' bytes, and then terminate the stream. |
| 82 void CloseStreamAtOffset(QuicStreamOffset offset); | 84 void CloseStreamAtOffset(QuicStreamOffset offset); |
| 83 | 85 |
| 84 // If we've received a FIN and have processed all remaining data, then inform | 86 // If we've received a FIN and have processed all remaining data, then inform |
| 85 // the stream of FIN, and clear buffers. | 87 // the stream of FIN, and clear buffers. |
| 86 bool MaybeCloseStream(); | 88 bool MaybeCloseStream(); |
| 87 | 89 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 115 | 117 |
| 116 // Tracks how many bytes the sequencer has buffered. | 118 // Tracks how many bytes the sequencer has buffered. |
| 117 size_t num_bytes_buffered_; | 119 size_t num_bytes_buffered_; |
| 118 | 120 |
| 119 // Count of the number of frames received. | 121 // Count of the number of frames received. |
| 120 int num_frames_received_; | 122 int num_frames_received_; |
| 121 | 123 |
| 122 // Count of the number of duplicate frames received. | 124 // Count of the number of duplicate frames received. |
| 123 int num_duplicate_frames_received_; | 125 int num_duplicate_frames_received_; |
| 124 | 126 |
| 127 // Count of the number of frames received before all previous frames were |
| 128 // received. |
| 129 int num_early_frames_received_; |
| 130 |
| 125 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencer); | 131 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencer); |
| 126 }; | 132 }; |
| 127 | 133 |
| 128 } // namespace net | 134 } // namespace net |
| 129 | 135 |
| 130 #endif // NET_QUIC_QUIC_STREAM_SEQUENCER_H_ | 136 #endif // NET_QUIC_QUIC_STREAM_SEQUENCER_H_ |
| OLD | NEW |