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

Unified Diff: net/spdy/spdy_session.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_unittest.cc ('k') | net/spdy/spdy_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session.cc
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 6908414458fa29eea9407125c8286a2f99d38aa9..02336399f4e2eb577f2bca8b35a9c283d0252af6 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -1617,6 +1617,8 @@ int SpdySession::DoWriteComplete(int result) {
if (result > 0) {
in_flight_write_->Consume(static_cast<size_t>(result));
+ if (in_flight_write_stream_.get())
+ in_flight_write_stream_->AddRawSentBytes(static_cast<size_t>(result));
// We only notify the stream when we've fully written the pending frame.
if (in_flight_write_->GetRemainingSize() == 0) {
@@ -2036,7 +2038,7 @@ void SpdySession::OnDataFrameHeader(SpdyStreamId stream_id,
DCHECK(buffered_spdy_framer_);
size_t header_len = buffered_spdy_framer_->GetDataFrameMinimumSize();
- stream->IncrementRawReceivedBytes(header_len);
+ stream->AddRawReceivedBytes(header_len);
}
void SpdySession::OnStreamFrameData(SpdyStreamId stream_id,
@@ -2081,7 +2083,7 @@ void SpdySession::OnStreamFrameData(SpdyStreamId stream_id,
SpdyStream* stream = it->second.stream;
CHECK_EQ(stream->stream_id(), stream_id);
- stream->IncrementRawReceivedBytes(len);
+ stream->AddRawReceivedBytes(len);
if (it->second.waiting_for_syn_reply) {
const std::string& error = "Data received before SYN_REPLY.";
@@ -2318,7 +2320,7 @@ void SpdySession::OnSynReply(SpdyStreamId stream_id,
SpdyStream* stream = it->second.stream;
CHECK_EQ(stream->stream_id(), stream_id);
- stream->IncrementRawReceivedBytes(last_compressed_frame_len_);
+ stream->AddRawReceivedBytes(last_compressed_frame_len_);
last_compressed_frame_len_ = 0;
if (GetProtocolVersion() >= HTTP2) {
@@ -2365,7 +2367,7 @@ void SpdySession::OnHeaders(SpdyStreamId stream_id,
SpdyStream* stream = it->second.stream;
CHECK_EQ(stream->stream_id(), stream_id);
- stream->IncrementRawReceivedBytes(last_compressed_frame_len_);
+ stream->AddRawReceivedBytes(last_compressed_frame_len_);
last_compressed_frame_len_ = 0;
base::Time response_time = base::Time::Now();
@@ -2696,10 +2698,10 @@ bool SpdySession::TryCreatePushStream(SpdyStreamId stream_id,
// In spdy4/http2 PUSH_PROMISE arrives on associated stream.
if (associated_it != active_streams_.end() && GetProtocolVersion() >= HTTP2) {
- associated_it->second.stream->IncrementRawReceivedBytes(
+ associated_it->second.stream->AddRawReceivedBytes(
last_compressed_frame_len_);
} else {
- stream->IncrementRawReceivedBytes(last_compressed_frame_len_);
+ stream->AddRawReceivedBytes(last_compressed_frame_len_);
}
last_compressed_frame_len_ = 0;
« no previous file with comments | « net/spdy/spdy_http_stream_unittest.cc ('k') | net/spdy/spdy_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698