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 #include "net/quic/quic_stream_sequencer.h" | 5 #include "net/quic/quic_stream_sequencer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/metrics/sparse_histogram.h" | 11 #include "base/metrics/sparse_histogram.h" |
12 #include "net/quic/reliable_quic_stream.h" | 12 #include "net/quic/reliable_quic_stream.h" |
13 | 13 |
14 using std::make_pair; | 14 using std::make_pair; |
15 using std::min; | 15 using std::min; |
16 using std::numeric_limits; | 16 using std::numeric_limits; |
| 17 using std::string; |
17 | 18 |
18 namespace net { | 19 namespace net { |
19 | 20 |
20 QuicStreamSequencer::QuicStreamSequencer(ReliableQuicStream* quic_stream) | 21 QuicStreamSequencer::QuicStreamSequencer(ReliableQuicStream* quic_stream) |
21 : stream_(quic_stream), | 22 : stream_(quic_stream), |
22 num_bytes_consumed_(0), | 23 num_bytes_consumed_(0), |
23 close_offset_(numeric_limits<QuicStreamOffset>::max()), | 24 close_offset_(numeric_limits<QuicStreamOffset>::max()), |
24 blocked_(false), | 25 blocked_(false), |
25 num_bytes_buffered_(0), | 26 num_bytes_buffered_(0), |
26 num_frames_received_(0), | 27 num_frames_received_(0), |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } | 286 } |
286 | 287 |
287 void QuicStreamSequencer::RecordBytesConsumed(size_t bytes_consumed) { | 288 void QuicStreamSequencer::RecordBytesConsumed(size_t bytes_consumed) { |
288 num_bytes_consumed_ += bytes_consumed; | 289 num_bytes_consumed_ += bytes_consumed; |
289 num_bytes_buffered_ -= bytes_consumed; | 290 num_bytes_buffered_ -= bytes_consumed; |
290 | 291 |
291 stream_->AddBytesConsumed(bytes_consumed); | 292 stream_->AddBytesConsumed(bytes_consumed); |
292 } | 293 } |
293 | 294 |
294 } // namespace net | 295 } // namespace net |
OLD | NEW |