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

Side by Side Diff: net/quic/quic_session.cc

Issue 333803007: Rather than passing initial_flow_control_window all the way down the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_session.h ('k') | net/quic/quic_session_test.cc » ('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/quic/quic_session.h" 5 #include "net/quic/quic_session.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "net/quic/crypto/proof_verifier.h" 8 #include "net/quic/crypto/proof_verifier.h"
9 #include "net/quic/quic_connection.h" 9 #include "net/quic/quic_connection.h"
10 #include "net/quic/quic_flags.h" 10 #include "net/quic/quic_flags.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 virtual bool HasOpenDataStreams() const OVERRIDE { 90 virtual bool HasOpenDataStreams() const OVERRIDE {
91 return session_->HasOpenDataStreams(); 91 return session_->HasOpenDataStreams();
92 } 92 }
93 93
94 private: 94 private:
95 QuicSession* session_; 95 QuicSession* session_;
96 }; 96 };
97 97
98 QuicSession::QuicSession(QuicConnection* connection, 98 QuicSession::QuicSession(QuicConnection* connection,
99 uint32 max_flow_control_receive_window_bytes,
100 const QuicConfig& config) 99 const QuicConfig& config)
101 : connection_(connection), 100 : connection_(connection),
102 visitor_shim_(new VisitorShim(this)), 101 visitor_shim_(new VisitorShim(this)),
103 config_(config), 102 config_(config),
104 max_open_streams_(config_.max_streams_per_connection()), 103 max_open_streams_(config_.max_streams_per_connection()),
105 next_stream_id_(is_server() ? 2 : 3), 104 next_stream_id_(is_server() ? 2 : 3),
106 largest_peer_created_stream_id_(0), 105 largest_peer_created_stream_id_(0),
107 error_(QUIC_NO_ERROR), 106 error_(QUIC_NO_ERROR),
108 goaway_received_(false), 107 goaway_received_(false),
109 goaway_sent_(false), 108 goaway_sent_(false),
110 has_pending_handshake_(false), 109 has_pending_handshake_(false) {
111 max_flow_control_receive_window_bytes_(
112 max_flow_control_receive_window_bytes) {
113 if (max_flow_control_receive_window_bytes_ < kDefaultFlowControlSendWindow) {
114 LOG(ERROR) << "Initial receive window ("
115 << max_flow_control_receive_window_bytes_
116 << ") cannot be set lower than default ("
117 << kDefaultFlowControlSendWindow << ").";
118 max_flow_control_receive_window_bytes_ = kDefaultFlowControlSendWindow;
119 }
120 flow_controller_.reset(new QuicFlowController( 110 flow_controller_.reset(new QuicFlowController(
121 connection_.get(), 0, is_server(), kDefaultFlowControlSendWindow, 111 connection_.get(), 0, is_server(), kDefaultFlowControlSendWindow,
122 max_flow_control_receive_window_bytes_, 112 config_.GetInitialFlowControlWindowToSend(),
123 max_flow_control_receive_window_bytes_)); 113 config_.GetInitialFlowControlWindowToSend()));
124 114
125 connection_->set_visitor(visitor_shim_.get()); 115 connection_->set_visitor(visitor_shim_.get());
126 connection_->SetFromConfig(config_); 116 connection_->SetFromConfig(config_);
127 if (connection_->connected()) { 117 if (connection_->connected()) {
128 connection_->SetOverallConnectionTimeout( 118 connection_->SetOverallConnectionTimeout(
129 config_.max_time_before_crypto_handshake()); 119 config_.max_time_before_crypto_handshake());
130 } 120 }
131 headers_stream_.reset(new QuicHeadersStream(this)); 121 headers_stream_.reset(new QuicHeadersStream(this));
132 if (!is_server()) { 122 if (!is_server()) {
133 // For version above QUIC v12, the headers stream is stream 3, so the 123 // For version above QUIC v12, the headers stream is stream 3, so the
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 // with a different version. 700 // with a different version.
711 for (DataStreamMap::iterator it = stream_map_.begin(); 701 for (DataStreamMap::iterator it = stream_map_.begin();
712 it != stream_map_.end(); ++it) { 702 it != stream_map_.end(); ++it) {
713 if (version < QUIC_VERSION_17) { 703 if (version < QUIC_VERSION_17) {
714 it->second->flow_controller()->Disable(); 704 it->second->flow_controller()->Disable();
715 } 705 }
716 } 706 }
717 } 707 }
718 708
719 } // namespace net 709 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_session.h ('k') | net/quic/quic_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698