Fix "#if defined(DEBUG)" statements
[chromium-blink-merge.git] / net / tools / quic / quic_client_session.h
blob5e0624ac72d64f979439c40b1092c5aba6eb758b
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.
7 #ifndef NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_
8 #define NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_
10 #include <string>
12 #include "base/basictypes.h"
13 #include "net/quic/quic_client_session_base.h"
14 #include "net/quic/quic_crypto_client_stream.h"
15 #include "net/quic/quic_protocol.h"
16 #include "net/tools/quic/quic_spdy_client_stream.h"
18 namespace net {
20 class QuicConnection;
21 class QuicServerId;
22 class ReliableQuicStream;
24 namespace tools {
26 class QuicClientSession : public QuicClientSessionBase {
27 public:
28 QuicClientSession(const QuicConfig& config, QuicConnection* connection);
29 virtual ~QuicClientSession();
31 // QuicClientSessionBase methods:
32 virtual void OnProofValid(
33 const QuicCryptoClientConfig::CachedState& cached) override;
34 virtual void OnProofVerifyDetailsAvailable(
35 const ProofVerifyDetails& verify_details) override;
37 void InitializeSession(const QuicServerId& server_id,
38 QuicCryptoClientConfig* config);
40 // QuicSession methods:
41 virtual QuicSpdyClientStream* CreateOutgoingDataStream() override;
42 virtual QuicCryptoClientStream* GetCryptoStream() override;
44 // Performs a crypto handshake with the server. Returns true if the crypto
45 // handshake is started successfully.
46 bool CryptoConnect();
48 // Returns the number of client hello messages that have been sent on the
49 // crypto stream. If the handshake has completed then this is one greater
50 // than the number of round-trips needed for the handshake.
51 int GetNumSentClientHellos() const;
53 protected:
54 // QuicSession methods:
55 virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override;
57 private:
58 scoped_ptr<QuicCryptoClientStream> crypto_stream_;
60 DISALLOW_COPY_AND_ASSIGN(QuicClientSession);
63 } // namespace tools
64 } // namespace net
66 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_