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_http_stream.h" | 5 #include "net/quic/quic_http_stream.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 233 |
234 void QuicHttpStream::SetConnectionReused() { | 234 void QuicHttpStream::SetConnectionReused() { |
235 // QUIC doesn't need an indicator here. | 235 // QUIC doesn't need an indicator here. |
236 } | 236 } |
237 | 237 |
238 bool QuicHttpStream::CanReuseConnection() const { | 238 bool QuicHttpStream::CanReuseConnection() const { |
239 // QUIC streams aren't considered reusable. | 239 // QUIC streams aren't considered reusable. |
240 return false; | 240 return false; |
241 } | 241 } |
242 | 242 |
243 int64 QuicHttpStream::GetTotalReceivedBytes() const { | 243 int64_t QuicHttpStream::GetTotalReceivedBytes() const { |
244 // TODO(sclittle): Currently, this only includes response body bytes. Change | 244 // TODO(sclittle): Currently, this only includes response body bytes. Change |
245 // this to include headers and QUIC overhead as well. | 245 // this to include headers and QUIC overhead as well. |
246 if (stream_) { | 246 if (stream_) { |
247 return stream_->stream_bytes_read(); | 247 return stream_->stream_bytes_read(); |
248 } | 248 } |
249 | 249 |
250 return closed_stream_received_bytes_; | 250 return closed_stream_received_bytes_; |
251 } | 251 } |
252 | 252 |
253 int64_t QuicHttpStream::GetTotalSentBytes() const { | 253 int64_t QuicHttpStream::GetTotalSentBytes() const { |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); | 543 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); |
544 stream_ = nullptr; | 544 stream_ = nullptr; |
545 | 545 |
546 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress | 546 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress |
547 // read. | 547 // read. |
548 if (request_body_stream_) | 548 if (request_body_stream_) |
549 request_body_stream_->Reset(); | 549 request_body_stream_->Reset(); |
550 } | 550 } |
551 | 551 |
552 } // namespace net | 552 } // namespace net |
OLD | NEW |