quic_crypto_client_config_handle.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef NET_QUIC_QUIC_CRYPTO_CLIENT_CONFIG_HANDLE_H_
  5. #define NET_QUIC_QUIC_CRYPTO_CLIENT_CONFIG_HANDLE_H_
  6. #include "net/base/net_export.h"
  7. namespace quic {
  8. class QuicCryptoClientConfig;
  9. } // namespace quic
  10. namespace net {
  11. // Class that allows consumers to access a quic::QuicCryptoClientConfig, while
  12. // ensuring that the QuciStreamFactory that owns it keeps it alive. Once a
  13. // QuicCryptoClientConfigHandle is destroyed, the underlying
  14. // QuicCryptoClientConfig object may be destroyed as well. All
  15. // QuicCryptoClientConfigHandle must be destroyed before the end of the
  16. // QuciStreamFactory's destructor.
  17. //
  18. // This ownership model is used instead of refcounting for stronger safety
  19. // guarantees, and because the underlying QuicCryptoClientConfig depends on
  20. // other network objects that may be deleted after the QuicStreamFactory.
  21. class NET_EXPORT_PRIVATE QuicCryptoClientConfigHandle {
  22. public:
  23. QuicCryptoClientConfigHandle& operator=(const QuicCryptoClientConfigHandle&) =
  24. delete;
  25. virtual ~QuicCryptoClientConfigHandle();
  26. virtual quic::QuicCryptoClientConfig* GetConfig() const = 0;
  27. protected:
  28. QuicCryptoClientConfigHandle();
  29. };
  30. } // namespace net
  31. #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_CONFIG_HANDLE_H_