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.
5 // A client specific QuicSession subclass.
7 #ifndef NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_
8 #define NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_
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"
20 class ReliableQuicStream;
24 class QuicReliableClientStream;
26 class QuicClientSession : public QuicSession {
28 QuicClientSession(const std::string& server_hostname,
29 const QuicConfig& config,
30 QuicConnection* connection,
31 QuicCryptoClientConfig* crypto_config);
32 virtual ~QuicClientSession();
34 // QuicSession methods:
35 virtual QuicReliableClientStream* CreateOutgoingReliableStream() OVERRIDE;
36 virtual QuicCryptoClientStream* GetCryptoStream() OVERRIDE;
38 // Performs a crypto handshake with the server. Returns true if the crypto
39 // handshake is started successfully.
42 // Returns the number of client hello messages that have been sent on the
43 // crypto stream. If the handshake has completed then this is one greater
44 // than the number of round-trips needed for the handshake.
45 int GetNumSentClientHellos() const;
48 // QuicSession methods:
49 virtual ReliableQuicStream* CreateIncomingReliableStream(
50 QuicStreamId id) OVERRIDE;
53 QuicCryptoClientStream crypto_stream_;
55 DISALLOW_COPY_AND_ASSIGN(QuicClientSession);
61 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_