| 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 18 matching lines...) Expand all Loading... |
| 29 class NET_EXPORT_PRIVATE QuicClientSession : public QuicSession { | 29 class NET_EXPORT_PRIVATE QuicClientSession : public QuicSession { |
| 30 public: | 30 public: |
| 31 // Constructs a new session which will own |connection| and |helper|, but | 31 // Constructs a new session which will own |connection| and |helper|, but |
| 32 // not |stream_factory|, which must outlive this session. | 32 // not |stream_factory|, which must outlive this session. |
| 33 // TODO(rch): decouple the factory from the session via a Delegate interface. | 33 // TODO(rch): decouple the factory from the session via a Delegate interface. |
| 34 QuicClientSession(QuicConnection* connection, | 34 QuicClientSession(QuicConnection* connection, |
| 35 DatagramClientSocket* socket, | 35 DatagramClientSocket* socket, |
| 36 QuicStreamFactory* stream_factory, | 36 QuicStreamFactory* stream_factory, |
| 37 QuicCryptoClientStreamFactory* crypto_client_stream_factory, | 37 QuicCryptoClientStreamFactory* crypto_client_stream_factory, |
| 38 const std::string& server_hostname, | 38 const std::string& server_hostname, |
| 39 QuicCryptoClientConfig* crypto_config, |
| 39 NetLog* net_log); | 40 NetLog* net_log); |
| 40 | 41 |
| 41 virtual ~QuicClientSession(); | 42 virtual ~QuicClientSession(); |
| 42 | 43 |
| 43 // QuicSession methods: | 44 // QuicSession methods: |
| 44 virtual QuicReliableClientStream* CreateOutgoingReliableStream() OVERRIDE; | 45 virtual QuicReliableClientStream* CreateOutgoingReliableStream() OVERRIDE; |
| 45 virtual QuicCryptoClientStream* GetCryptoStream() OVERRIDE; | 46 virtual QuicCryptoClientStream* GetCryptoStream() OVERRIDE; |
| 46 virtual void CloseStream(QuicStreamId stream_id) OVERRIDE; | 47 virtual void CloseStream(QuicStreamId stream_id) OVERRIDE; |
| 47 virtual void OnCryptoHandshakeComplete(QuicErrorCode error) OVERRIDE; | 48 virtual void OnCryptoHandshakeComplete(QuicErrorCode error) OVERRIDE; |
| 48 | 49 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 63 protected: | 64 protected: |
| 64 // QuicSession methods: | 65 // QuicSession methods: |
| 65 virtual ReliableQuicStream* CreateIncomingReliableStream( | 66 virtual ReliableQuicStream* CreateIncomingReliableStream( |
| 66 QuicStreamId id) OVERRIDE; | 67 QuicStreamId id) OVERRIDE; |
| 67 | 68 |
| 68 private: | 69 private: |
| 69 // A completion callback invoked when a read completes. | 70 // A completion callback invoked when a read completes. |
| 70 void OnReadComplete(int result); | 71 void OnReadComplete(int result); |
| 71 | 72 |
| 72 base::WeakPtrFactory<QuicClientSession> weak_factory_; | 73 base::WeakPtrFactory<QuicClientSession> weak_factory_; |
| 74 // config_ contains non-crypto configuration options negotiated in the crypto |
| 75 // handshake. |
| 76 QuicConfig config_; |
| 73 scoped_ptr<QuicCryptoClientStream> crypto_stream_; | 77 scoped_ptr<QuicCryptoClientStream> crypto_stream_; |
| 74 QuicStreamFactory* stream_factory_; | 78 QuicStreamFactory* stream_factory_; |
| 75 scoped_ptr<DatagramClientSocket> socket_; | 79 scoped_ptr<DatagramClientSocket> socket_; |
| 76 scoped_refptr<IOBufferWithSize> read_buffer_; | 80 scoped_refptr<IOBufferWithSize> read_buffer_; |
| 77 bool read_pending_; | 81 bool read_pending_; |
| 78 CompletionCallback callback_; | 82 CompletionCallback callback_; |
| 79 size_t num_total_streams_; | 83 size_t num_total_streams_; |
| 80 BoundNetLog net_log_; | 84 BoundNetLog net_log_; |
| 81 QuicConnectionLogger logger_; | 85 QuicConnectionLogger logger_; |
| 82 | 86 |
| 83 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); | 87 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); |
| 84 }; | 88 }; |
| 85 | 89 |
| 86 } // namespace net | 90 } // namespace net |
| 87 | 91 |
| 88 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ | 92 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ |
| OLD | NEW |