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