| 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 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 class CertVerifyResult; | 29 class CertVerifyResult; |
| 30 class DatagramClientSocket; | 30 class DatagramClientSocket; |
| 31 class QuicConnectionHelper; | 31 class QuicConnectionHelper; |
| 32 class QuicCryptoClientStreamFactory; | 32 class QuicCryptoClientStreamFactory; |
| 33 class QuicDefaultPacketWriter; | 33 class QuicDefaultPacketWriter; |
| 34 class QuicServerId; | 34 class QuicServerId; |
| 35 class QuicServerInfo; | 35 class QuicServerInfo; |
| 36 class QuicStreamFactory; | 36 class QuicStreamFactory; |
| 37 class SSLInfo; | 37 class SSLInfo; |
| 38 class TransportSecurityState; | |
| 39 | 38 |
| 40 namespace test { | 39 namespace test { |
| 41 class QuicClientSessionPeer; | 40 class QuicClientSessionPeer; |
| 42 } // namespace test | 41 } // namespace test |
| 43 | 42 |
| 44 class NET_EXPORT_PRIVATE QuicClientSession : public QuicClientSessionBase { | 43 class NET_EXPORT_PRIVATE QuicClientSession : public QuicClientSessionBase { |
| 45 public: | 44 public: |
| 46 // An interface for observing events on a session. | 45 // An interface for observing events on a session. |
| 47 class NET_EXPORT_PRIVATE Observer { | 46 class NET_EXPORT_PRIVATE Observer { |
| 48 public: | 47 public: |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 }; | 88 }; |
| 90 | 89 |
| 91 // Constructs a new session connected to |server_id| which will own | 90 // Constructs a new session connected to |server_id| which will own |
| 92 // |connection|, but not |stream_factory|, which must outlive this session. | 91 // |connection|, but not |stream_factory|, which must outlive this session. |
| 93 // TODO(rch): decouple the factory from the session via a Delegate interface. | 92 // TODO(rch): decouple the factory from the session via a Delegate interface. |
| 94 QuicClientSession(QuicConnection* connection, | 93 QuicClientSession(QuicConnection* connection, |
| 95 scoped_ptr<DatagramClientSocket> socket, | 94 scoped_ptr<DatagramClientSocket> socket, |
| 96 scoped_ptr<QuicDefaultPacketWriter> writer, | 95 scoped_ptr<QuicDefaultPacketWriter> writer, |
| 97 QuicStreamFactory* stream_factory, | 96 QuicStreamFactory* stream_factory, |
| 98 QuicCryptoClientStreamFactory* crypto_client_stream_factory, | 97 QuicCryptoClientStreamFactory* crypto_client_stream_factory, |
| 99 TransportSecurityState* transport_security_state, | |
| 100 scoped_ptr<QuicServerInfo> server_info, | 98 scoped_ptr<QuicServerInfo> server_info, |
| 101 const QuicServerId& server_id, | 99 const QuicServerId& server_id, |
| 102 const QuicConfig& config, | 100 const QuicConfig& config, |
| 103 QuicCryptoClientConfig* crypto_config, | 101 QuicCryptoClientConfig* crypto_config, |
| 104 base::TaskRunner* task_runner, | 102 base::TaskRunner* task_runner, |
| 105 NetLog* net_log); | 103 NetLog* net_log); |
| 106 virtual ~QuicClientSession(); | 104 virtual ~QuicClientSession(); |
| 107 | 105 |
| 108 void AddObserver(Observer* observer); | 106 void AddObserver(Observer* observer); |
| 109 void RemoveObserver(Observer* observer); | 107 void RemoveObserver(Observer* observer); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 219 |
| 222 void OnConnectTimeout(); | 220 void OnConnectTimeout(); |
| 223 | 221 |
| 224 const HostPortPair server_host_port_; | 222 const HostPortPair server_host_port_; |
| 225 bool require_confirmation_; | 223 bool require_confirmation_; |
| 226 scoped_ptr<QuicCryptoClientStream> crypto_stream_; | 224 scoped_ptr<QuicCryptoClientStream> crypto_stream_; |
| 227 QuicStreamFactory* stream_factory_; | 225 QuicStreamFactory* stream_factory_; |
| 228 scoped_ptr<DatagramClientSocket> socket_; | 226 scoped_ptr<DatagramClientSocket> socket_; |
| 229 scoped_ptr<QuicDefaultPacketWriter> writer_; | 227 scoped_ptr<QuicDefaultPacketWriter> writer_; |
| 230 scoped_refptr<IOBufferWithSize> read_buffer_; | 228 scoped_refptr<IOBufferWithSize> read_buffer_; |
| 231 TransportSecurityState* transport_security_state_; | |
| 232 scoped_ptr<QuicServerInfo> server_info_; | 229 scoped_ptr<QuicServerInfo> server_info_; |
| 233 scoped_ptr<CertVerifyResult> cert_verify_result_; | 230 scoped_ptr<CertVerifyResult> cert_verify_result_; |
| 234 std::string pinning_failure_log_; | 231 std::string pinning_failure_log_; |
| 235 ObserverSet observers_; | 232 ObserverSet observers_; |
| 236 StreamRequestQueue stream_requests_; | 233 StreamRequestQueue stream_requests_; |
| 237 bool read_pending_; | 234 bool read_pending_; |
| 238 CompletionCallback callback_; | 235 CompletionCallback callback_; |
| 239 size_t num_total_streams_; | 236 size_t num_total_streams_; |
| 240 base::TaskRunner* task_runner_; | 237 base::TaskRunner* task_runner_; |
| 241 BoundNetLog net_log_; | 238 BoundNetLog net_log_; |
| 242 base::TimeTicks handshake_start_; // Time the handshake was started. | 239 base::TimeTicks handshake_start_; // Time the handshake was started. |
| 243 QuicConnectionLogger* logger_; // Owned by |connection_|. | 240 QuicConnectionLogger* logger_; // Owned by |connection_|. |
| 244 // Number of packets read in the current read loop. | 241 // Number of packets read in the current read loop. |
| 245 size_t num_packets_read_; | 242 size_t num_packets_read_; |
| 246 // True when the session is going away, and streams may no longer be created | 243 // True when the session is going away, and streams may no longer be created |
| 247 // on this session. Existing stream will continue to be processed. | 244 // on this session. Existing stream will continue to be processed. |
| 248 bool going_away_; | 245 bool going_away_; |
| 249 base::WeakPtrFactory<QuicClientSession> weak_factory_; | 246 base::WeakPtrFactory<QuicClientSession> weak_factory_; |
| 250 | 247 |
| 251 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); | 248 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); |
| 252 }; | 249 }; |
| 253 | 250 |
| 254 } // namespace net | 251 } // namespace net |
| 255 | 252 |
| 256 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ | 253 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ |
| OLD | NEW |