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> |
(...skipping 10 matching lines...) Expand all Loading... |
21 class QuicServerId; | 21 class QuicServerId; |
22 class ReliableQuicStream; | 22 class ReliableQuicStream; |
23 | 23 |
24 namespace tools { | 24 namespace tools { |
25 | 25 |
26 class QuicClientSession : public QuicClientSessionBase { | 26 class QuicClientSession : public QuicClientSessionBase { |
27 public: | 27 public: |
28 QuicClientSession(const QuicConfig& config, QuicConnection* connection); | 28 QuicClientSession(const QuicConfig& config, QuicConnection* connection); |
29 ~QuicClientSession() override; | 29 ~QuicClientSession() override; |
30 | 30 |
31 // QuicClientSessionBase methods: | |
32 void OnProofValid(const QuicCryptoClientConfig::CachedState& cached) override; | |
33 void OnProofVerifyDetailsAvailable( | |
34 const ProofVerifyDetails& verify_details) override; | |
35 | |
36 void InitializeSession(const QuicServerId& server_id, | 31 void InitializeSession(const QuicServerId& server_id, |
37 QuicCryptoClientConfig* config); | 32 QuicCryptoClientConfig* config); |
38 | 33 |
39 // QuicSession methods: | 34 // QuicSession methods: |
40 QuicSpdyClientStream* CreateOutgoingDataStream() override; | 35 QuicSpdyClientStream* CreateOutgoingDataStream() override; |
41 QuicCryptoClientStream* GetCryptoStream() override; | 36 QuicCryptoClientStream* GetCryptoStream() override; |
42 | 37 |
| 38 // QuicClientSessionBase methods: |
| 39 void OnProofValid(const QuicCryptoClientConfig::CachedState& cached) override; |
| 40 void OnProofVerifyDetailsAvailable( |
| 41 const ProofVerifyDetails& verify_details) override; |
| 42 |
43 // Performs a crypto handshake with the server. Returns true if the crypto | 43 // Performs a crypto handshake with the server. Returns true if the crypto |
44 // handshake is started successfully. | 44 // handshake is started successfully. |
45 bool CryptoConnect(); | 45 bool CryptoConnect(); |
46 | 46 |
47 // Returns the number of client hello messages that have been sent on the | 47 // Returns the number of client hello messages that have been sent on the |
48 // crypto stream. If the handshake has completed then this is one greater | 48 // crypto stream. If the handshake has completed then this is one greater |
49 // than the number of round-trips needed for the handshake. | 49 // than the number of round-trips needed for the handshake. |
50 int GetNumSentClientHellos() const; | 50 int GetNumSentClientHellos() const; |
51 | 51 |
52 protected: | 52 protected: |
53 // QuicSession methods: | 53 // QuicSession methods: |
54 QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override; | 54 QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override; |
55 | 55 |
56 private: | 56 private: |
57 scoped_ptr<QuicCryptoClientStream> crypto_stream_; | 57 scoped_ptr<QuicCryptoClientStream> crypto_stream_; |
58 | 58 |
59 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); | 59 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); |
60 }; | 60 }; |
61 | 61 |
62 } // namespace tools | 62 } // namespace tools |
63 } // namespace net | 63 } // namespace net |
64 | 64 |
65 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_ | 65 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_ |
OLD | NEW |