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/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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 : connection_(connection), | 99 : connection_(connection), |
100 visitor_shim_(new VisitorShim(this)), | 100 visitor_shim_(new VisitorShim(this)), |
101 config_(config), | 101 config_(config), |
102 max_open_streams_(config_.max_streams_per_connection()), | 102 max_open_streams_(config_.max_streams_per_connection()), |
103 next_stream_id_(is_server() ? 2 : 3), | 103 next_stream_id_(is_server() ? 2 : 3), |
104 largest_peer_created_stream_id_(0), | 104 largest_peer_created_stream_id_(0), |
105 error_(QUIC_NO_ERROR), | 105 error_(QUIC_NO_ERROR), |
106 goaway_received_(false), | 106 goaway_received_(false), |
107 goaway_sent_(false), | 107 goaway_sent_(false), |
108 has_pending_handshake_(false) { | 108 has_pending_handshake_(false) { |
109 } | |
110 | |
111 void QuicSession::InitializeSession() { | |
112 if (connection_->version() <= QUIC_VERSION_19) { | 109 if (connection_->version() <= QUIC_VERSION_19) { |
113 flow_controller_.reset(new QuicFlowController( | 110 flow_controller_.reset(new QuicFlowController( |
114 connection_.get(), 0, is_server(), kDefaultFlowControlSendWindow, | 111 connection_.get(), 0, is_server(), kDefaultFlowControlSendWindow, |
115 config_.GetInitialFlowControlWindowToSend(), | 112 config_.GetInitialFlowControlWindowToSend(), |
116 config_.GetInitialFlowControlWindowToSend())); | 113 config_.GetInitialFlowControlWindowToSend())); |
117 } else { | 114 } else { |
118 flow_controller_.reset(new QuicFlowController( | 115 flow_controller_.reset(new QuicFlowController( |
119 connection_.get(), 0, is_server(), kDefaultFlowControlSendWindow, | 116 connection_.get(), 0, is_server(), kDefaultFlowControlSendWindow, |
120 config_.GetInitialSessionFlowControlWindowToSend(), | 117 config_.GetInitialSessionFlowControlWindowToSend(), |
121 config_.GetInitialSessionFlowControlWindowToSend())); | 118 config_.GetInitialSessionFlowControlWindowToSend())); |
122 } | 119 } |
| 120 } |
123 | 121 |
| 122 void QuicSession::InitializeSession() { |
124 connection_->set_visitor(visitor_shim_.get()); | 123 connection_->set_visitor(visitor_shim_.get()); |
125 connection_->SetFromConfig(config_); | 124 connection_->SetFromConfig(config_); |
126 if (connection_->connected()) { | 125 if (connection_->connected()) { |
127 connection_->SetOverallConnectionTimeout( | 126 connection_->SetOverallConnectionTimeout( |
128 config_.max_time_before_crypto_handshake()); | 127 config_.max_time_before_crypto_handshake()); |
129 } | 128 } |
130 headers_stream_.reset(new QuicHeadersStream(this)); | 129 headers_stream_.reset(new QuicHeadersStream(this)); |
131 if (!is_server()) { | 130 if (!is_server()) { |
132 // For version above QUIC v12, the headers stream is stream 3, so the | 131 // For version above QUIC v12, the headers stream is stream 3, so the |
133 // next available local stream ID should be 5. | 132 // next available local stream ID should be 5. |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 } | 761 } |
763 for (DataStreamMap::iterator it = stream_map_.begin(); | 762 for (DataStreamMap::iterator it = stream_map_.begin(); |
764 it != stream_map_.end(); ++it) { | 763 it != stream_map_.end(); ++it) { |
765 if (version <= QUIC_VERSION_16) { | 764 if (version <= QUIC_VERSION_16) { |
766 it->second->flow_controller()->Disable(); | 765 it->second->flow_controller()->Disable(); |
767 } | 766 } |
768 } | 767 } |
769 } | 768 } |
770 | 769 |
771 } // namespace net | 770 } // namespace net |
OLD | NEW |