Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Unified Diff: net/quic/quic_http_stream.cc

Issue 1327533002: Implemented QuicHttpStream::GetTotalSentBytes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@http_stream_sent_bytes
Patch Set: Rebased Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_http_stream.h ('k') | net/quic/quic_http_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_http_stream.cc
diff --git a/net/quic/quic_http_stream.cc b/net/quic/quic_http_stream.cc
index d28eac9bbe613d6b73d60a5af914f0708e680240..a26a81e1876d224e1fe5599e5b2de263ad591615 100644
--- a/net/quic/quic_http_stream.cc
+++ b/net/quic/quic_http_stream.cc
@@ -41,6 +41,7 @@ QuicHttpStream::QuicHttpStream(
response_status_(OK),
response_headers_received_(false),
closed_stream_received_bytes_(0),
+ closed_stream_sent_bytes_(0),
user_buffer_len_(0),
weak_factory_(this) {
DCHECK(session_);
@@ -253,6 +254,8 @@ bool QuicHttpStream::CanReuseConnection() const {
}
int64 QuicHttpStream::GetTotalReceivedBytes() const {
+ // TODO(sclittle): Currently, this only includes response body bytes. Change
+ // this to include headers and QUIC overhead as well.
if (stream_) {
return stream_->stream_bytes_read();
}
@@ -261,8 +264,13 @@ int64 QuicHttpStream::GetTotalReceivedBytes() const {
}
int64_t QuicHttpStream::GetTotalSentBytes() const {
- // TODO(sclittle): Implement this for real. http://crbug.com/518897.
- return 0;
+ // TODO(sclittle): Currently, this only includes request body bytes. Change
+ // this to include headers and QUIC overhead as well.
+ if (stream_) {
+ return stream_->stream_bytes_written();
+ }
+
+ return closed_stream_sent_bytes_;
}
bool QuicHttpStream::GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const {
@@ -547,6 +555,7 @@ void QuicHttpStream::ResetStream() {
if (!stream_)
return;
closed_stream_received_bytes_ = stream_->stream_bytes_read();
+ closed_stream_sent_bytes_ = stream_->stream_bytes_written();
stream_ = nullptr;
// If |request_body_stream_| is non-NULL, Reset it, to abort any in progress
« no previous file with comments | « net/quic/quic_http_stream.h ('k') | net/quic/quic_http_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698