OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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_BUFFER_H_ | 5 #ifndef NET_QUIC_QUIC_STREAM_SEQUENCER_BUFFER_H_ |
6 #define NET_QUIC_QUIC_STREAM_SEQUENCER_BUFFER_H_ | 6 #define NET_QUIC_QUIC_STREAM_SEQUENCER_BUFFER_H_ |
7 | 7 |
8 // QuicStreamSequencerBuffer implements QuicStreamSequencerBufferInterface. | 8 // QuicStreamSequencerBuffer implements QuicStreamSequencerBufferInterface. |
9 // It is a circular stream buffer with random write and | 9 // It is a circular stream buffer with random write and |
10 // in-sequence read. It consists of a vector of pointers pointing | 10 // in-sequence read. It consists of a vector of pointers pointing |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 // such that the number of blocks never exceeds blocks_count_. | 241 // such that the number of blocks never exceeds blocks_count_. |
242 // Each list entry can hold up to kBlockSizeBytes bytes. | 242 // Each list entry can hold up to kBlockSizeBytes bytes. |
243 std::unique_ptr<BufferBlock* []> blocks_; | 243 std::unique_ptr<BufferBlock* []> blocks_; |
244 | 244 |
245 // Number of bytes in buffer. | 245 // Number of bytes in buffer. |
246 size_t num_bytes_buffered_; | 246 size_t num_bytes_buffered_; |
247 | 247 |
248 // Stores all the buffered frames' start offset, length and arrival time. | 248 // Stores all the buffered frames' start offset, length and arrival time. |
249 std::map<QuicStreamOffset, FrameInfo> frame_arrival_time_map_; | 249 std::map<QuicStreamOffset, FrameInfo> frame_arrival_time_map_; |
250 | 250 |
| 251 // For debugging use after free, assigned to 123456 in constructor and 654321 |
| 252 // in destructor. As long as it's not 123456, this means either use after free |
| 253 // or memory corruption. |
| 254 int32_t destruction_indicator_; |
| 255 |
251 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencerBuffer); | 256 DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencerBuffer); |
252 }; | 257 }; |
253 } // namespace net | 258 } // namespace net |
254 | 259 |
255 #endif // NET_QUIC_QUIC_STREAM_SEQUENCER_BUFFER_H_ | 260 #endif // NET_QUIC_QUIC_STREAM_SEQUENCER_BUFFER_H_ |
OLD | NEW |