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