diff options
Diffstat (limited to 'net/quic/crypto/quic_crypto_server_config.h')
-rw-r--r-- | net/quic/crypto/quic_crypto_server_config.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/quic/crypto/quic_crypto_server_config.h b/net/quic/crypto/quic_crypto_server_config.h index 0886a52..0b76268 100644 --- a/net/quic/crypto/quic_crypto_server_config.h +++ b/net/quic/crypto/quic_crypto_server_config.h @@ -39,6 +39,14 @@ namespace test { class QuicCryptoServerConfigPeer; } // namespace test +// Hook that allows application code to subscribe to primary config changes. +class PrimaryConfigChangedCallback { + public: + PrimaryConfigChangedCallback(); + virtual ~PrimaryConfigChangedCallback(); + virtual void Run(const std::string& scid) = 0; +}; + // Callback used to accept the result of the |client_hello| validation step. class NET_EXPORT_PRIVATE ValidateClientHelloResultCallback { public: @@ -134,6 +142,9 @@ class NET_EXPORT_PRIVATE QuicCryptoServerConfig { bool SetConfigs(const std::vector<QuicServerConfigProtobuf*>& protobufs, QuicWallTime now); + // Get the server config ids for all known configs. + void GetConfigIds(std::vector<std::string>* scids) const; + // Checks |client_hello| for gross errors and determines whether it // can be shown to be fresh (i.e. not a replay). The result of the // validation step must be interpreted by calling @@ -254,6 +265,9 @@ class NET_EXPORT_PRIVATE QuicCryptoServerConfig { // uniqueness. void set_server_nonce_strike_register_window_secs(uint32 window_secs); + // Set and take ownership of the callback to invoke on primary config changes. + void AcquirePrimaryConfigChangedCb(PrimaryConfigChangedCallback* cb); + private: friend class test::QuicCryptoServerConfigPeer; @@ -382,6 +396,8 @@ class NET_EXPORT_PRIVATE QuicCryptoServerConfig { // next_config_promotion_time_ contains the nearest, future time when an // active config will be promoted to primary. mutable QuicWallTime next_config_promotion_time_; + // Callback to invoke when the primary config changes. + scoped_ptr<PrimaryConfigChangedCallback> primary_config_changed_cb_; // Protects access to the pointer held by strike_register_client_. mutable base::Lock strike_register_client_lock_; |