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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 88 } |
89 | 89 |
90 bool HasOpenDataStreams() const override { | 90 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, const QuicConfig& config) | 98 QuicSession::QuicSession(QuicConnection* connection, const QuicConfig& config, |
| 99 bool is_secure) |
99 : connection_(connection), | 100 : connection_(connection), |
100 visitor_shim_(new VisitorShim(this)), | 101 visitor_shim_(new VisitorShim(this)), |
101 config_(config), | 102 config_(config), |
102 max_open_streams_(config_.MaxStreamsPerConnection()), | 103 max_open_streams_(config_.MaxStreamsPerConnection()), |
103 next_stream_id_(is_server() ? 2 : 5), | 104 next_stream_id_(is_server() ? 2 : 5), |
104 largest_peer_created_stream_id_(0), | 105 largest_peer_created_stream_id_(0), |
105 error_(QUIC_NO_ERROR), | 106 error_(QUIC_NO_ERROR), |
106 goaway_received_(false), | 107 goaway_received_(false), |
107 goaway_sent_(false), | 108 goaway_sent_(false), |
108 has_pending_handshake_(false) { | 109 has_pending_handshake_(false), |
| 110 is_secure_(is_secure) { |
109 if (connection_->version() == QUIC_VERSION_19) { | 111 if (connection_->version() == QUIC_VERSION_19) { |
110 flow_controller_.reset(new QuicFlowController( | 112 flow_controller_.reset(new QuicFlowController( |
111 connection_.get(), 0, is_server(), kDefaultFlowControlSendWindow, | 113 connection_.get(), 0, is_server(), kDefaultFlowControlSendWindow, |
112 config_.GetInitialFlowControlWindowToSend(), | 114 config_.GetInitialFlowControlWindowToSend(), |
113 config_.GetInitialFlowControlWindowToSend())); | 115 config_.GetInitialFlowControlWindowToSend())); |
114 } else { | 116 } else { |
115 flow_controller_.reset(new QuicFlowController( | 117 flow_controller_.reset(new QuicFlowController( |
116 connection_.get(), 0, is_server(), kDefaultFlowControlSendWindow, | 118 connection_.get(), 0, is_server(), kDefaultFlowControlSendWindow, |
117 config_.GetInitialSessionFlowControlWindowToSend(), | 119 config_.GetInitialSessionFlowControlWindowToSend(), |
118 config_.GetInitialSessionFlowControlWindowToSend())); | 120 config_.GetInitialSessionFlowControlWindowToSend())); |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 for (DataStreamMap::iterator it = stream_map_.begin(); | 790 for (DataStreamMap::iterator it = stream_map_.begin(); |
789 it != stream_map_.end(); ++it) { | 791 it != stream_map_.end(); ++it) { |
790 if (it->second->flow_controller()->IsBlocked()) { | 792 if (it->second->flow_controller()->IsBlocked()) { |
791 return true; | 793 return true; |
792 } | 794 } |
793 } | 795 } |
794 return false; | 796 return false; |
795 } | 797 } |
796 | 798 |
797 } // namespace net | 799 } // namespace net |
OLD | NEW |