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

Side by Side Diff: net/spdy/spdy_stream.cc

Issue 8892026: SPDY - add support for spdy/2.1 to support flow control. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/spdy/spdy_stream.h" 5 #include "net/spdy/spdy_stream.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "net/spdy/spdy_session.h" 10 #include "net/spdy/spdy_session.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 CHECK(!closed()); 318 CHECK(!closed());
319 319
320 // A zero-length read means that the stream is being closed. 320 // A zero-length read means that the stream is being closed.
321 if (!length) { 321 if (!length) {
322 metrics_.StopStream(); 322 metrics_.StopStream();
323 session_->CloseStream(stream_id_, net::OK); 323 session_->CloseStream(stream_id_, net::OK);
324 // Note: |this| may be deleted after calling CloseStream. 324 // Note: |this| may be deleted after calling CloseStream.
325 return; 325 return;
326 } 326 }
327 327
328 if (session_->flow_control()) 328 if (session_->is_flow_control_enabled())
329 DecreaseRecvWindowSize(length); 329 DecreaseRecvWindowSize(length);
330 330
331 // Track our bandwidth. 331 // Track our bandwidth.
332 metrics_.RecordBytes(length); 332 metrics_.RecordBytes(length);
333 recv_bytes_ += length; 333 recv_bytes_ += length;
334 recv_last_byte_time_ = base::TimeTicks::Now(); 334 recv_last_byte_time_ = base::TimeTicks::Now();
335 335
336 if (!delegate_) { 336 if (!delegate_) {
337 // It should be valid for this to happen in the server push case. 337 // It should be valid for this to happen in the server push case.
338 // We'll return received data when delegate gets attached to the stream. 338 // We'll return received data when delegate gets attached to the stream.
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 UMA_HISTOGRAM_TIMES("Net.SpdyStreamDownloadTime", 598 UMA_HISTOGRAM_TIMES("Net.SpdyStreamDownloadTime",
599 recv_last_byte_time_ - recv_first_byte_time_); 599 recv_last_byte_time_ - recv_first_byte_time_);
600 UMA_HISTOGRAM_TIMES("Net.SpdyStreamTime", 600 UMA_HISTOGRAM_TIMES("Net.SpdyStreamTime",
601 recv_last_byte_time_ - send_time_); 601 recv_last_byte_time_ - send_time_);
602 602
603 UMA_HISTOGRAM_COUNTS("Net.SpdySendBytes", send_bytes_); 603 UMA_HISTOGRAM_COUNTS("Net.SpdySendBytes", send_bytes_);
604 UMA_HISTOGRAM_COUNTS("Net.SpdyRecvBytes", recv_bytes_); 604 UMA_HISTOGRAM_COUNTS("Net.SpdyRecvBytes", recv_bytes_);
605 } 605 }
606 606
607 } // namespace net 607 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698