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

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: Created 5 years, 4 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
Index: net/quic/quic_http_stream.cc
diff --git a/net/quic/quic_http_stream.cc b/net/quic/quic_http_stream.cc
index 39601c57eaf681ef875641821ed767c9b887f2e1..fa203b99fd97ff2a3cfed4de64225172829c4457 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_);
@@ -265,8 +266,11 @@ int64 QuicHttpStream::GetTotalReceivedBytes() const {
}
int64_t QuicHttpStream::GetTotalSentBytes() const {
- // TODO(sclittle): Implement this for real. http://crbug.com/518897.
- return 0;
+ if (stream_) {
bengr 2015/09/01 17:16:06 Is it always the case that stream_ is non-null whe
sclittle 2015/09/02 00:06:23 What do you mean? |stream_| will be null after it'
+ return stream_->stream_bytes_written();
+ }
+
+ return closed_stream_sent_bytes_;
}
bool QuicHttpStream::GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const {
@@ -554,6 +558,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;
}

Powered by Google App Engine
This is Rietveld 408576698