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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 DCHECK_LE(delta_window_size, kint32max - recv_window_size_); | 327 DCHECK_LE(delta_window_size, kint32max - recv_window_size_); |
328 | 328 |
329 recv_window_size_ += delta_window_size; | 329 recv_window_size_ += delta_window_size; |
330 net_log_.AddEvent( | 330 net_log_.AddEvent( |
331 NetLog::TYPE_HTTP2_STREAM_UPDATE_RECV_WINDOW, | 331 NetLog::TYPE_HTTP2_STREAM_UPDATE_RECV_WINDOW, |
332 base::Bind(&NetLogSpdyStreamWindowUpdateCallback, stream_id_, | 332 base::Bind(&NetLogSpdyStreamWindowUpdateCallback, stream_id_, |
333 delta_window_size, recv_window_size_)); | 333 delta_window_size, recv_window_size_)); |
334 | 334 |
335 unacked_recv_window_bytes_ += delta_window_size; | 335 unacked_recv_window_bytes_ += delta_window_size; |
336 if (unacked_recv_window_bytes_ > | 336 if (unacked_recv_window_bytes_ > |
337 session_->stream_initial_recv_window_size() / 2) { | 337 session_->stream_max_recv_window_size() / 2) { |
338 session_->SendStreamWindowUpdate( | 338 session_->SendStreamWindowUpdate( |
339 stream_id_, static_cast<uint32>(unacked_recv_window_bytes_)); | 339 stream_id_, static_cast<uint32>(unacked_recv_window_bytes_)); |
340 unacked_recv_window_bytes_ = 0; | 340 unacked_recv_window_bytes_ = 0; |
341 } | 341 } |
342 } | 342 } |
343 | 343 |
344 void SpdyStream::DecreaseRecvWindowSize(int32 delta_window_size) { | 344 void SpdyStream::DecreaseRecvWindowSize(int32 delta_window_size) { |
345 DCHECK(session_->IsStreamActive(stream_id_)); | 345 DCHECK(session_->IsStreamActive(stream_id_)); |
346 DCHECK_GE(session_->flow_control_state(), SpdySession::FLOW_CONTROL_STREAM); | 346 DCHECK_GE(session_->flow_control_state(), SpdySession::FLOW_CONTROL_STREAM); |
347 DCHECK_GE(delta_window_size, 1); | 347 DCHECK_GE(delta_window_size, 1); |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 919 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
920 state); | 920 state); |
921 break; | 921 break; |
922 } | 922 } |
923 return description; | 923 return description; |
924 } | 924 } |
925 | 925 |
926 #undef STATE_CASE | 926 #undef STATE_CASE |
927 | 927 |
928 } // namespace net | 928 } // namespace net |
OLD | NEW |