[email protected] | 519e4988 | 2013-03-27 08:45:32 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | // |
| 5 | // A client specific QuicSession subclass. |
| 6 | |
| 7 | #ifndef NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_ |
| 8 | #define NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_ |
| 9 | |
| 10 | #include <string> |
| 11 | |
| 12 | #include "net/quic/quic_crypto_client_stream.h" |
| 13 | #include "net/quic/quic_protocol.h" |
| 14 | #include "net/quic/quic_session.h" |
| 15 | #include "net/tools/quic/quic_reliable_client_stream.h" |
| 16 | |
| 17 | namespace net { |
| 18 | |
| 19 | class QuicConnection; |
[email protected] | 519e4988 | 2013-03-27 08:45:32 | [diff] [blame] | 20 | class ReliableQuicStream; |
| 21 | |
[email protected] | 332aeb4 | 2013-04-08 22:10:58 | [diff] [blame] | 22 | namespace tools { |
| 23 | |
| 24 | class QuicReliableClientStream; |
| 25 | |
[email protected] | 519e4988 | 2013-03-27 08:45:32 | [diff] [blame] | 26 | class QuicClientSession : public QuicSession { |
| 27 | public: |
| 28 | QuicClientSession(const std::string& server_hostname, |
[email protected] | ef95114d | 2013-04-17 17:57:01 | [diff] [blame^] | 29 | const QuicConfig& config, |
| 30 | QuicConnection* connection, |
| 31 | QuicCryptoClientConfig* crypto_config); |
[email protected] | 519e4988 | 2013-03-27 08:45:32 | [diff] [blame] | 32 | virtual ~QuicClientSession(); |
| 33 | |
| 34 | // QuicSession methods: |
| 35 | virtual QuicReliableClientStream* CreateOutgoingReliableStream() OVERRIDE; |
| 36 | virtual QuicCryptoClientStream* GetCryptoStream() OVERRIDE; |
| 37 | |
| 38 | // Performs a crypto handshake with the server. Returns true if the crypto |
| 39 | // handshake is started successfully. |
| 40 | bool CryptoConnect(); |
| 41 | |
| 42 | protected: |
| 43 | // QuicSession methods: |
| 44 | virtual ReliableQuicStream* CreateIncomingReliableStream( |
| 45 | QuicStreamId id) OVERRIDE; |
| 46 | |
| 47 | private: |
| 48 | QuicCryptoClientStream crypto_stream_; |
| 49 | |
| 50 | DISALLOW_COPY_AND_ASSIGN(QuicClientSession); |
| 51 | }; |
| 52 | |
[email protected] | 332aeb4 | 2013-04-08 22:10:58 | [diff] [blame] | 53 | } // namespace tools |
[email protected] | 519e4988 | 2013-03-27 08:45:32 | [diff] [blame] | 54 | } // namespace net |
| 55 | |
| 56 | #endif // NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_ |