diff options
Diffstat (limited to 'chromium/net/quic/quic_crypto_client_stream.h')
-rw-r--r-- | chromium/net/quic/quic_crypto_client_stream.h | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/chromium/net/quic/quic_crypto_client_stream.h b/chromium/net/quic/quic_crypto_client_stream.h index edfc1f58e39..cd2e7da23d3 100644 --- a/chromium/net/quic/quic_crypto_client_stream.h +++ b/chromium/net/quic/quic_crypto_client_stream.h @@ -5,8 +5,11 @@ #ifndef NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ #define NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ +#include <stdint.h> + #include <string> +#include "base/macros.h" #include "net/quic/crypto/channel_id.h" #include "net/quic/crypto/proof_verifier.h" #include "net/quic/crypto/quic_crypto_client_config.h" @@ -23,7 +26,23 @@ class CryptoTestUtils; class QuicChromiumClientSessionPeer; } // namespace test -class NET_EXPORT_PRIVATE QuicCryptoClientStream : public QuicCryptoStream { +class NET_EXPORT_PRIVATE QuicCryptoClientStreamBase : public QuicCryptoStream { + public: + explicit QuicCryptoClientStreamBase(QuicClientSessionBase* session); + + ~QuicCryptoClientStreamBase() override{}; + + // Performs a crypto handshake with the server. + virtual void CryptoConnect() = 0; + + // num_sent_client_hellos returns the number of client hello messages that + // have been sent. If the handshake has completed then this is one greater + // than the number of round-trips needed for the handshake. + virtual int num_sent_client_hellos() const = 0; +}; + +class NET_EXPORT_PRIVATE QuicCryptoClientStream + : public QuicCryptoClientStreamBase { public: // kMaxClientHellos is the maximum number of times that we'll send a client // hello. The value 3 accounts for: @@ -32,24 +51,20 @@ class NET_EXPORT_PRIVATE QuicCryptoClientStream : public QuicCryptoStream { // the server being unwilling to send it without a valid source-address // token. static const int kMaxClientHellos = 3; - QuicCryptoClientStream(const QuicServerId& server_id, QuicClientSessionBase* session, ProofVerifyContext* verify_context, QuicCryptoClientConfig* crypto_config); + ~QuicCryptoClientStream() override; + // From QuicCryptoClientStreamBase + void CryptoConnect() override; + int num_sent_client_hellos() const override; + // CryptoFramerVisitorInterface implementation void OnHandshakeMessage(const CryptoHandshakeMessage& message) override; - // Performs a crypto handshake with the server. - virtual void CryptoConnect(); - - // num_sent_client_hellos returns the number of client hello messages that - // have been sent. If the handshake has completed then this is one greater - // than the number of round-trips needed for the handshake. - int num_sent_client_hellos() const; - // Returns true if a channel ID was sent on this connection. bool WasChannelIDSent() const; @@ -128,8 +143,7 @@ class NET_EXPORT_PRIVATE QuicCryptoClientStream : public QuicCryptoStream { void DoInitialize(QuicCryptoClientConfig::CachedState* cached); // Send either InchoateClientHello or ClientHello message to the server. - void DoSendCHLO(const CryptoHandshakeMessage* in, - QuicCryptoClientConfig::CachedState* cached); + void DoSendCHLO(QuicCryptoClientConfig::CachedState* cached); // Process REJ message from the server. void DoReceiveREJ(const CryptoHandshakeMessage* in, @@ -184,7 +198,7 @@ class NET_EXPORT_PRIVATE QuicCryptoClientStream : public QuicCryptoStream { const QuicServerId server_id_; // Generation counter from QuicCryptoClientConfig's CachedState. - uint64 generation_counter_; + uint64_t generation_counter_; // True if a channel ID was sent. bool channel_id_sent_; @@ -222,6 +236,8 @@ class NET_EXPORT_PRIVATE QuicCryptoClientStream : public QuicCryptoStream { // STATE_VERIFY_PROOF*, and subsequent STATE_SEND_CHLO state. bool stateless_reject_received_; + base::TimeTicks proof_verify_start_time_; + DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); }; |