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

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

Issue 1061853002: Emit session-level WINDOW_UPDATEs less frequently. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re: comments in #5. Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « net/spdy/spdy_session_unittest.cc ('k') | net/spdy/spdy_test_util_common.h » ('j') | 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) 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
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
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
OLDNEW
« no previous file with comments | « net/spdy/spdy_session_unittest.cc ('k') | net/spdy/spdy_test_util_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698