• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright 2020 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 
11 #ifndef API_TRANSPORT_SCTP_TRANSPORT_FACTORY_INTERFACE_H_
12 #define API_TRANSPORT_SCTP_TRANSPORT_FACTORY_INTERFACE_H_
13 
14 #include <memory>
15 
16 // These classes are not part of the API, and are treated as opaque pointers.
17 namespace cricket {
18 class SctpTransportInternal;
19 }  // namespace cricket
20 
21 namespace rtc {
22 class PacketTransportInternal;
23 }  // namespace rtc
24 
25 namespace webrtc {
26 
27 // Factory class which can be used to allow fake SctpTransports to be injected
28 // for testing. An application is not intended to implement this interface nor
29 // 'cricket::SctpTransportInternal' because SctpTransportInternal is not
30 // guaranteed to remain stable in future WebRTC versions.
31 class SctpTransportFactoryInterface {
32  public:
33   virtual ~SctpTransportFactoryInterface() = default;
34 
35   // Create an SCTP transport using `channel` for the underlying transport.
36   virtual std::unique_ptr<cricket::SctpTransportInternal> CreateSctpTransport(
37       rtc::PacketTransportInternal* channel) = 0;
38 };
39 
40 }  // namespace webrtc
41 
42 #endif  // API_TRANSPORT_SCTP_TRANSPORT_FACTORY_INTERFACE_H_
43