Chromium Code Reviews| Index: net/quic/quic_crypto_client_stream.h |
| =================================================================== |
| --- net/quic/quic_crypto_client_stream.h (revision 279242) |
| +++ net/quic/quic_crypto_client_stream.h (working copy) |
| @@ -7,6 +7,7 @@ |
| #include <string> |
| +#include "net/quic/crypto/channel_id.h" |
| #include "net/quic/crypto/proof_verifier.h" |
| #include "net/quic/crypto/quic_crypto_client_config.h" |
| #include "net/quic/quic_config.h" |
| @@ -44,6 +45,25 @@ |
| int num_sent_client_hellos() const; |
| private: |
| + // ChannelIDSourceCallbackImpl is passed as the callback method to |
| + // GetChannelIDKey. The ChannelIDSource calls this class with the result of |
| + // channel ID lookup when lookup is performed asynchronously. |
| + class ChannelIDSourceCallbackImpl : public ChannelIDSourceCallback { |
| + public: |
| + explicit ChannelIDSourceCallbackImpl(QuicCryptoClientStream* stream); |
| + virtual ~ChannelIDSourceCallbackImpl(); |
| + |
| + // ChannelIDSourceCallback interface. |
| + virtual void Run(scoped_ptr<ChannelIDKey>* channel_id_key) OVERRIDE; |
| + |
| + // Cancel causes any future callbacks to be ignored. It must be called on |
| + // the same thread as the callback will be made on. |
| + void Cancel(); |
| + |
| + private: |
| + QuicCryptoClientStream* stream_; |
| + }; |
| + |
| // ProofVerifierCallbackImpl is passed as the callback method to VerifyProof. |
| // The ProofVerifier calls this class with the result of proof verification |
| // when verification is performed asynchronously. |
| @@ -66,6 +86,7 @@ |
| }; |
| friend class test::CryptoTestUtils; |
| + friend class ChannelIDSourceCallbackImpl; |
| friend class ProofVerifierCallbackImpl; |
|
Ryan Hamilton
2014/06/25 18:55:15
I *think* that you can remove these two friend sta
wtc
2014/06/28 16:03:30
You are right. I verified these two inner classes
|
| enum State { |
| @@ -75,6 +96,8 @@ |
| STATE_RECV_REJ, |
| STATE_VERIFY_PROOF, |
| STATE_VERIFY_PROOF_COMPLETE, |
| + STATE_GET_CHANNEL_ID, |
| + STATE_GET_CHANNEL_ID_COMPLETE, |
| STATE_RECV_SHLO, |
| }; |
| @@ -103,6 +126,16 @@ |
| // Generation counter from QuicCryptoClientConfig's CachedState. |
| uint64 generation_counter_; |
| + // channel_id_source_callback_ contains the callback object that we passed |
| + // to an asynchronous channel ID lookup. The ChannelIDSource owns this |
| + // object. |
| + ChannelIDSourceCallbackImpl* channel_id_source_callback_; |
| + |
| + // These members are used to store the result of an asynchronous channel ID |
| + // lookup. These members must not be used after |
| + // STATE_GET_CHANNEL_ID_COMPLETE. |
| + scoped_ptr<ChannelIDKey> channel_id_key_; |
| + |
| // proof_verify_callback_ contains the callback object that we passed to an |
| // asynchronous proof verification. The ProofVerifier owns this object. |
| ProofVerifierCallbackImpl* proof_verify_callback_; |