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

Unified Diff: net/spdy/spdy_http_stream.cc

Issue 1309663003: Implemented SpdyHttpStream::GetTotalSentBytes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@http_stream_sent_bytes
Patch Set: Addressed comments 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/spdy/spdy_http_stream.h ('k') | net/spdy/spdy_http_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_http_stream.cc
diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc
index f07686ffa43fdb0bb8bb1e2f2335b351f06f71c7..925e755edc945a10297c3096430074d5a0b420ea 100644
--- a/net/spdy/spdy_http_stream.cc
+++ b/net/spdy/spdy_http_stream.cc
@@ -36,6 +36,7 @@ SpdyHttpStream::SpdyHttpStream(const base::WeakPtr<SpdySession>& spdy_session,
closed_stream_status_(ERR_FAILED),
closed_stream_id_(0),
closed_stream_received_bytes_(0),
+ closed_stream_sent_bytes_(0),
request_info_(NULL),
response_info_(NULL),
response_headers_status_(RESPONSE_HEADERS_ARE_INCOMPLETE),
@@ -184,8 +185,13 @@ int64 SpdyHttpStream::GetTotalReceivedBytes() const {
}
int64_t SpdyHttpStream::GetTotalSentBytes() const {
- // TODO(sclittle): Implement this for real. http://crbug.com/518897.
- return 0;
+ if (stream_closed_)
+ return closed_stream_sent_bytes_;
+
+ if (!stream_)
+ return 0;
+
+ return stream_->raw_sent_bytes();
}
bool SpdyHttpStream::GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const {
@@ -381,6 +387,7 @@ void SpdyHttpStream::OnClose(int status) {
closed_stream_has_load_timing_info_ =
stream_->GetLoadTimingInfo(&closed_stream_load_timing_info_);
closed_stream_received_bytes_ = stream_->raw_received_bytes();
+ closed_stream_sent_bytes_ = stream_->raw_sent_bytes();
}
stream_.reset();
« no previous file with comments | « net/spdy/spdy_http_stream.h ('k') | net/spdy/spdy_http_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698