Index: net/quic/crypto/quic_crypto_server_config.h |
diff --git a/net/quic/crypto/quic_crypto_server_config.h b/net/quic/crypto/quic_crypto_server_config.h |
index 4da3ce42718b05e095c4c1722cfaa79894c77078..0b76268e3b5ed3d6a887d7609cb239c620457ab2 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: |
@@ -257,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; |
@@ -385,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_; |