OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 DCHECK_GE(session_->flow_control_state(), SpdySession::FLOW_CONTROL_STREAM); | 372 DCHECK_GE(session_->flow_control_state(), SpdySession::FLOW_CONTROL_STREAM); |
373 DCHECK_GE(delta_window_size, 1); | 373 DCHECK_GE(delta_window_size, 1); |
374 | 374 |
375 // Since we never decrease the initial receive window size, | 375 // Since we never decrease the initial receive window size, |
376 // |delta_window_size| should never cause |recv_window_size_| to go | 376 // |delta_window_size| should never cause |recv_window_size_| to go |
377 // negative. If we do, the receive window isn't being respected. | 377 // negative. If we do, the receive window isn't being respected. |
378 if (delta_window_size > recv_window_size_) { | 378 if (delta_window_size > recv_window_size_) { |
379 session_->ResetStream( | 379 session_->ResetStream( |
380 stream_id_, RST_STREAM_PROTOCOL_ERROR, | 380 stream_id_, RST_STREAM_PROTOCOL_ERROR, |
381 "delta_window_size is " + base::IntToString(delta_window_size) + | 381 "delta_window_size is " + base::IntToString(delta_window_size) + |
382 " in DecreaseRecvWindowSize, which is larger than the receive " + | 382 " in DecreaseRecvWindowSize, which is larger than the receive " + |
383 "window size of " + base::IntToString(recv_window_size_)); | 383 "window size of " + base::IntToString(recv_window_size_)); |
384 return; | 384 return; |
385 } | 385 } |
386 | 386 |
387 recv_window_size_ -= delta_window_size; | 387 recv_window_size_ -= delta_window_size; |
388 net_log_.AddEvent( | 388 net_log_.AddEvent( |
389 NetLog::TYPE_SPDY_STREAM_UPDATE_RECV_WINDOW, | 389 NetLog::TYPE_SPDY_STREAM_UPDATE_RECV_WINDOW, |
390 base::Bind(&NetLogSpdyStreamWindowUpdateCallback, | 390 base::Bind(&NetLogSpdyStreamWindowUpdateCallback, |
391 stream_id_, -delta_window_size, recv_window_size_)); | 391 stream_id_, -delta_window_size, recv_window_size_)); |
392 } | 392 } |
393 | 393 |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 UMA_HISTOGRAM_TIMES("Net.SpdyStreamDownloadTime", | 979 UMA_HISTOGRAM_TIMES("Net.SpdyStreamDownloadTime", |
980 recv_last_byte_time_ - recv_first_byte_time_); | 980 recv_last_byte_time_ - recv_first_byte_time_); |
981 UMA_HISTOGRAM_TIMES("Net.SpdyStreamTime", | 981 UMA_HISTOGRAM_TIMES("Net.SpdyStreamTime", |
982 recv_last_byte_time_ - send_time_); | 982 recv_last_byte_time_ - send_time_); |
983 | 983 |
984 UMA_HISTOGRAM_COUNTS("Net.SpdySendBytes", send_bytes_); | 984 UMA_HISTOGRAM_COUNTS("Net.SpdySendBytes", send_bytes_); |
985 UMA_HISTOGRAM_COUNTS("Net.SpdyRecvBytes", recv_bytes_); | 985 UMA_HISTOGRAM_COUNTS("Net.SpdyRecvBytes", recv_bytes_); |
986 } | 986 } |
987 | 987 |
988 } // namespace net | 988 } // namespace net |
OLD | NEW |