| 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 #ifndef NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ | 5 #ifndef NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
| 6 #define NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ | 6 #define NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "net/quic/crypto/channel_id.h" | 10 #include "net/quic/crypto/channel_id.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 class NET_EXPORT_PRIVATE QuicCryptoClientStream : public QuicCryptoStream { | 26 class NET_EXPORT_PRIVATE QuicCryptoClientStream : public QuicCryptoStream { |
| 27 public: | 27 public: |
| 28 QuicCryptoClientStream(const QuicServerId& server_id, | 28 QuicCryptoClientStream(const QuicServerId& server_id, |
| 29 QuicClientSessionBase* session, | 29 QuicClientSessionBase* session, |
| 30 ProofVerifyContext* verify_context, | 30 ProofVerifyContext* verify_context, |
| 31 QuicCryptoClientConfig* crypto_config); | 31 QuicCryptoClientConfig* crypto_config); |
| 32 virtual ~QuicCryptoClientStream(); | 32 virtual ~QuicCryptoClientStream(); |
| 33 | 33 |
| 34 // CryptoFramerVisitorInterface implementation | 34 // CryptoFramerVisitorInterface implementation |
| 35 virtual void OnHandshakeMessage( | 35 virtual void OnHandshakeMessage( |
| 36 const CryptoHandshakeMessage& message) OVERRIDE; | 36 const CryptoHandshakeMessage& message) override; |
| 37 | 37 |
| 38 // Performs a crypto handshake with the server. Returns true if the crypto | 38 // Performs a crypto handshake with the server. Returns true if the crypto |
| 39 // handshake is started successfully. | 39 // handshake is started successfully. |
| 40 // TODO(agl): this should probably return void. | 40 // TODO(agl): this should probably return void. |
| 41 virtual bool CryptoConnect(); | 41 virtual bool CryptoConnect(); |
| 42 | 42 |
| 43 // num_sent_client_hellos returns the number of client hello messages that | 43 // num_sent_client_hellos returns the number of client hello messages that |
| 44 // have been sent. If the handshake has completed then this is one greater | 44 // have been sent. If the handshake has completed then this is one greater |
| 45 // than the number of round-trips needed for the handshake. | 45 // than the number of round-trips needed for the handshake. |
| 46 int num_sent_client_hellos() const; | 46 int num_sent_client_hellos() const; |
| 47 | 47 |
| 48 // Returns true if a channel ID was sent on this connection. | 48 // Returns true if a channel ID was sent on this connection. |
| 49 bool WasChannelIDSent() const; | 49 bool WasChannelIDSent() const; |
| 50 | 50 |
| 51 // Returns true if our ChannelIDSourceCallback was run, which implies the | 51 // Returns true if our ChannelIDSourceCallback was run, which implies the |
| 52 // ChannelIDSource operated asynchronously. Intended for testing. | 52 // ChannelIDSource operated asynchronously. Intended for testing. |
| 53 bool WasChannelIDSourceCallbackRun() const; | 53 bool WasChannelIDSourceCallbackRun() const; |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 // ChannelIDSourceCallbackImpl is passed as the callback method to | 56 // ChannelIDSourceCallbackImpl is passed as the callback method to |
| 57 // GetChannelIDKey. The ChannelIDSource calls this class with the result of | 57 // GetChannelIDKey. The ChannelIDSource calls this class with the result of |
| 58 // channel ID lookup when lookup is performed asynchronously. | 58 // channel ID lookup when lookup is performed asynchronously. |
| 59 class ChannelIDSourceCallbackImpl : public ChannelIDSourceCallback { | 59 class ChannelIDSourceCallbackImpl : public ChannelIDSourceCallback { |
| 60 public: | 60 public: |
| 61 explicit ChannelIDSourceCallbackImpl(QuicCryptoClientStream* stream); | 61 explicit ChannelIDSourceCallbackImpl(QuicCryptoClientStream* stream); |
| 62 virtual ~ChannelIDSourceCallbackImpl(); | 62 virtual ~ChannelIDSourceCallbackImpl(); |
| 63 | 63 |
| 64 // ChannelIDSourceCallback interface. | 64 // ChannelIDSourceCallback interface. |
| 65 virtual void Run(scoped_ptr<ChannelIDKey>* channel_id_key) OVERRIDE; | 65 virtual void Run(scoped_ptr<ChannelIDKey>* channel_id_key) override; |
| 66 | 66 |
| 67 // Cancel causes any future callbacks to be ignored. It must be called on | 67 // Cancel causes any future callbacks to be ignored. It must be called on |
| 68 // the same thread as the callback will be made on. | 68 // the same thread as the callback will be made on. |
| 69 void Cancel(); | 69 void Cancel(); |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 QuicCryptoClientStream* stream_; | 72 QuicCryptoClientStream* stream_; |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 // ProofVerifierCallbackImpl is passed as the callback method to VerifyProof. | 75 // ProofVerifierCallbackImpl is passed as the callback method to VerifyProof. |
| 76 // The ProofVerifier calls this class with the result of proof verification | 76 // The ProofVerifier calls this class with the result of proof verification |
| 77 // when verification is performed asynchronously. | 77 // when verification is performed asynchronously. |
| 78 class ProofVerifierCallbackImpl : public ProofVerifierCallback { | 78 class ProofVerifierCallbackImpl : public ProofVerifierCallback { |
| 79 public: | 79 public: |
| 80 explicit ProofVerifierCallbackImpl(QuicCryptoClientStream* stream); | 80 explicit ProofVerifierCallbackImpl(QuicCryptoClientStream* stream); |
| 81 virtual ~ProofVerifierCallbackImpl(); | 81 virtual ~ProofVerifierCallbackImpl(); |
| 82 | 82 |
| 83 // ProofVerifierCallback interface. | 83 // ProofVerifierCallback interface. |
| 84 virtual void Run(bool ok, | 84 virtual void Run(bool ok, |
| 85 const string& error_details, | 85 const string& error_details, |
| 86 scoped_ptr<ProofVerifyDetails>* details) OVERRIDE; | 86 scoped_ptr<ProofVerifyDetails>* details) override; |
| 87 | 87 |
| 88 // Cancel causes any future callbacks to be ignored. It must be called on | 88 // Cancel causes any future callbacks to be ignored. It must be called on |
| 89 // the same thread as the callback will be made on. | 89 // the same thread as the callback will be made on. |
| 90 void Cancel(); | 90 void Cancel(); |
| 91 | 91 |
| 92 private: | 92 private: |
| 93 QuicCryptoClientStream* stream_; | 93 QuicCryptoClientStream* stream_; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 friend class test::CryptoTestUtils; | 96 friend class test::CryptoTestUtils; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 bool verify_ok_; | 211 bool verify_ok_; |
| 212 string verify_error_details_; | 212 string verify_error_details_; |
| 213 scoped_ptr<ProofVerifyDetails> verify_details_; | 213 scoped_ptr<ProofVerifyDetails> verify_details_; |
| 214 | 214 |
| 215 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); | 215 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); |
| 216 }; | 216 }; |
| 217 | 217 |
| 218 } // namespace net | 218 } // namespace net |
| 219 | 219 |
| 220 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ | 220 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
| OLD | NEW |