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 // A client specific QuicSession subclass. This class owns the underlying | 5 // A client specific QuicSession subclass. This class owns the underlying |
6 // QuicConnection and QuicConnectionHelper objects. The connection stores | 6 // QuicConnection and QuicConnectionHelper objects. The connection stores |
7 // a non-owning pointer to the helper so this session needs to ensure that | 7 // a non-owning pointer to the helper so this session needs to ensure that |
8 // the helper outlives the connection. | 8 // the helper outlives the connection. |
9 | 9 |
10 #ifndef NET_QUIC_QUIC_CLIENT_SESSION_H_ | 10 #ifndef NET_QUIC_QUIC_CLIENT_SESSION_H_ |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 base::WeakPtr<QuicClientSession> GetWeakPtr(); | 168 base::WeakPtr<QuicClientSession> GetWeakPtr(); |
169 | 169 |
170 // Returns the number of client hello messages that have been sent on the | 170 // Returns the number of client hello messages that have been sent on the |
171 // crypto stream. If the handshake has completed then this is one greater | 171 // crypto stream. If the handshake has completed then this is one greater |
172 // than the number of round-trips needed for the handshake. | 172 // than the number of round-trips needed for the handshake. |
173 int GetNumSentClientHellos() const; | 173 int GetNumSentClientHellos() const; |
174 | 174 |
175 // Returns true if |hostname| may be pooled onto this session. If this | 175 // Returns true if |hostname| may be pooled onto this session. If this |
176 // is a secure QUIC session, then |hostname| must match the certificate | 176 // is a secure QUIC session, then |hostname| must match the certificate |
177 // presented during the handshake. | 177 // presented during the handshake. |
178 bool CanPool(const std::string& hostname) const; | 178 bool CanPool(const std::string& hostname, PrivacyMode privacy_mode) const; |
| 179 |
| 180 const QuicServerId& server_id() const { return server_id_; } |
179 | 181 |
180 protected: | 182 protected: |
181 // QuicSession methods: | 183 // QuicSession methods: |
182 QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override; | 184 QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override; |
183 | 185 |
184 private: | 186 private: |
185 friend class test::QuicClientSessionPeer; | 187 friend class test::QuicClientSessionPeer; |
186 | 188 |
187 typedef std::set<Observer*> ObserverSet; | 189 typedef std::set<Observer*> ObserverSet; |
188 typedef std::list<StreamRequest*> StreamRequestQueue; | 190 typedef std::list<StreamRequest*> StreamRequestQueue; |
(...skipping 23 matching lines...) Expand all Loading... |
212 | 214 |
213 // Posts a task to notify the factory that this session has been closed. | 215 // Posts a task to notify the factory that this session has been closed. |
214 void NotifyFactoryOfSessionClosedLater(); | 216 void NotifyFactoryOfSessionClosedLater(); |
215 | 217 |
216 // Notifies the factory that this session has been closed which will | 218 // Notifies the factory that this session has been closed which will |
217 // delete |this|. | 219 // delete |this|. |
218 void NotifyFactoryOfSessionClosed(); | 220 void NotifyFactoryOfSessionClosed(); |
219 | 221 |
220 void OnConnectTimeout(); | 222 void OnConnectTimeout(); |
221 | 223 |
222 HostPortPair server_host_port_; | 224 QuicServerId server_id_; |
223 bool require_confirmation_; | 225 bool require_confirmation_; |
224 scoped_ptr<QuicCryptoClientStream> crypto_stream_; | 226 scoped_ptr<QuicCryptoClientStream> crypto_stream_; |
225 QuicStreamFactory* stream_factory_; | 227 QuicStreamFactory* stream_factory_; |
226 scoped_ptr<DatagramClientSocket> socket_; | 228 scoped_ptr<DatagramClientSocket> socket_; |
227 scoped_refptr<IOBufferWithSize> read_buffer_; | 229 scoped_refptr<IOBufferWithSize> read_buffer_; |
228 TransportSecurityState* transport_security_state_; | 230 TransportSecurityState* transport_security_state_; |
229 scoped_ptr<QuicServerInfo> server_info_; | 231 scoped_ptr<QuicServerInfo> server_info_; |
230 scoped_ptr<CertVerifyResult> cert_verify_result_; | 232 scoped_ptr<CertVerifyResult> cert_verify_result_; |
231 std::string pinning_failure_log_; | 233 std::string pinning_failure_log_; |
232 ObserverSet observers_; | 234 ObserverSet observers_; |
(...skipping 11 matching lines...) Expand all Loading... |
244 // on this session. Existing stream will continue to be processed. | 246 // on this session. Existing stream will continue to be processed. |
245 bool going_away_; | 247 bool going_away_; |
246 base::WeakPtrFactory<QuicClientSession> weak_factory_; | 248 base::WeakPtrFactory<QuicClientSession> weak_factory_; |
247 | 249 |
248 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); | 250 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); |
249 }; | 251 }; |
250 | 252 |
251 } // namespace net | 253 } // namespace net |
252 | 254 |
253 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ | 255 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ |
OLD | NEW |