| 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 class QuicClientSession : public QuicClientSessionBase { | 26 class QuicClientSession : public QuicClientSessionBase { |
| 27 public: | 27 public: |
| 28 QuicClientSession(const QuicConfig& config, | 28 QuicClientSession(const QuicConfig& config, |
| 29 QuicConnection* connection, | 29 QuicConnection* connection, |
| 30 const QuicServerId& server_id, | 30 const QuicServerId& server_id, |
| 31 QuicCryptoClientConfig* crypto_config); | 31 QuicCryptoClientConfig* crypto_config); |
| 32 ~QuicClientSession() override; | 32 ~QuicClientSession() override; |
| 33 | 33 |
| 34 // QuicSession methods: | 34 // QuicSession methods: |
| 35 QuicSpdyClientStream* CreateOutgoingDataStream() override; | 35 QuicSpdyClientStream* CreateOutgoingDynamicStream() override; |
| 36 QuicCryptoClientStream* GetCryptoStream() override; | 36 QuicCryptoClientStream* GetCryptoStream() override; |
| 37 | 37 |
| 38 // QuicClientSessionBase methods: | 38 // QuicClientSessionBase methods: |
| 39 void OnProofValid(const QuicCryptoClientConfig::CachedState& cached) override; | 39 void OnProofValid(const QuicCryptoClientConfig::CachedState& cached) override; |
| 40 void OnProofVerifyDetailsAvailable( | 40 void OnProofVerifyDetailsAvailable( |
| 41 const ProofVerifyDetails& verify_details) override; | 41 const ProofVerifyDetails& verify_details) override; |
| 42 | 42 |
| 43 // Performs a crypto handshake with the server. | 43 // Performs a crypto handshake with the server. |
| 44 void CryptoConnect(); | 44 void CryptoConnect(); |
| 45 | 45 |
| 46 // Returns the number of client hello messages that have been sent on the | 46 // Returns the number of client hello messages that have been sent on the |
| 47 // crypto stream. If the handshake has completed then this is one greater | 47 // crypto stream. If the handshake has completed then this is one greater |
| 48 // than the number of round-trips needed for the handshake. | 48 // than the number of round-trips needed for the handshake. |
| 49 int GetNumSentClientHellos() const; | 49 int GetNumSentClientHellos() const; |
| 50 | 50 |
| 51 void set_respect_goaway(bool respect_goaway) { | 51 void set_respect_goaway(bool respect_goaway) { |
| 52 respect_goaway_ = respect_goaway; | 52 respect_goaway_ = respect_goaway; |
| 53 } | 53 } |
| 54 | 54 |
| 55 protected: | 55 protected: |
| 56 // QuicSession methods: | 56 // QuicSession methods: |
| 57 QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override; | 57 QuicDataStream* CreateIncomingDynamicStream(QuicStreamId id) override; |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 scoped_ptr<QuicCryptoClientStream> crypto_stream_; | 60 scoped_ptr<QuicCryptoClientStream> crypto_stream_; |
| 61 | 61 |
| 62 // If this is set to false, the client will ignore server GOAWAYs and allow | 62 // If this is set to false, the client will ignore server GOAWAYs and allow |
| 63 // the creation of streams regardless of the high chance they will fail. | 63 // the creation of streams regardless of the high chance they will fail. |
| 64 bool respect_goaway_; | 64 bool respect_goaway_; |
| 65 | 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); | 66 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace tools | 69 } // namespace tools |
| 70 } // namespace net | 70 } // namespace net |
| 71 | 71 |
| 72 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_ | 72 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_ |
| OLD | NEW |