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