Index: net/quic/quic_crypto_server_stream.h |
diff --git a/net/quic/quic_crypto_server_stream.h b/net/quic/quic_crypto_server_stream.h |
index ee4013120e4f82d65558465c79b91c2c7a03d71a..9cb242bea802bd7c01753c3fb8e21502eba2a3d4 100644 |
--- a/net/quic/quic_crypto_server_stream.h |
+++ b/net/quic/quic_crypto_server_stream.h |
@@ -16,12 +16,37 @@ namespace net { |
class CryptoHandshakeMessage; |
class QuicCryptoServerConfig; |
+class QuicCryptoServerStream; |
class QuicSession; |
namespace test { |
class CryptoTestUtils; |
} // namespace test |
+// Receives a notification when the server hello (SHLO) has been ACKed by the |
+// peer. At this point we disable HANDSHAKE_MODE in the sent packet manager. |
+class NET_EXPORT_PRIVATE ServerHelloNotifier : public |
+ QuicAckNotifier::DelegateInterface { |
+ public: |
+ explicit ServerHelloNotifier(QuicCryptoServerStream* stream) |
+ : server_stream_(stream) {} |
+ |
+ // QuicAckNotifier::DelegateInterface implementation |
+ virtual void OnAckNotification( |
+ int num_original_packets, |
+ int num_original_bytes, |
+ int num_retransmitted_packets, |
+ int num_retransmitted_bytes, |
+ QuicTime::Delta delta_largest_observed) OVERRIDE; |
+ |
+ private: |
+ virtual ~ServerHelloNotifier() {} |
+ |
+ QuicCryptoServerStream* server_stream_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ServerHelloNotifier); |
+}; |
+ |
class NET_EXPORT_PRIVATE QuicCryptoServerStream : public QuicCryptoStream { |
public: |
QuicCryptoServerStream(const QuicCryptoServerConfig& crypto_config, |
@@ -44,6 +69,17 @@ class NET_EXPORT_PRIVATE QuicCryptoServerStream : public QuicCryptoStream { |
uint8 num_handshake_messages() const { return num_handshake_messages_; } |
+ int num_server_config_update_messages_sent() const { |
+ return num_server_config_update_messages_sent_; |
+ } |
+ |
+ // Sends the latest server config and source-address token to the client. |
+ void SendServerConfigUpdate(); |
+ |
+ // Called by the ServerHello AckNotifier once the SHLO has been ACKed by the |
+ // client. |
+ void OnServerHelloAcked(); |
+ |
protected: |
virtual QuicErrorCode ProcessClientHello( |
const CryptoHandshakeMessage& message, |
@@ -90,8 +126,12 @@ class NET_EXPORT_PRIVATE QuicCryptoServerStream : public QuicCryptoStream { |
// handshake message is being validated. |
ValidateCallback* validate_client_hello_cb_; |
+ // Number of handshake messages received by this stream. |
uint8 num_handshake_messages_; |
+ // Number of server config update (SCUP) messages sent by this stream. |
+ int num_server_config_update_messages_sent_; |
+ |
DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerStream); |
}; |