dtls_transport_factory.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright 2018 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef P2P_BASE_DTLS_TRANSPORT_FACTORY_H_
  11. #define P2P_BASE_DTLS_TRANSPORT_FACTORY_H_
  12. #include <memory>
  13. #include <string>
  14. #include "p2p/base/dtls_transport_internal.h"
  15. #include "p2p/base/ice_transport_internal.h"
  16. namespace cricket {
  17. // This interface is used to create DTLS transports. The external transports
  18. // can be injected into the JsepTransportController through it.
  19. //
  20. // TODO(qingsi): Remove this factory in favor of one that produces
  21. // DtlsTransportInterface given by the public API if this is going to be
  22. // injectable.
  23. class DtlsTransportFactory {
  24. public:
  25. virtual ~DtlsTransportFactory() = default;
  26. virtual std::unique_ptr<DtlsTransportInternal> CreateDtlsTransport(
  27. IceTransportInternal* ice,
  28. const webrtc::CryptoOptions& crypto_options) = 0;
  29. };
  30. } // namespace cricket
  31. #endif // P2P_BASE_DTLS_TRANSPORT_FACTORY_H_